12integer ik,ist,i,l,nthd
13real(8) ca,sm,v(3),wo,t1
14complex(8) z11,z12,z21,z22
18complex(8),
allocatable :: apwalm(:,:,:,:),evecfv(:,:),evecsv(:,:)
19complex(8),
allocatable :: wfmt(:,:,:,:),wfgk(:,:,:),pmat(:,:,:)
21complex(8),
external :: zdotc
36allocate(pmat(nstsv,nstsv,3))
45 call match(
ngk(1,ik),
vgkc(:,:,1,ik),
gkc(:,1,ik),
sfacgk(:,:,1,ik),apwalm)
47 call genwfsv(.true.,.true.,nstsv,[0],
ngridg,
igfft,
ngk(:,ik),
igkig(:,:,ik), &
48 apwalm,evecfv,evecsv,wfmt,
ngkmax,wfgk)
50 call genpmatk(
ngk(:,ik),
igkig(:,:,ik),
vgkc(:,:,:,ik),wfmt,wfgk,pmat)
53 if (abs(wo) <
epsocc) cycle
56 v(1:3)=ca*
afspc(l,1:3)
58 z12=cmplx(v(1),-v(2),8)
59 z21=cmplx(v(1),v(2),8)
62 call zgemv(
'N',nstsv,nstsv,
zone,evecsv,nstsv,pmat(:,ist,l),1,
zzero,y,1)
64 t1=dble(z11*zdotc(
nstfv,evecsv(1,ist),1,y,1)) &
65 +dble(z12*zdotc(
nstfv,evecsv(1,ist),1,y(i),1)) &
66 +dble(z21*zdotc(
nstfv,evecsv(i,ist),1,y,1)) &
67 +dble(z22*zdotc(
nstfv,evecsv(i,ist),1,y(i),1))
74deallocate(apwalm,evecfv,evecsv)
75deallocate(wfmt,wfgk,pmat)
80 call mpi_allreduce(mpi_in_place,sm,1,mpi_double_precision,mpi_sum,
mpicom, &
subroutine genpmatk(ngp, igpig, vgpc, wfmt, wfgp, pmat)
subroutine genwfsv(tsh, tgp, nst, idx, ngridg_, igfft_, ngp, igpig, apwalm, evecfv, evecsv, wfmt, ld, wfir)
subroutine getevecfv(fext, ikp, vpl, vgpl, evecfv)
subroutine getevecsv(fext, ikp, vpl, evecsv)
subroutine match(ngp, vgpc, gpc, sfacgp, apwalm)
real(8), dimension(:,:,:,:), allocatable vgkc
real(8), dimension(:), allocatable wkpt
complex(8), parameter zzero
integer, dimension(3) ngridg
real(8), dimension(:,:,:), allocatable gkc
integer, dimension(:,:), allocatable ngk
integer, dimension(:,:,:), allocatable igkig
complex(8), parameter zone
real(8), dimension(3, 3) afspc
real(8), dimension(:,:,:,:), allocatable vgkl
integer, dimension(:), allocatable igfft
real(8), dimension(:,:), allocatable vkl
complex(8), dimension(:,:,:,:), allocatable sfacgk
real(8), dimension(:,:), allocatable occsv
subroutine holdthd(nloop, nthd)