6subroutine genzvbmatk(zvmt,zvir,zbmt,zbir,ngp,igpig,wfmt,wfir,wfgp,vbmat)
13complex(8),
intent(in) :: zvmt(npcmtmax,natmtot),zvir(ngtc)
14complex(8),
intent(in) :: zbmt(npcmtmax,natmtot,ndmag),zbir(ngtc,ndmag)
15integer,
intent(in) :: ngp,igpig(ngp)
16complex(4),
intent(in) :: wfmt(npcmtmax,natmtot,nspinor,nstsv)
18complex(4),
intent(in) :: wfir(ngtc,nspinor,nstsv)
19complex(4),
intent(in) :: wfgp(ngp,nspinor,nstsv)
20complex(8),
intent(out) :: vbmat(nstsv,nstsv)
26complex(4) wfmt1(npcmtmax,nspinor),wfir1(ngtc,nspinor),y(nstsv),c(ngp)
27ld1=npcmtmax*natmtot*nspinor
30vbmat(1:nstsv,1:nstsv)=0.d0
48 call zvbmk1(npc,zvmt(:,ias),zbmt(:,ias,1),zbmt(:,ias,2),zbmt(:,ias,3), &
49 wfmt(:,ias,1,jst),wfmt(:,ias,2,jst),wfmt1,wfmt1(:,2))
52 call zvbmk2(npc,zvmt(:,ias),zbmt(:,ias,1),wfmt(:,ias,1,jst), &
53 wfmt(:,ias,2,jst),wfmt1,wfmt1(:,2))
56 call cgemv(
'C',npc,nstsv,
cone,wfmt(1,ias,1,1),ld1,wfmt1(1,1),1,
czero,y,1)
57 call cgemv(
'C',npc,nstsv,
cone,wfmt(1,ias,2,1),ld1,wfmt1(1,2),1,
cone,y,1)
58 vbmat(1:nstsv,jst)=vbmat(1:nstsv,jst)+y(1:nstsv)
70 call zvbmk1(ngtc,zvir,zbir,zbir(:,2),zbir(:,3),wfir(:,1,jst), &
71 wfir(:,2,jst),wfir1,wfir1(:,2))
74 call zvbmk2(ngtc,zvir,zbir,wfir(:,1,jst),wfir(:,2,jst),wfir1,wfir1(:,2))
80 c(igp)=wfir1(
igfc(igpig(igp)),ispn)
82 call cgemv(
'C',ngp,nstsv,
cone,wfgp(1,ispn,1),ld2,c,1,
czero,y,1)
83 vbmat(1:nstsv,jst)=vbmat(1:nstsv,jst)+y(1:nstsv)
93pure subroutine zvbmk1(n,zv,zb1,zb2,zb3,wf11,wf12,wf21,wf22)
96integer,
intent(in) :: n
97complex(8),
intent(in) :: zv(n),zb1(n),zb2(n),zb3(n)
98complex(4),
intent(in) :: wf11(n),wf12(n)
99complex(4),
intent(out) :: wf21(n),wf22(n)
105 wf21(i)=(zv(i)+zb3(i))*wf11(i)+(zb1(i)-z1)*wf12(i)
106 wf22(i)=(zv(i)-zb3(i))*wf12(i)+(zb1(i)+z1)*wf11(i)
110pure subroutine zvbmk2(n,zv,zb,wf11,wf12,wf21,wf22)
113integer,
intent(in) :: n
114complex(8),
intent(in) :: zv(n),zb(n)
115complex(4),
intent(in) :: wf11(n),wf12(n)
116complex(4),
intent(out) :: wf21(n),wf22(n)
120 wf21(i)=(zv(i)+zb(i))*wf11(i)
121 wf22(i)=(zv(i)-zb(i))*wf12(i)
complex(4), parameter czero
integer, dimension(3) ngdgc
integer, dimension(:), allocatable igfc
integer, dimension(maxatoms *maxspecies) idxis
integer, dimension(maxspecies) npcmt
complex(4), parameter cone