Commit bbb75b88 authored by Uliana Alekseeva's avatar Uliana Alekseeva

part of the angso can be calculated in hsmt_spinor_soc

parent 0a11f2c4
......@@ -37,10 +37,10 @@ CONTAINS
! ..
! .. Local Arrays ..
REAL fleg1(0:atoms%lmaxd),fleg2(0:atoms%lmaxd),fl2p1(0:atoms%lmaxd)
COMPLEX:: chi(2,2,2,2),angso(lapw%nv(1),2,2)
COMPLEX:: chi(2,2,2,2)
REAL, ALLOCATABLE :: plegend(:,:),dplegend(:,:)
REAL, ALLOCATABLE :: xlegend(:), dot(:)
COMPLEX, ALLOCATABLE :: cph(:),fct(:)
COMPLEX, ALLOCATABLE :: cph(:),fct(:),angso(:,:,:)
CALL timestart("offdiagonal soc-setup")
......@@ -61,12 +61,13 @@ CONTAINS
ALLOCATE(dplegend(NVEC,0:2))
ALLOCATE(fct(NVEC))
ALLOCATE(dot(NVEC))
ALLOCATE(angso(lapw%nv(1),2,2))
!$OMP DO SCHEDULE(DYNAMIC,1)
DO ki = fmpi%n_rank+1, lapw%nv(1), fmpi%n_size
kii=(ki-1)/fmpi%n_size+1
!Set up spinors...
CALL hsmt_spinor_soc(n,ki,nococonv,lapw,chi,angso)
CALL hsmt_spinor_soc(n,ki,nococonv,lapw,chi,angso,1,size(angso,1))
DO kj_off = 1, ki, NVEC
NVEC_rem = NVEC
......@@ -236,7 +237,7 @@ CONTAINS
SIN(DOT_PRODUCT(lapw%gvec(:,kj,1)-ski,tnn)))
END DO
!Set up spinors...
CALL hsmt_spinor_soc(n,ki,nococonv,lapw,chi,angso)
CALL hsmt_spinor_soc(n,ki,nococonv,lapw,chi,angso,1,size(angso,1))
DO j1=1,2
DO j2=1,2
......
......@@ -50,7 +50,7 @@ CONTAINS
END SUBROUTINE hsmt_spinor
SUBROUTINE hsmt_spinor_soc(n,ki,nococonv,lapw,chi_so,angso)
SUBROUTINE hsmt_spinor_soc(n,ki,nococonv,lapw,chi_so,angso,kj_start,kj_end)
USE m_types
use m_constants
IMPLICIT NONE
......@@ -59,6 +59,7 @@ CONTAINS
INTEGER,INTENT(IN) :: n,ki
COMPLEX,INTENT(out) :: chi_so(:,:,:,:)
COMPLEX,INTENT(out),OPTIONAL :: angso(:,:,:)
INTEGER,INTENT(in), OPTIONAL :: kj_start,kj_end
REAL :: cross_k(3)
INTEGER :: j1,j2,kj
......@@ -94,19 +95,22 @@ CONTAINS
ENDDO
ENDDO
IF (.not.present(angso)) RETURN !only chis are needed
!In the first variation SOC case the off-diagonal spinors are needed
DO kj = 1,size(angso,1)
cross_k(1)=lapw%gk(2,ki,1)*lapw%gk(3,kj,1)- lapw%gk(3,ki,1)*lapw%gk(2,kj,1)
cross_k(2)=lapw%gk(3,ki,1)*lapw%gk(1,kj,1)- lapw%gk(1,ki,1)*lapw%gk(3,kj,1)
cross_k(3)=lapw%gk(1,ki,1)*lapw%gk(2,kj,1)- lapw%gk(2,ki,1)*lapw%gk(1,kj,1)
DO j1=1,2
DO j2=1,2
angso(kj,j1,j2)= isigma_x(j1,j2)*cross_k(1)+&
!In the first variation SOC case the off-diagonal spinors are needed
IF (present(angso)) THEN
IF ((.not.present(kj_start)).or.((.not.present(kj_end)))) RETURN
ENDIF
DO kj = kj_start,kj_end
cross_k(1)=lapw%gk(2,ki,1)*lapw%gk(3,kj,1)- lapw%gk(3,ki,1)*lapw%gk(2,kj,1)
cross_k(2)=lapw%gk(3,ki,1)*lapw%gk(1,kj,1)- lapw%gk(1,ki,1)*lapw%gk(3,kj,1)
cross_k(3)=lapw%gk(1,ki,1)*lapw%gk(2,kj,1)- lapw%gk(2,ki,1)*lapw%gk(1,kj,1)
DO j1=1,2
DO j2=1,2
angso(kj-kj_start+1,j1,j2)= isigma_x(j1,j2)*cross_k(1)+&
isigma_y(j1,j2)*cross_k(2)+ isigma_z(j1,j2)*cross_k(3)
ENDDO
ENDDO
ENDDO
END SUBROUTINE hsmt_spinor_soc
ENDDO
END SUBROUTINE hsmt_spinor_soc
END MODULE m_hsmt_spinor
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment