9 subroutine rhomagk(ngp,igpig,wppt,occsvp,apwalm,evecfv,evecsv,rhomt_,rhoir_, &
48 integer,
intent(in) :: ngp(nspnfv),igpig(ngkmax,nspnfv)
49 real(8),
intent(in) :: wppt,occsvp(nstsv)
50 complex(8),
intent(in) :: apwalm(ngkmax,apwordmax,lmmaxapw,natmtot,nspnfv)
51 complex(8),
intent(in) :: evecfv(nmatmax,nstfv,nspnfv),evecsv(nstsv,nstsv)
52 real(8),
intent(inout) :: rhomt_(npcmtmax,natmtot),rhoir_(ngtc)
53 real(8),
intent(inout) :: magmt_(npcmtmax,natmtot,ndmag),magir_(ngtc,ndmag)
55 integer ispn,jspn,nst,ist
56 integer is,ias,npc,j,k
62 complex(8) wfir(ngtc,nspinor),wfgp(ngkmax)
64 complex(8),
allocatable :: wfmt(:,:,:)
69 if (abs(occsvp(ist)) <
epsocc) cycle
76 call holdthd(max(natmtot,nst),nthd)
82 allocate(wfmt(npcmtmax,nspinor,nst))
87 call wfmtsv(.false.,
lradstp,is,ias,nst,idx,ngp,apwalm,evecfv,evecsv,npcmtmax,&
97 call rmk1(npc,wo,wfmt(:,1,j),wfmt(:,2,j),rhomt_(:,ias),magmt_(:,ias,1),&
98 magmt_(:,ias,2),magmt_(:,ias,3))
101 call rmk2(npc,wo,wfmt(:,1,j),wfmt(:,2,j),rhomt_(:,ias),magmt_(:,ias,1))
105 call rmk3(npc,wo,wfmt(:,1,j),rhomt_(:,ias))
117 wo=occsvp(k)*wppt/
omega 125 z1=evecsv((ispn-1)*nstfv+ist,k)
126 if (abs(z1%re)+abs(z1%im) >
epswf)
then 127 wfgp(1:n)=wfgp(1:n)+z1*evecfv(1:n,ist,jspn)
130 wfir(1:ngtc,ispn)=0.d0
132 wfir(
igfc(igpig(igp,jspn)),ispn)=wfgp(igp)
141 wfir(
igfc(igpig(igp,1)),1)=evecfv(igp,k,1)
151 call rmk1(ngtc,wo,wfir,wfir(:,2),rhoir_,magir_,magir_(:,2),magir_(:,3))
154 call rmk2(ngtc,wo,wfir,wfir(:,2),rhoir_,magir_)
158 call rmk3(ngtc,wo,wfir,rhoir_)
171 pure subroutine rmk1(n,wo,wf1,wf2,rho,mag1,mag2,mag3)
174 integer,
intent(in) :: n
175 real(8),
intent(in) :: wo
176 complex(8),
intent(in) :: wf1(n),wf2(n)
177 real(8),
intent(inout) :: rho(n),mag1(n),mag2(n),mag3(n)
185 a1=dble(wf1(i)); b1=aimag(wf1(i))
186 a2=dble(wf2(i)); b2=aimag(wf2(i))
187 t1=a1**2+b1**2; t2=a2**2+b2**2
188 mag1(i)=mag1(i)+wo2*(a1*a2+b1*b2)
189 mag2(i)=mag2(i)+wo2*(a1*b2-b1*a2)
190 mag3(i)=mag3(i)+wo*(t1-t2)
191 rho(i)=rho(i)+wo*(t1+t2)
195 pure subroutine rmk2(n,wo,wf1,wf2,rho,mag)
198 integer,
intent(in) :: n
199 real(8),
intent(in) :: wo
200 complex(8),
intent(in) :: wf1(n),wf2(n)
201 real(8),
intent(inout) :: rho(n),mag(n)
207 t1=dble(wf1(i))**2+aimag(wf1(i))**2
208 t2=dble(wf2(i))**2+aimag(wf2(i))**2
209 mag(i)=mag(i)+wo*(t1-t2)
210 rho(i)=rho(i)+wo*(t1+t2)
214 pure subroutine rmk3(n,wo,wf,rho)
217 integer,
intent(in) :: n
218 real(8),
intent(in) :: wo
219 complex(8),
intent(in) :: wf(n)
220 real(8),
intent(inout) :: rho(n)
221 rho(1:n)=rho(1:n)+wo*(dble(wf(1:n))**2+aimag(wf(1:n))**2)
integer, dimension(maxspecies) npcmt
subroutine rhomagk(ngp, igpig, wppt, occsvp, apwalm, evecfv, evecsv, rhomt_, rhoir_, magmt_, magir_)
subroutine zfftifc(nd, n, sgn, z)
integer, dimension(:), allocatable igfc
integer, dimension(maxatoms *maxspecies) idxis
pure subroutine rmk3(n, wo, wf, rho)
integer, dimension(3) ngdgc
subroutine holdthd(nloop, nthd)
pure subroutine rmk1(n, wo, wf1, wf2, rho, mag1, mag2, mag3)
pure subroutine rmk2(n, wo, wf1, wf2, rho, mag)
subroutine wfmtsv(tsh, lrstp, is, ias, nst, idx, ngp, apwalm, evecfv, evecsv, ld, wfmt)
integer, dimension(2) jspnfv