Green function for crystal surfaces I