6 subroutine genvchi0u(ik0,lock,pmat,evecu,vchi0)
12 integer,
intent(in) :: ik0
13 integer(omp_lock_kind),
intent(inout) :: lock(nwrf)
14 complex(8),
intent(in) :: pmat(nstsv,nstsv,3),evecu(nstulr,nstulr)
15 complex(4),
intent(inout) :: vchi0(nqpt+2,nqpt+2,nwrf)
17 integer nm,nm2,ist,jst,iw,nthd
18 integer ikpa,jkpa,iq,jq,i,j,k
19 integer i1,i2,i3,j1,j2,j3
21 complex(8) pmatu(3),a(3,3),z1,z2
23 complex(8) zrq(nqpt),y(nstsv)
24 complex(4) cw(nwrf),b(-1:nqpt,-1:nqpt)
26 complex(8),
external :: zdotc
42 if (abs(t1) < 1.d-8) cycle
46 cw(1:nwrf)=t1/(eij+
wrf(1:nwrf))
51 j1=
ivq(1,jkpa); j2=
ivq(2,jkpa); j3=
ivq(3,jkpa)
53 i1=j1-
ivq(1,ikpa); i2=j2-
ivq(2,ikpa); i3=j3-
ivq(3,ikpa)
57 z1=zdotc(nstsv,evecu(i,ist),1,evecu(j,jst),1)
59 if (ikpa == jkpa)
then 61 call zgemv(
'N',nstsv,nstsv,
zone,pmat(:,:,k),nstsv,evecu(i,jst),1, &
63 z2=zdotc(nstsv,evecu(i,ist),1,y,1)
64 pmatu(k)=pmatu(k)+z1*
vqc(k,ikpa)+z2
71 b(2:jq-1,jq)=conjg(b(jq,2:jq-1))
72 z1=
gclq(jq)*conjg(zrq(jq))
73 b(jq:nqpt,jq)=
gclq(jq:nqpt)*zrq(jq:nqpt)*z1
80 b(i,2:nqpt)=z1*conjg(zrq(2:nqpt))*
gclq(2:nqpt)
87 call omp_set_lock(lock(iw))
88 call caxpy(nm2,cw(iw),b,1,vchi0(1,1,iw),1)
89 call omp_unset_lock(lock(iw))
95 a(1:3,j)=z1*pmatu(1:3)
98 call omp_set_lock(lock(iw))
99 vchi0(1:3,1:3,iw)=vchi0(1:3,1:3,iw)+cw(iw)*a(1:3,1:3)
100 call omp_unset_lock(lock(iw))
integer, dimension(:,:), allocatable ivq
complex(8), dimension(:), allocatable wrf
complex(8), parameter zone
real(8), dimension(:,:), allocatable vqc
real(8), dimension(:,:), allocatable occulr
subroutine genvchi0u(ik0, lock, pmat, evecu, vchi0)
integer, dimension(:,:,:), allocatable ivqiq
complex(8), parameter zzero
real(8), dimension(:), allocatable gclq
subroutine holdthd(nloop, nthd)
real(8), parameter fourpi
real(8), dimension(:,:), allocatable evalu