9 subroutine zftrf(npv,ivp,vpc,rfmt,rfir,zfp)
40 integer,
intent(in) :: npv,ivp(3,npv)
41 real(8),
intent(in) :: vpc(3,npv),rfmt(npmtmax,natmtot),rfir(ngtot)
42 complex(8),
intent(out) :: zfp(npv)
44 integer is,ia,ias,ip,ig,ifg
45 integer nrc,nrci,irco,irc
50 real(8) jl(0:lmaxo,nrcmtmax),rfmt1(npcmtmax)
51 complex(8) ylm(lmmaxo)
53 complex(8),
allocatable :: zfft(:),zfmt(:,:)
54 allocate(zfft(ngtot),zfmt(npcmtmax,natmtot))
61 zfft(1:ngtot)=rfir(1:ngtot)
65 if ((ivp(1,ip) <
intgv(1,1)).or.(ivp(1,ip) >
intgv(2,1)).or. &
66 (ivp(2,ip) <
intgv(1,2)).or.(ivp(2,ip) >
intgv(2,2)).or. &
67 (ivp(3,ip) <
intgv(1,3)).or.(ivp(3,ip) >
intgv(2,3))) cycle
68 ig=
ivgig(ivp(1,ip),ivp(2,ip),ivp(3,ip))
69 zfp(ip)=zfft(
igfft(ig))
80 call rfmtftoc(nrc,nrci,rfmt(:,ias),rfmt1)
81 call rtozfmt(nrc,nrci,rfmt1,zfmt(:,ias))
88 ylm(1:lmmaxo)=conjg(ylm(1:lmmaxo))
100 call sbessel(lmaxo,t1,jl(:,irc))
108 z1=zfft(ifg)*cmplx(cos(t1),sin(t1),8)
115 zfmt(i:i+n,ias)=zfmt(i:i+n,ias)-z2*ylm(lm:lm+n)
124 zfmt(i:i+n,ias)=zfmt(i:i+n,ias)-z2*ylm(lm:lm+n)
135 p=sqrt(vpc(1,ip)**2+vpc(2,ip)**2+vpc(3,ip)**2)
137 call genylmv(.true.,lmaxo,vpc(:,ip),ylm)
149 call sbessel(lmaxo,t1,jl(:,irc))
156 z1=jl(0,irc)*zfmt(i,ias)*ylm(1)
161 z1=z1+jl(l,irc)*sum(zfmt(i:i+n,ias)*ylm(lm:lm+n))
167 z1=jl(0,irc)*zfmt(i,ias)*ylm(1)
172 z1=z1+jl(l,irc)*sum(zfmt(i:i+n,ias)*ylm(lm:lm+n))
178 t1=vpc(1,ip)*
atposc(1,ia,is) &
179 +vpc(2,ip)*
atposc(2,ia,is) &
180 +vpc(3,ip)*
atposc(3,ia,is)
181 z1=t0*cmplx(cos(t1),-sin(t1),8)
182 zfp(ip)=zfp(ip)+z1*zsm
186 deallocate(zfft,zfmt)
real(8), dimension(:,:), allocatable rcmt
subroutine sbessel(lmax, x, jl)
integer, dimension(3) ngridg
integer, dimension(maxatoms, maxspecies) idxas
integer, dimension(:,:,:), allocatable ivgig
pure subroutine rtozfmt(nr, nri, rfmt, zfmt)
pure subroutine genylmv(t4pil, lmax, v, ylm)
real(8), dimension(:,:), allocatable vgc
subroutine zfftifc(nd, n, sgn, z)
integer, dimension(:), allocatable igfft
subroutine zftrf(npv, ivp, vpc, rfmt, rfir, zfp)
integer, dimension(maxspecies) natoms
integer, dimension(2, 3) intgv
real(8), dimension(:,:), allocatable wr2cmt
integer, dimension(maxatoms *maxspecies) idxis
real(8), dimension(:), allocatable gc
integer, dimension(maxspecies) nrcmt
integer, dimension(maxspecies) nrcmti
pure subroutine rfmtftoc(nrc, nrci, rfmt, rfcmt)
real(8), dimension(3, maxatoms, maxspecies) atposc