10real(8),
intent(in) :: vpl(3)
11complex(8),
intent(in) :: expmt(npcmtmax,natmtot)
12complex(8),
intent(out) :: emat(nstsv,nstsv)
14integer ist,jst,ispn,i,j,k,l
15integer is,ia,ias,nrc,nrci
16integer npc,ngp,ngpq,igp,ifg
17real(8) vpc(3),vpql(3),vpqc(3),t1
20integer,
allocatable :: igpig(:),igpqig(:)
21real(8),
allocatable :: vgpl(:,:),vgpc(:,:),gpc(:)
22real(8),
allocatable :: vgpql(:,:),vgpqc(:,:),gpqc(:)
23complex(8),
allocatable :: sfacgp(:,:),sfacgpq(:,:)
24complex(8),
allocatable :: apwalm1(:,:,:,:),apwalm2(:,:,:,:)
25complex(8),
allocatable :: evecfv1(:,:),evecfv2(:,:)
26complex(8),
allocatable :: evecsv1(:,:),evecsv2(:,:)
27complex(8),
allocatable :: wfmt1(:),wfmt2(:,:)
28complex(8),
allocatable :: zfir(:),z(:),em(:,:)
30complex(8),
external :: zfmtinp,zdotc
49 allocate(evecsv1(nstsv,nstsv),evecsv2(nstsv,nstsv))
51allocate(wfmt1(npcmtmax),wfmt2(npcmtmax,
nstfv))
56call gengkvec(
ngvc,
ivg,
vgc,vpl,vpc,
gkmax,
ngkmax,ngp,igpig,vgpl,vgpc,gpc)
60call match(ngp,vgpc,gpc,sfacgp,apwalm1)
64vpql(:)=vpl(:)+
vecql(:)
68call gengkvec(
ngvc,
ivg,
vgc,vpql,vpqc,
gkmax,
ngkmax,ngpq,igpqig,vgpql,vgpqc,gpqc)
72call match(ngpq,vgpqc,gpqc,sfacgpq,apwalm2)
88 call wfmtfv(ias,ngpq,apwalm2(:,:,:,ias),evecfv2(:,ist),wfmt1)
90 call zbsht(nrc,nrci,wfmt1,wfmt2(:,ist))
92 wfmt1(1:npc)=conjg(expmt(1:npc,ias))*wfmt2(1:npc,ist)
94 call zfsht(nrc,nrci,wfmt1,wfmt2(:,ist))
98 call wfmtfv(ias,ngp,apwalm1(:,:,:,ias),evecfv1(:,jst),wfmt1)
100 em(ist,jst)=em(ist,jst)+
zfmtinp(nrc,nrci,
wr2cmt(:,is),wfmt2(:,ist), &
114 ifg=
igfft(igpig(igp))
115 zfir(ifg)=evecfv1(igp,jst)
125 ifg=
igfft(igpqig(igp))
130 em(ist,jst)=em(ist,jst)+zdotc(ngpq,evecfv2(:,ist),1,z,1)
150 z1=z1+em(ist,jst)*conjg(evecsv2(k,i))*evecsv1(l,j)
160deallocate(igpig,igpqig,vgpl,vgpc,gpc)
161deallocate(vgpql,vgpqc,gpqc,sfacgp,sfacgpq)
162deallocate(apwalm1,apwalm2,evecfv1,evecfv2)
163if (
tevecsv)
deallocate(evecsv1,evecsv2)
164deallocate(wfmt1,wfmt2,zfir,z,em)
pure subroutine gengkvec(ngv, ivg, vgc, vkl, vkc, gkmax, ngkmax, ngk, igkig, vgkl, vgkc, gkc)
integer, dimension(3) ngridg
integer, dimension(maxspecies) natoms
real(8), dimension(3, 3) bvec
integer, dimension(maxatoms, maxspecies) idxas
real(8), dimension(3) vecql
integer, dimension(maxspecies) nrcmt
real(8), dimension(:,:), allocatable wr2cmt
real(8), dimension(:), allocatable cfunir
integer, dimension(maxspecies) npcmt
integer, dimension(:), allocatable igfft
integer, dimension(:,:), allocatable ivg
real(8), dimension(:,:), allocatable vgc
integer, dimension(maxspecies) nrcmti