6subroutine genvmatk(vmt,vir,ngp,igpig,wfmt,ld,wfgp,vmat)
14real(8),
intent(in) :: vmt(npcmtmax,natmtot),vir(ngtc)
15integer,
intent(in) :: ngp(nspnfv),igpig(ngkmax,nspnfv)
16complex(4),
intent(in) :: wfmt(npcmtmax,natmtot,nspinor,nstsv)
17integer,
intent(in) :: ld
18complex(4),
intent(in) :: wfgp(ld,nspinor,nstsv)
19complex(8),
intent(out) :: vmat(nstsv,nstsv)
21integer ist,jst,nj,ispn,jspn
22integer is,ias,nrc,nrci,nrco
24integer ld1,ld2,n,igp,nthd
26complex(4) wfmt1(npcmtmax),wfmt2(npcmtmax)
27complex(4) wfir(ngtc),c(ngkmax),y(nstsv)
29real(4),
external :: sdot
30ld1=npcmtmax*natmtot*nspinor
58 wfmt1(1:npc)=vmt(1:npc,ias)*wfmt(1:npc,ias,ispn,jst)
63 call cgemm(
'N',
'N',
lmmaxi,nrci,
lmmaxi,
cone,
vmatmti(1,1,1,1,ias), &
65 call cgemm(
'N',
'N',
lmmaxo,nrco,
lmmaxo,
cone,
vmatmto(1,1,1,1,ias), &
68 wfmt1(1:npc)=wfmt1(1:npc)+wfmt2(1:npc)
72 call cgemv(
'C',npc,nj,
cone,wfmt(1,ias,ispn,1),ld1,wfmt1,1,
czero,y,1)
73 vmat(1:nj,jst)=vmat(1:nj,jst)+y(1:nj)
74 vmat(jst,jst)=vmat(jst,jst)+sdot(npc2,wfmt(1,ias,ispn,jst),1,wfmt1,1)
91 wfir(
igfc(igpig(igp,jspn)))=wfgp(igp,ispn,jst)
95 wfir(1:ngtc)=vir(1:ngtc)*wfir(1:ngtc)
99 c(igp)=wfir(
igfc(igpig(igp,jspn)))
102 call cgemv(
'C',n,nj,
cone,wfgp(1,ispn,1),ld2,c,1,
czero,y,1)
103 vmat(1:nj,jst)=vmat(1:nj,jst)+y(1:nj)
104 vmat(jst,jst)=vmat(jst,jst)+sdot(n*2,wfgp(1,ispn,jst),1,c,1)
113 vmat(ist,jst)=conjg(vmat(jst,ist))
subroutine genvmatk(vmt, vir, ngp, igpig, wfmt, ld, wfgp, vmat)
complex(4), parameter czero
integer, dimension(3) ngdgc
integer, dimension(maxspecies) npcmti
integer, dimension(maxspecies) nrcmt
integer, dimension(:), allocatable igfc
integer, dimension(maxatoms *maxspecies) idxis
real(8), dimension(:,:), allocatable wr2cmt
integer, dimension(maxspecies) npcmt
complex(4), parameter cone
integer, dimension(2) jspnfv
integer, dimension(maxspecies) nrcmti