9 subroutine genspchi0(ik,lock,vqpl,jlgqr,ylmgq,sfacgq,chi0)
62 integer,
intent(in) :: ik
63 integer(omp_lock_kind),
intent(inout) :: lock(nwrf)
64 real(8),
intent(in) :: vqpl(3),jlgqr(njcmax,nspecies,ngrf)
65 complex(8),
intent(in) :: ylmgq(lmmaxo,ngrf),sfacgq(ngrf,natmtot)
66 complex(8),
intent(inout) :: chi0(ngrf,4,ngrf,4,nwrf)
69 integer isym,jk,jkq,iw
70 integer nst,nstq,ist,jst,kst,lst
71 integer ig,jg,a,b,i,j,nthd
72 real(8) vkql(3),ei,ej,eij,t1
75 integer idx(nstsv),idxq(nstsv)
76 integer ngp(nspnfv),ngpq(nspnfv)
78 integer,
allocatable :: igpig(:,:),igpqig(:,:)
79 complex(4),
allocatable :: wfmt(:,:,:,:),wfir(:,:,:)
80 complex(4),
allocatable :: wfmtq(:,:,:,:),wfirq(:,:,:)
81 complex(4),
allocatable :: crhomt(:,:),crhoir(:)
82 complex(8),
allocatable :: zrhoig(:,:),zw(:),c(:,:,:,:)
85 write(*,
'("Error(genspchi0): spin-unpolarised calculation")')
90 vkql(1:3)=
vkl(1:3,ik)+vqpl(1:3)
108 allocate(igpig(
ngkmax,nspnfv))
110 call genwfsvp_sp(.false.,.false.,nst,idx,
ngdgc,
igfc,
vkl(:,ik),ngp,igpig,wfmt, &
113 allocate(igpqig(
ngkmax,nspnfv))
115 call genwfsvp_sp(.false.,.false.,nstq,idxq,
ngdgc,
igfc,vkql,ngpq,igpqig,wfmtq, &
125 allocate(zrhoig(ngrf,4),zw(nwrf),c(ngrf,4,ngrf,4))
133 if (abs(t1) < 1.d-8) cycle
138 zw(iw)=t1/(eij+
wrf(iw))
148 if (((a == 1).and.(kst >
nstfv)).or. &
149 ((a == 2).and.(kst <=
nstfv)).or. &
150 ((b == 1).and.(lst >
nstfv)).or. &
151 ((b == 2).and.(lst <=
nstfv)))
then 156 call gencrho(.true.,.false.,
ngtc,wfmt(:,:,a,ist),wfir(:,a,ist), &
157 wfmtq(:,:,b,jst),wfirq(:,b,jst),crhomt,crhoir)
158 call zftcf(ngrf,jlgqr,ylmgq,ngrf,sfacgq,crhomt,crhoir,zrhoig(:,i))
165 z1=conjg(zrhoig(jg,j))
169 c(ig,i,jg,j)=zrhoig(ig,i)*z1
176 call omp_set_lock(lock(iw))
182 call zaxpy(ngrf,z1,c(:,i,jg,j),1,chi0(:,i,jg,j,iw),1)
186 call omp_unset_lock(lock(iw))
193 deallocate(crhomt,crhoir,zrhoig,zw,c)
196 deallocate(wfmt,wfmtq,wfir,wfirq)
real(8), dimension(:,:), allocatable evalsv
subroutine genwfsvp_sp(tsh, tgp, nst, idx, ngridg_, igfft_, vpl, ngp, igpig, wfmt, ld, wfir)
subroutine gencrho(tsh, tspc, ngt, wfmt1, wfir1, wfmt2, wfir2, crhomt, crhoir)
complex(8), dimension(:), allocatable wrf
integer, dimension(:,:,:), allocatable ivkik
subroutine genspchi0(ik, lock, vqpl, jlgqr, ylmgq, sfacgq, chi0)
subroutine zftcf(ngp, jlgpr, ylmgp, ld, sfacgp, cfmt, cfir, zfgp)
integer, dimension(:), allocatable igfc
real(8), dimension(:,:), allocatable occsv
real(8), dimension(:,:), allocatable vkl
integer, dimension(3) ngdgc
subroutine holdthd(nloop, nthd)
subroutine findkpt(vpl, isym, ik)
integer, dimension(:,:), allocatable ivk