9subroutine zftrf(npv,ivp,vpc,rfmt,rfir,zfp)
40integer,
intent(in) :: npv,ivp(3,npv)
41real(8),
intent(in) :: vpc(3,npv),rfmt(npmtmax,natmtot),rfir(ngtot)
42complex(8),
intent(out) :: zfp(npv)
44integer is,ia,ias,ip,ig,ifg
45integer nrc,nrci,irco,irc
50real(8) jl(0:lmaxo,nrcmtmax),rfmt1(npcmtmax)
53complex(8),
allocatable :: zfft(:),zfmt(:,:)
54allocate(zfft(ngtot),zfmt(npcmtmax,natmtot))
61zfft(1:ngtot)=rfir(1:ngtot)
65 if ((ivp(1,ip) >=
intgv(1,1)).and.(ivp(1,ip) <=
intgv(2,1)).and. &
66 (ivp(2,ip) >=
intgv(1,2)).and.(ivp(2,ip) <=
intgv(2,2)).and. &
67 (ivp(3,ip) >=
intgv(1,3)).and.(ivp(3,ip) <=
intgv(2,3)))
then
68 ig=
ivgig(ivp(1,ip),ivp(2,ip),ivp(3,ip))
69 zfp(ip)=zfft(
igfft(ig))
81 call rfmtftoc(nrc,nrci,rfmt(:,ias),rfmt1)
82 call rtozfmt(nrc,nrci,rfmt1,zfmt(:,ias))
89 ylm(1:lmmaxo)=conjg(ylm(1:lmmaxo))
101 call sbessel(lmaxo,t1,jl(:,irc))
109 z1=zfft(ifg)*cmplx(cos(t1),sin(t1),8)
116 zfmt(i:i+n,ias)=zfmt(i:i+n,ias)-z2*ylm(lm:lm+n)
125 zfmt(i:i+n,ias)=zfmt(i:i+n,ias)-z2*ylm(lm:lm+n)
136 p=sqrt(vpc(1,ip)**2+vpc(2,ip)**2+vpc(3,ip)**2)
138 call genylmv(.true.,lmaxo,vpc(:,ip),ylm)
150 call sbessel(lmaxo,t1,jl(:,irc))
157 z1=jl(0,irc)*zfmt(i,ias)*ylm(1)
162 z1=z1+jl(l,irc)*sum(zfmt(i:i+n,ias)*ylm(lm:lm+n))
168 z1=jl(0,irc)*zfmt(i,ias)*ylm(1)
173 z1=z1+jl(l,irc)*sum(zfmt(i:i+n,ias)*ylm(lm:lm+n))
179 t1=vpc(1,ip)*
atposc(1,ia,is) &
180 +vpc(2,ip)*
atposc(2,ia,is) &
181 +vpc(3,ip)*
atposc(3,ia,is)
182 z1=t0*cmplx(cos(t1),-sin(t1),8)
183 zfp(ip)=zfp(ip)+z1*zsm
integer, dimension(2, 3) intgv
integer, dimension(3) ngridg
real(8), dimension(3, maxatoms, maxspecies) atposc
integer, dimension(maxspecies) natoms
real(8), dimension(:,:), allocatable rcmt
integer, dimension(maxatoms, maxspecies) idxas
integer, dimension(maxspecies) nrcmt
integer, dimension(maxatoms *maxspecies) idxis
real(8), dimension(:,:), allocatable wr2cmt
integer, dimension(:), allocatable igfft
real(8), dimension(:,:), allocatable vgc
integer, dimension(maxspecies) nrcmti
real(8), dimension(:), allocatable gc
integer, dimension(:,:,:), allocatable ivgig