1!
2! Copyright (C) 2003 A. Smogunov
3! This file is distributed under the terms of the
4! GNU General Public License. See the file `License'
5! in the root directory of the present distribution,
6! or http://www.gnu.org/copyleft/gpl.txt .
7!
8subroutine form_zk(n2d, nrzp, zkr, zk, e, tpiba)
9!
10! To construct complex wavevectors zk=sqrt(e-E_n)
11! for an energy e from eigenvalues E_n of 2d problem
12!
13  USE kinds, only : DP
14  implicit none
15  integer :: nrzp, n2d, n, k
16  real(DP) :: zkr(n2d,nrzp), e, ed, tpiba
17  complex(DP) :: zk(n2d,nrzp)
18
19  do k=1, nrzp
20    do n=1, n2d
21      ed = e-zkr(n,k)
22      zk(n,k)=SQRT(CMPLX(ed,0.d0,kind=DP))/tpiba
23    enddo
24  enddo
25
26  return
27end subroutine form_zk
28
29