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) > 1.d-12) &
127 wfgp(1:n)=wfgp(1:n)+z1*evecfv(1:n,ist,jspn)
129 wfir(1:ngtc,ispn)=0.d0
131 wfir(
igfc(igpig(igp,jspn)),ispn)=wfgp(igp)
140 wfir(
igfc(igpig(igp,1)),1)=evecfv(igp,k,1)
150 call rmk1(ngtc,wo,wfir,wfir(:,2),rhoir_,magir_,magir_(:,2),magir_(:,3))
153 call rmk2(ngtc,wo,wfir,wfir(:,2),rhoir_,magir_)
157 call rmk3(ngtc,wo,wfir,rhoir_)
170 pure subroutine rmk1(n,wo,wf1,wf2,rho,mag1,mag2,mag3)
173 integer,
intent(in) :: n
174 real(8),
intent(in) :: wo
175 complex(8),
intent(in) :: wf1(n),wf2(n)
176 real(8),
intent(inout) :: rho(n),mag1(n),mag2(n),mag3(n)
184 a1=dble(wf1(i)); b1=aimag(wf1(i))
185 a2=dble(wf2(i)); b2=aimag(wf2(i))
186 t1=a1**2+b1**2; t2=a2**2+b2**2
187 mag1(i)=mag1(i)+wo2*(a1*a2+b1*b2)
188 mag2(i)=mag2(i)+wo2*(a1*b2-b1*a2)
189 mag3(i)=mag3(i)+wo*(t1-t2)
190 rho(i)=rho(i)+wo*(t1+t2)
194 pure subroutine rmk2(n,wo,wf1,wf2,rho,mag)
197 integer,
intent(in) :: n
198 real(8),
intent(in) :: wo
199 complex(8),
intent(in) :: wf1(n),wf2(n)
200 real(8),
intent(inout) :: rho(n),mag(n)
206 t1=dble(wf1(i))**2+aimag(wf1(i))**2
207 t2=dble(wf2(i))**2+aimag(wf2(i))**2
208 mag(i)=mag(i)+wo*(t1-t2)
209 rho(i)=rho(i)+wo*(t1+t2)
213 pure subroutine rmk3(n,wo,wf,rho)
216 integer,
intent(in) :: n
217 real(8),
intent(in) :: wo
218 complex(8),
intent(in) :: wf(n)
219 real(8),
intent(inout) :: rho(n)
220 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