6subroutine eveqnhf(ikp,vmt,vir,bmt,bir,evecsvp)
11integer,
intent(in) :: ikp
12real(8),
intent(in) :: vmt(npcmtmax,natmtot),vir(ngtc)
13real(8),
intent(in) :: bmt(npcmtmax,natmtot,ndmag),bir(ngtc,ndmag)
14complex(8),
intent(inout) :: evecsvp(nstsv,nstsv)
17integer ist1,ist2,ist3,jst3
18integer iv(3),iq,ig,nthd
23real(8) vgqc(3,ngvc),gqc(ngvc),gclgq(ngvc)
25real(8),
allocatable :: jlgqrmt(:,:,:)
26complex(8),
allocatable :: apwalm(:,:,:,:),evecfv(:,:),evecsv(:,:)
27complex(8),
allocatable :: ylmgq(:,:),sfacgq(:,:)
28complex(8),
allocatable :: h(:,:),v(:,:),kmat(:,:)
29complex(4),
allocatable :: wfmt1(:,:,:,:),wfir1(:,:,:)
30complex(4),
allocatable :: wfmt2(:,:,:,:),wfir2(:,:,:)
31complex(4),
allocatable :: crhomt(:,:,:),crhoir(:,:)
32complex(4),
allocatable :: cvclmt(:,:),cvclir(:)
34complex(8),
external :: zcfinp
36write(*,
'("Info(eveqnhf): ",I6," of ",I6," k-points")') ikp,
nkpt
42allocate(ylmgq(
lmmaxo,ngvc),sfacgq(ngvc,natmtot))
43allocate(h(nstsv,nstsv),v(nstsv,nstsv))
44allocate(wfmt1(npcmtmax,natmtot,
nspinor,nstsv),wfir1(ngtc,
nspinor,nstsv))
45allocate(wfmt2(npcmtmax,natmtot,
nspinor,nstsv),wfir2(ngtc,
nspinor,nstsv))
46allocate(crhomt(npcmtmax,natmtot,nstsv),crhoir(ngtc,nstsv))
50call match(
ngk(1,ikp),
vgkc(:,:,1,ikp),
gkc(:,1,ikp),
sfacgk(:,:,1,ikp),apwalm)
52call genwfsv_sp(.false.,.true.,nstsv,[0],
ngdgc,
igfc,
ngk(1,ikp),
igkig(:,1,ikp), &
53 apwalm,evecfv,evecsvp,wfmt1,ngtc,wfir1)
59 call genvbmatk(vmt,vir,bmt,bir,
ngk(1,ikp),
igkig(:,1,ikp),wfmt1,ngtc,wfir1,h)
61 call genvmatk(vmt,vir,
ngk(1,ikp),
igkig(:,1,ikp),wfmt1,ngtc,wfir1,h)
68allocate(kmat(nstsv,nstsv))
70call zgemm(
'N',
'N',nstsv,nstsv,nstsv,
zone,kmat,nstsv,evecsvp,nstsv,
zzero,v, &
72call zgemm(
'C',
'N',nstsv,nstsv,nstsv,
zone,evecsvp,nstsv,v,nstsv,
zone,h,nstsv)
83 iv(1:3)=
ivk(1:3,ikp)-
ivk(1:3,ik)
84 iv(1:3)=modulo(iv(1:3),
ngridk(1:3))
86 iv(1:3)=iv(1:3)*
ngridq(1:3)
87 if (any(mod(iv(1:3),
ngridk(1:3)) /= 0)) cycle
88 iv(1:3)=iv(1:3)/
ngridk(1:3)
89 iq=
ivqiq(iv(1),iv(2),iv(3))
90 vc(1:3)=
vkc(1:3,ikp)-
vkc(1:3,ik)
93 vgqc(1:3,ig)=
vgc(1:3,ig)+vc(1:3)
95 gqc(ig)=sqrt(vgqc(1,ig)**2+vgqc(2,ig)**2+vgqc(3,ig)**2)
102 call gengclgq(.true.,iq,ngvc,gqc,gclgq)
106 call match(
ngk(1,ik),
vgkc(:,:,1,ik),
gkc(:,1,ik),
sfacgk(:,:,1,ik),apwalm)
118 call genwfsv_sp(.false.,.false.,nst,idx,
ngdgc,
igfc,
ngk(1,ik),
igkig(:,1,ik), &
119 apwalm,evecfv,evecsv,wfmt2,ngtc,wfir2)
125 allocate(cvclmt(npcmtmax,natmtot),cvclir(ngtc))
131 call gencrho(.true.,.true.,ngtc,wfmt2(:,:,:,ist3),wfir2(:,:,ist3), &
132 wfmt1(:,:,:,ist1),wfir1(:,:,ist1),crhomt(:,:,ist1),crhoir(:,ist1))
140 crhomt(:,:,ist2),cvclmt)
142 gclgq,ngvc,jlgqrmt,ylmgq,sfacgq,crhoir(:,ist2),npcmtmax,cvclmt,cvclir)
143 cvclir(:)=cvclir(:)*
cfrc(:)
145 z1=zcfinp(crhomt(:,:,ist1),crhoir(:,ist1),cvclmt,cvclir)
146 v(ist1,ist2)=v(ist1,ist2)-t1*z1
151 deallocate(cvclmt,cvclir)
156deallocate(jlgqrmt,ylmgq,sfacgq,apwalm,evecfv)
157deallocate(wfmt1,wfir1,wfmt2,wfir2,crhomt,crhoir)
168evecsv(:,:)=evecsvp(:,:)
169call zgemm(
'N',
'N',nstsv,nstsv,nstsv,
zone,evecsv,nstsv,h,nstsv,
zzero,evecsvp, &
171deallocate(evecsv,h,v)
subroutine cftwfir(ngp, igpig, wfir)
subroutine cpotcoul(nrmt_, nrmti_, npmt_, ld1, rl, ngridg_, igfft_, ngp, gpc, gclgp, ld2, jlgprmt, ylmgp, sfacgp, crhoir, ld3, cvclmt, cvclir)
subroutine eveqnhf(ikp, vmt, vir, bmt, bir, evecsvp)
subroutine eveqnzh(n, ld, a, w)
subroutine gencrho(tsh, tspc, ngt, wfmt1, wfir1, wfmt2, wfir2, crhomt, crhoir)
subroutine gencvclmt(nrmt_, nrmti_, ld1, rl, wpr, ld2, crhomt, cvclmt)
pure subroutine gengclgq(treg, iq, ngq, gqc, gclgq)
subroutine genjlgprmt(lmax, ngp, gpc, ld, jlgprmt)
pure subroutine gensfacgp(ngp, vgpc, ld, sfacgp)
subroutine genvbmatk(vmt, vir, bmt, bir, ngp, igpig, wfmt, ld, wfgp, vbmat)
subroutine genvmatk(vmt, vir, ngp, igpig, wfmt, ld, wfgp, vmat)
subroutine genwfsv_sp(tsh, tgp, nst, idx, ngridg_, igfft_, ngp, igpig, apwalm, evecfv, evecsv, wfmt, ld, wfir)
pure subroutine genylmv(t4pil, lmax, v, ylm)
subroutine getevecfv(fext, ikp, vpl, vgpl, evecfv)
subroutine getevecsv(fext, ikp, vpl, evecsv)
subroutine getkmat(ik, kmat)
subroutine match(ngp, vgpc, gpc, sfacgp, apwalm)
real(8), dimension(:,:,:,:), allocatable vgkc
complex(8), parameter zzero
real(8), dimension(:,:,:), allocatable gkc
real(8), dimension(:), allocatable cfrc
integer, dimension(3) ngdgc
integer, dimension(:,:), allocatable ngk
integer, dimension(:,:,:), allocatable igkig
integer, dimension(maxspecies) nrcmt
integer, dimension(:,:), allocatable ivk
complex(8), parameter zone
integer, dimension(:,:,:), allocatable ivqiq
integer, dimension(:), allocatable igfc
real(8), dimension(:,:,:), allocatable rlcmt
real(8), dimension(:,:,:,:), allocatable vgkl
integer, dimension(3) ngridk
real(8), dimension(:,:,:), allocatable wprcmt
integer, dimension(maxspecies) npcmt
real(8), dimension(:,:), allocatable vkl
real(8), dimension(:,:), allocatable vgc
integer, dimension(:,:,:), allocatable ivkik
real(8), dimension(:,:), allocatable vkc
complex(8), dimension(:,:,:,:), allocatable sfacgk
integer, dimension(maxspecies) nrcmti
integer, dimension(3) ngridq
real(8), dimension(:,:), allocatable occsv
real(8), dimension(:,:), allocatable evalsv
subroutine holdthd(nloop, nthd)