6 subroutine genvbmatk(vmt,vir,bmt,bir,ngp,igpig,wfmt,ld,wfgp,vbmat)
14 real(8),
intent(in) :: vmt(npcmtmax,natmtot),vir(ngtc)
15 real(8),
intent(in) :: bmt(npcmtmax,natmtot,ndmag),bir(ngtc,ndmag)
16 integer,
intent(in) :: ngp(nspnfv),igpig(ngkmax,nspnfv)
17 complex(4),
intent(in) :: wfmt(npcmtmax,natmtot,nspinor,nstsv)
18 integer,
intent(in) :: ld
19 complex(4),
intent(in) :: wfgp(ld,nspinor,nstsv)
20 complex(8),
intent(out) :: vbmat(nstsv,nstsv)
22 integer ist,jst,nj,ispn,jspn
23 integer is,ias,nrc,nrci,nrco
25 integer ld1,ld2,n,igp,nthd
27 complex(4) wfmt1(npcmtmax,2),wfmt2(npcmtmax,2),y(nstsv)
28 complex(4) wfir1(ngtc,nspinor),wfir2(ngtc,nspinor),c(ngkmax)
30 real(4),
external :: sdot
31 ld1=npcmtmax*natmtot*nspinor
57 call vbmk1(npc,vmt(:,ias),bmt(:,ias,1),bmt(:,ias,2),bmt(:,ias,3), &
58 wfmt(:,ias,1,jst),wfmt(:,ias,2,jst),wfmt1,wfmt1(:,2))
61 call vbmk2(npc,vmt(:,ias),bmt(:,ias,1),wfmt(:,ias,1,jst), &
62 wfmt(:,ias,2,jst),wfmt1,wfmt1(:,2))
72 wfmt2(1:npc,1)=wfmt(1:npc,ias,1,jst)
73 wfmt2(1:npc,2)=wfmt(1:npc,ias,2,jst)
76 call cgemm(
'N',
'N',
lmmaxi,nrci,
lmmaxi,
cone,
vmatmti(1,1,1,1,ias), &
78 call cgemm(
'N',
'N',
lmmaxo,nrco,
lmmaxo,
cone,
vmatmto(1,1,1,1,ias), &
80 call cgemm(
'N',
'N',
lmmaxi,nrci,
lmmaxi,
cone,
vmatmti(1,1,2,2,ias), &
82 call cgemm(
'N',
'N',
lmmaxo,nrco,
lmmaxo,
cone,
vmatmto(1,1,2,2,ias), &
85 call cgemm(
'N',
'N',
lmmaxi,nrci,
lmmaxi,
cone,
vmatmti(1,1,1,2,ias), &
87 call cgemm(
'N',
'N',
lmmaxo,nrco,
lmmaxo,
cone,
vmatmto(1,1,1,2,ias), &
89 call cgemm(
'N',
'N',
lmmaxi,nrci,
lmmaxi,
cone,
vmatmti(1,1,2,1,ias), &
91 call cgemm(
'N',
'N',
lmmaxo,nrco,
lmmaxo,
cone,
vmatmto(1,1,2,1,ias), &
97 call cgemv(
'C',npc,nj,
cone,wfmt(1,ias,1,1),ld1,wfmt1(1,1),1,
czero,y,1)
98 call cgemv(
'C',npc,nj,
cone,wfmt(1,ias,2,1),ld1,wfmt1(1,2),1,
cone,y,1)
99 vbmat(1:nj,jst)=vbmat(1:nj,jst)+y(1:nj)
100 vbmat(jst,jst)=vbmat(jst,jst) &
101 +sdot(npc2,wfmt(1,ias,1,jst),1,wfmt1(1,1),1) &
102 +sdot(npc2,wfmt(1,ias,2,jst),1,wfmt1(1,2),1)
115 wfir1(1:ngtc,ispn)=0.e0
117 wfir1(
igfc(igpig(igp,jspn)),ispn)=wfgp(igp,ispn,jst)
124 call vbmk1(ngtc,vir,bir,bir(:,2),bir(:,3),wfir1,wfir1(:,2),wfir2,wfir2(:,2))
127 call vbmk2(ngtc,vir,bir,wfir1,wfir1(:,2),wfir2,wfir2(:,2))
135 c(igp)=wfir2(
igfc(igpig(igp,jspn)),ispn)
137 call cgemv(
'C',n,nj,
cone,wfgp(1,ispn,1),ld2,c,1,
czero,y,1)
138 vbmat(1:nj,jst)=vbmat(1:nj,jst)+y(1:nj)
139 vbmat(jst,jst)=vbmat(jst,jst)+sdot(2*n,wfgp(1,ispn,jst),1,c,1)
148 vbmat(ist,jst)=conjg(vbmat(jst,ist))
154 pure subroutine vbmk1(n,v,b1,b2,b3,wf11,wf12,wf21,wf22)
157 integer,
intent(in) :: n
158 real(8),
intent(in) :: v(n),b1(n),b2(n),b3(n)
159 complex(4),
intent(in) :: wf11(n),wf12(n)
160 complex(4),
intent(out) :: wf21(n),wf22(n)
165 wf21(i)=(v(i)+b3(i))*wf11(i)+cmplx(b1(i),-b2(i),8)*wf12(i)
166 wf22(i)=(v(i)-b3(i))*wf12(i)+cmplx(b1(i),b2(i),8)*wf11(i)
170 pure subroutine vbmk2(n,v,b,wf11,wf12,wf21,wf22)
173 integer,
intent(in) :: n
174 real(8),
intent(in) :: v(n),b(n)
175 complex(4),
intent(in) :: wf11(n),wf12(n)
176 complex(4),
intent(out) :: wf21(n),wf22(n)
181 wf21(i)=(v(i)+b(i))*wf11(i)
182 wf22(i)=(v(i)-b(i))*wf12(i)
integer, dimension(maxspecies) npcmt
complex(4), dimension(:,:,:,:,:), allocatable vmatmti
complex(4), parameter czero
complex(4), parameter cone
subroutine cfftifc(nd, n, sgn, c)
complex(4), dimension(:,:,:,:,:), allocatable vmatmto
pure subroutine vbmk2(n, v, b, wf11, wf12, wf21, wf22)
integer, dimension(:), allocatable igfc
logical, dimension(:,:), allocatable tvmmt
real(8), dimension(:,:), allocatable wr2cmt
pure subroutine vbmk1(n, v, b1, b2, b3, wf11, wf12, wf21, wf22)
integer, dimension(maxspecies) npcmti
integer, dimension(maxatoms *maxspecies) idxis
integer, dimension(3) ngdgc
subroutine holdthd(nloop, nthd)
integer, dimension(maxspecies) nrcmt
integer, dimension(maxspecies) nrcmti
subroutine genvbmatk(vmt, vir, bmt, bir, ngp, igpig, wfmt, ld, wfgp, vbmat)
integer, parameter lmaxdm
pure subroutine cfcmtwr(nr, nri, wr, cfmt)
integer, dimension(2) jspnfv