27integer,
intent(in) :: ik
28real(8),
intent(inout) :: forceibs(3,natmtot)
30integer ispn0,ispn1,ispn,jspn
31integer n,nm,is,ias,ist,jst
32integer j1,j2,j3,ig,i,j,l,nthd
36real(8) evalfv(nstfv,nspnfv)
37complex(8) vh(nmatmax),vo(nmatmax)
38complex(8) ffv(nstfv,nstfv),y(nstfv)
40integer,
allocatable :: ijg(:,:)
41real(8),
allocatable :: dp(:,:)
42complex(8),
allocatable :: apwalm(:,:,:,:),evecfv(:,:,:),evecsv(:,:)
43complex(8),
allocatable :: h(:,:),o(:,:),dlh(:,:),dlo(:,:)
45complex(8),
external :: zdotc
47allocate(ijg(nmatmax,nmatmax),dp(nmatmax,nmatmax))
49allocate(evecfv(nmatmax,nstfv,nspnfv))
50allocate(h(nmatmax,nmatmax),o(nmatmax,nmatmax))
51allocate(dlh(nmatmax,nmatmax),dlo(nmatmax,nmatmax))
62 ispn0=jspn; ispn1=jspn
71 v1=0.5d0*
vgkc(1,j,jspn,ik)
72 v2=0.5d0*
vgkc(2,j,jspn,ik)
73 v3=0.5d0*
vgkc(3,j,jspn,ik)
77 dp(i,j)=
vgkc(1,i,jspn,ik)*v1+
vgkc(2,i,jspn,ik)*v2+
vgkc(3,i,jspn,ik)*v3
81 call match(n,
vgkc(:,:,jspn,ik),
gkc(:,jspn,ik),
sfacgk(:,:,jspn,ik),apwalm)
94 call hmlaa(.false.,is,ias,n,apwalm(:,:,:,ias),nmatmax,h)
95 call hmlalo(is,ias,n,apwalm(:,:,:,ias),nmatmax,h)
99 call olpaa(.false.,is,n,apwalm(:,:,:,ias),nmatmax,o)
100 call olpalo(is,ias,n,apwalm(:,:,:,ias),nmatmax,o)
109 z2=t1*(dp(i,j)*z1+h(i,j))
132 call zhemv(
'U',nm,
zone,dlh,nmatmax,evecfv(:,jst,jspn),1,
zzero,vh,1)
133 call zhemv(
'U',nm,
zone,dlo,nmatmax,evecfv(:,jst,jspn),1,
zzero,vo,1)
136 z1=zdotc(nm,evecfv(:,ist,jspn),1,vh,1)
137 z2=zdotc(nm,evecfv(:,ist,jspn),1,vo,1)
138 ffv(ist,jst)=z1-t1*z2
150 call zgemv(
'N',nstfv,nstfv,
zone,ffv,nstfv,evecsv(i,j),1,
zzero,y,1)
151 z1=zdotc(nstfv,evecsv(i,j),1,y,1)
152 sm=sm+
occsv(j,ik)*z1%re
158 sm=sm+
occsv(j,ik)*dble(ffv(j,j))
161 forceibs(l,ias)=forceibs(l,ias)+
wkpt(ik)*sm
168deallocate(ijg,dp,apwalm,evecfv)
169deallocate(h,o,dlh,dlo)
real(8), dimension(:,:,:,:), allocatable vgkc
real(8), dimension(:), allocatable wkpt
complex(8), parameter zzero
real(8), dimension(:,:,:), allocatable gkc
integer, dimension(:,:), allocatable ngk
integer, dimension(:,:,:), allocatable igkig
real(8), dimension(:,:), allocatable ffacg
complex(8), parameter zone
integer, dimension(maxatoms *maxspecies) idxis
complex(8), dimension(:,:), allocatable sfacg
real(8), dimension(:,:,:,:), allocatable vgkl
integer, dimension(:,:), allocatable ivg
real(8), dimension(:,:), allocatable vkl
integer, dimension(:,:), allocatable nmat
real(8), dimension(:,:), allocatable vgc
complex(8), dimension(:,:,:,:), allocatable sfacgk
real(8), dimension(:,:), allocatable occsv
integer, dimension(:,:,:), allocatable ivgig