9 subroutine genpmatk(ngp,igpig,vgpc,wfmt,wfgp,pmat)
39 integer,
intent(in) :: ngp(nspnfv),igpig(ngkmax,nspnfv)
40 real(8),
intent(in) :: vgpc(3,ngkmax,nspnfv)
41 complex(8),
intent(in) :: wfmt(npcmtmax,natmtot,nspinor,nstsv)
42 complex(8),
intent(in) :: wfgp(ngkmax,nspinor,nstsv)
43 complex(8),
intent(out) :: pmat(nstsv,nstsv,3)
45 integer ist,jst,ispn,jspn
46 integer is,ia,ias,nrc,nrci,npc
47 integer ld1,ld2,igp,ifg,i
49 complex(8) z1,z2,z11,z12,z21,z22,z31,z32
51 real(8) rfmt(npcmtmax)
52 complex(8) gwfmt(npcmtmax,3,nspinor),gvmt(npcmtmax,3)
53 complex(8) zfmt1(npcmtmax,nspinor),zfmt2(npcmtmax,3,nspinor)
54 complex(8) gwfir(ngtc,3),z(ngkmax)
56 cso=1.d0/(4.d0*
solsc**2)
58 ld1=npcmtmax*natmtot*nspinor
61 pmat(1:nstsv,1:nstsv,1:3)=0.d0
74 call rtozfmt(nrc,nrci,rfmt,zfmt1)
75 call gradzfmt(nrc,nrci,
rlcmt(:,-1,is),
wcrcmt(:,:,is),zfmt1,npcmtmax,gvmt)
78 call zbshtip(nrc,nrci,gvmt(:,i))
85 wfmt(:,ias,ispn,jst),npcmtmax,gwfmt(:,:,ispn))
91 call zbsht(nrc,nrci,wfmt(:,ias,ispn,jst),zfmt1(:,ispn))
95 z1=cmplx(-zfmt1(i,1)%im,zfmt1(i,1)%re,8)
96 z2=cmplx(-zfmt1(i,2)%im,zfmt1(i,2)%re,8)
97 z11=gvmt(i,1)*z1; z12=gvmt(i,1)*z2
98 z21=gvmt(i,2)*z1; z22=gvmt(i,2)*z2
99 z31=gvmt(i,3)*z1; z32=gvmt(i,3)*z2
100 zfmt2(i,1,1)=cmplx(z32%im,-z32%re,8)-z21
101 zfmt2(i,1,2)=cmplx(-z31%im,z31%re,8)+z22
103 zfmt2(i,2,2)=-z12-z31
104 zfmt2(i,3,1)=cmplx(-z12%im,z12%re,8)+z22
105 zfmt2(i,3,2)=cmplx(z11%im,-z11%re,8)+z21
110 call zfsht(nrc,nrci,zfmt2(:,i,ispn),zfmt1)
111 gwfmt(1:npc,i,ispn)=gwfmt(1:npc,i,ispn)+cso*zfmt1(1:npc,1)
120 call zgemv(
'C',npc,jst,
zone,wfmt(1,ias,ispn,1),ld1,gwfmt(1,i,ispn),1,&
121 zone,pmat(1,jst,i),1)
134 gwfir(1:ngtc,1:3)=0.d0
136 ifg=
igfc(igpig(igp,jspn))
137 z1=wfgp(igp,ispn,jst)
138 z1=cmplx(-z1%im,z1%re,8)
139 gwfir(ifg,1:3)=vgpc(1:3,igp,jspn)*z1
145 gwfir(1:ngtc,i)=gwfir(1:ngtc,i)*
cfrc(1:ngtc)
152 ifg=
igfc(igpig(igp,jspn))
155 call zgemv(
'C',ngp(jspn),jst,
zone,wfgp(1,ispn,1),ld2,z,1,
zone, &
165 z1=cmplx(z1%im,-z1%re,8)
167 pmat(jst,ist,i)=conjg(z1)
169 pmat(jst,jst,i)=aimag(pmat(jst,jst,i))
integer, dimension(maxspecies) npcmt
pure subroutine zfmtwr(nr, nri, wr, zfmt)
integer, dimension(maxatoms, maxspecies) idxas
subroutine gradzfmt(nr, nri, ri, wcr, zfmt, ld, gzfmt)
complex(8), parameter zone
subroutine zfsht(nr, nri, zfmt1, zfmt2)
pure subroutine rtozfmt(nr, nri, rfmt, zfmt)
subroutine genpmatk(ngp, igpig, vgpc, wfmt, wfgp, pmat)
subroutine zfftifc(nd, n, sgn, z)
subroutine zbshtip(nr, nri, zfmt)
integer, dimension(:), allocatable igfc
real(8), dimension(:,:,:), allocatable rlcmt
integer, dimension(maxspecies) natoms
real(8), dimension(:,:), allocatable wr2cmt
real(8), dimension(:,:,:), allocatable wcrcmt
subroutine zbsht(nr, nri, zfmt1, zfmt2)
integer, dimension(3) ngdgc
real(8), dimension(:), allocatable cfrc
integer, dimension(maxspecies) nrcmt
integer, dimension(maxspecies) nrcmti
pure subroutine rfmtftoc(nrc, nrci, rfmt, rfcmt)
real(8), dimension(:,:), pointer, contiguous vsmt
integer, dimension(2) jspnfv