alsoooooo
2020-11-21 12:18:40 +08:00
上面对应的原 Fortran 代码
subroutine get_kgroup(Nk_irr,nsymq,SKI,rg,pg,nnp,gk,Gshift,kphase)
implicit none
integer,intent(in) :: Nk_irr, nsymq,rg(3,3,nsymq),pg(3,nsymq),nnp
real(8),intent(in) :: SKI(3,Nk_irr)
logical,intent(out) :: gk(Nk_irr,nsymq)
integer,intent(out) :: Gshift(3,Nk_irr,nsymq)
complex(8),intent(out) :: kphase(Nk_irr,nsymq)
integer :: ik,iop,jop,kop,tmp2(3)
logical :: flag
real(8) :: err=0.00001, tmp(3)
real(8),parameter :: pi = acos(-1d0)
complex(8),parameter :: ii = (0,1)
gk = .false.
flag = .false.
kphase=1d0
do ik=1,Nk_irr
do iop=1,nsymq
tmp(1)=sum(rg(1,:,iop)*SKI(:,ik))-SKI(1,ik)
tmp(2)=sum(rg(2,:,iop)*SKI(:,ik))-SKI(2,ik)
tmp(3)=sum(rg(3,:,iop)*SKI(:,ik))-SKI(3,ik)
Gshift(1,ik,iop)=nint(tmp(1))
Gshift(2,ik,iop)=nint(tmp(2))
Gshift(3,ik,iop)=nint(tmp(3))
gk(ik,iop)=(abs(tmp(1)-Gshift(1,ik,iop))<err).and.&
&(abs(tmp(2)-Gshift(2,ik,iop))<err).and.&
&(abs(tmp(3)-Gshift(3,ik,iop))<err)
end do
end do
do ik=1,Nk_irr
do iop=1,nsymq
kphase(ik,iop)=exp(-ii*sum(SKI(:,ik)*pg(:,iop))*2*pi/nnp)
end do
end do
end subroutine get_kgroup