6 subroutine rhomaguk(ik0,evecu,rhormt_,rhorir_,magrmt_,magrir_)
12 integer,
intent(in) :: ik0
13 complex(8),
intent(in) :: evecu(nstulr,nstulr)
14 real(8),
intent(inout) :: rhormt_(npcmtmax,natmtot,nqpt)
15 real(8),
intent(inout) :: rhorir_(ngtc,nqpt)
16 real(8),
intent(inout) :: magrmt_(npcmtmax,natmtot,ndmag,nqpt)
17 real(8),
intent(inout) :: magrir_(ngtc,ndmag,nqpt)
20 integer nst,ist,jst,i,j
29 complex(8),
allocatable :: apwalm(:,:,:,:),evecfv(:,:),evecsv(:,:)
30 complex(8),
allocatable :: evectv(:,:,:),evecsvt(:,:)
31 complex(8),
allocatable :: wfmt(:,:,:,:),wfir(:,:,:)
43 call match(ngk0,
vgkc(:,:,1,ik),
gkc(:,1,ik),
sfacgk(:,:,1,ik),apwalm)
44 allocate(evectv(nstsv,nstsv,nqpt))
51 allocate(evecsvt(nstsv,nstsv))
52 allocate(wfmt(npcmtmax,natmtot,
nspinor,nstsv),wfir(ngtc,
nspinor,nstsv))
69 j=(jkpa-1)*nstsv+idx(jst)
75 zfft(
iqfft(ikpa))=evecu(i,j)
79 evectv(ist,jst,1:nqpt)=zfft(1:nqpt)
87 call zgemm(
'N',
'N',nstsv,nst,nstsv,
zone,evecsv,nstsv,evectv(:,:,ir), &
88 nstsv,
zzero,evecsvt,nstsv)
90 call genwfsv(.false.,.false.,nst,[0],
ngdgc,
igfc,ngk0,
igkig(:,1,ik),apwalm, &
91 evecfv,evecsvt,wfmt,ngtc,wfir)
94 j=(jkpa-1)*nstsv+idx(jst)
103 call rmk1(npc,wo,wfmt(:,ias,1,jst),wfmt(:,ias,2,jst), &
104 rhormt_(:,ias,ir),magrmt_(:,ias,1,ir),magrmt_(:,ias,2,ir), &
107 call rmk2(npc,wo,wfmt(:,ias,1,jst),wfmt(:,ias,2,jst), &
108 rhormt_(:,ias,ir),magrmt_(:,ias,1,ir))
111 call rmk3(npc,wo,wfmt(:,ias,1,jst),rhormt_(:,ias,ir))
117 call rmk1(ngtc,wo,wfir(:,1,jst),wfir(:,2,jst),rhorir_(:,ir), &
118 magrir_(:,1,ir),magrir_(:,2,ir),magrir_(:,3,ir))
120 call rmk2(ngtc,wo,wfir(:,1,jst),wfir(:,2,jst),rhorir_(:,ir), &
124 call rmk3(ngtc,wo,wfir(:,1,jst),rhorir_(:,ir))
131 deallocate(evecsvt,wfmt,wfir)
134 deallocate(apwalm,evecfv,evecsv,evectv)
141 pure subroutine rmk1(n,wo,wf1,wf2,rho,mag1,mag2,mag3)
144 integer,
intent(in) :: n
145 real(8),
intent(in) :: wo
146 complex(8),
intent(in) :: wf1(n),wf2(n)
147 real(8),
intent(inout) :: rho(n),mag1(n),mag2(n),mag3(n)
155 a1=wf1(i)%re; b1=wf1(i)%im
156 a2=wf2(i)%re; b2=wf2(i)%im
157 t1=a1**2+b1**2; t2=a2**2+b2**2
158 mag1(i)=mag1(i)+wo2*(a1*a2+b1*b2)
159 mag2(i)=mag2(i)+wo2*(a1*b2-b1*a2)
160 mag3(i)=mag3(i)+wo*(t1-t2)
161 rho(i)=rho(i)+wo*(t1+t2)
165 pure subroutine rmk2(n,wo,wf1,wf2,rho,mag)
168 integer,
intent(in) :: n
169 real(8),
intent(in) :: wo
170 complex(8),
intent(in) :: wf1(n),wf2(n)
171 real(8),
intent(inout) :: rho(n),mag(n)
177 t1=wf1(i)%re**2+wf1(i)%im**2
178 t2=wf2(i)%re**2+wf2(i)%im**2
179 mag(i)=mag(i)+wo*(t1-t2)
180 rho(i)=rho(i)+wo*(t1+t2)
184 pure subroutine rmk3(n,wo,wf,rho)
187 integer,
intent(in) :: n
188 real(8),
intent(in) :: wo
189 complex(8),
intent(in) :: wf(n)
190 real(8),
intent(inout) :: rho(n)
194 rho(i)=rho(i)+wo*(wf(i)%re**2+wf(i)%im**2)
integer, dimension(maxspecies) npcmt
subroutine getevecsv(fext, ikp, vpl, evecsv)
subroutine genwfsv(tsh, tgp, nst, idx, ngridg_, igfft_, ngp, igpig, apwalm, evecfv, evecsv, wfmt, ld, wfir)
subroutine getevecfv(fext, ikp, vpl, vgpl, evecfv)
subroutine match(ngp, vgpc, gpc, sfacgp, apwalm)
complex(8), parameter zone
complex(8), dimension(:,:,:,:), allocatable sfacgk
integer, dimension(:), allocatable iqfft
integer, dimension(:,:), allocatable ngk
subroutine zfftifc(nd, n, sgn, z)
real(8), dimension(:), allocatable wkpt
real(8), dimension(:,:), allocatable occulr
real(8), dimension(:,:,:,:), allocatable vgkl
integer, dimension(:), allocatable igfc
real(8), dimension(:,:,:,:), allocatable vgkc
complex(8), parameter zzero
integer, dimension(3) ngridq
real(8), dimension(:,:), allocatable vkl
integer, dimension(maxatoms *maxspecies) idxis
pure subroutine rmk3(n, wo, wf, rho)
real(8), dimension(:,:,:), allocatable gkc
integer, dimension(3) ngdgc
subroutine holdthd(nloop, nthd)
subroutine rhomaguk(ik0, evecu, rhormt_, rhorir_, magrmt_, magrir_)
pure subroutine rmk1(n, wo, wf1, wf2, rho, mag1, mag2, mag3)
pure subroutine rmk2(n, wo, wf1, wf2, rho, mag)
integer, dimension(:,:,:), allocatable igkig