6subroutine wfirsv(tgp,nst,idx,ngridg_,igfft_,ngp,igpig,evecfv,evecsv,ld,wfir)
11logical,
intent(in) :: tgp
12integer,
intent(in) :: nst,idx(*),ngridg_(3),igfft_(*)
13integer,
intent(in) :: ngp(nspnfv),igpig(ngkmax,nspnfv)
14complex(8),
intent(in) :: evecfv(nmatmax,nstfv,nspnfv),evecsv(nstsv,nstsv)
15integer,
intent(in) :: ld
16complex(8),
intent(out) :: wfir(ld,nspinor,nst)
19integer n,igp,i,j,k,nthd
23complex(8) wfgp(ngkmax)
33 if (idx(1) == 0) then; k=j; else; k=idx(j);
end if
47 if (abs(z1%re)+abs(z1%im) < 1.d-10) cycle
50 wfir(1:n,ispn,j)=wfir(1:n,ispn,j)+z1*evecfv(1:n,ist,jspn)
54 wfgp(1:n)=wfgp(1:n)+z1*evecfv(1:n,ist,jspn)
59 wfir(1:ld,ispn,j)=0.d0
61 wfir(igfft_(igpig(igp,jspn)),ispn,j)=wfgp(igp)
63 call zfftifc(3,ngridg_,1,wfir(:,ispn,j))
70 wfir(1:n,1,j)=evecfv(1:n,k,1)
74 wfir(igfft_(igpig(igp,1)),1,j)=t0*evecfv(igp,k,1)
76 call zfftifc(3,ngridg_,1,wfir(:,1,j))
integer, dimension(2) jspnfv
subroutine wfirsv(tgp, nst, idx, ngridg_, igfft_, ngp, igpig, evecfv, evecsv, ld, wfir)