Commit 943e29eb authored by Daniel Wortmann's avatar Daniel Wortmann

Bugfixes for Vacuum part in spin-spiral calculation. Still not 100% correct as...

Bugfixes for Vacuum part in spin-spiral calculation. Still not 100% correct as conribution of last k+g that are only present for one spin are missing. Might not be relevant at all since these are expected to be tiny.
parent f7530b1d
...@@ -121,14 +121,14 @@ CONTAINS ...@@ -121,14 +121,14 @@ CONTAINS
ENDIF ENDIF
!---> update hamiltonian and overlap matrices !---> update hamiltonian and overlap matrices
IF (jspin1==jspin2) THEN IF (jspin1==jspin2) THEN
DO i = mpi%n_rank+1,lapw%nv(jspin1),mpi%n_size DO i = mpi%n_rank+1,lapw%nv(jspin2),mpi%n_size
i0=(i-1)/mpi%n_size+1 !local column index i0=(i-1)/mpi%n_size+1 !local column index
ik = map2(i,jspin1) ik = map2(i,jspin2)
DO j = 1,i - 1 !TODO check noco case DO j = 1,i - 1 !TODO check noco case
!---> overlap: only (g-g') parallel=0 ' !---> overlap: only (g-g') parallel=0 '
IF (map2(j,jspin1).EQ.ik) THEN IF (map2(j,jspin1).EQ.ik) THEN
sij = CONJG(a(i,jspin1))*a(j,jspin1) + & sij = CONJG(a(i,jspin2))*a(j,jspin2) + &
CONJG(b(i,jspin1))*b(j,jspin1)*ddnv(ik,jspin1) CONJG(b(i,jspin2))*b(j,jspin2)*ddnv(ik,jspin2)
!+APW_LO !+APW_LO
IF (input%l_useapw) THEN IF (input%l_useapw) THEN
apw_lo = CONJG(a(i,jspin1)* uz(ik,jspin1) + b(i,jspin1)* udz(ik,jspin1) ) & apw_lo = CONJG(a(i,jspin1)* uz(ik,jspin1) + b(i,jspin1)* udz(ik,jspin1) ) &
...@@ -151,7 +151,7 @@ CONTAINS ...@@ -151,7 +151,7 @@ CONTAINS
END IF END IF
ENDDO ENDDO
!Diagonal term of Overlapp matrix, Hamiltonian later !Diagonal term of Overlapp matrix, Hamiltonian later
sij = CONJG(a(i,jspin1))*a(i,jspin1) + CONJG(b(i,jspin1))*b(i,jspin1)*ddnv(ik,jspin1) sij = CONJG(a(i,jspin2))*a(i,jspin2) + CONJG(b(i,jspin2))*b(i,jspin2)*ddnv(ik,jspin2)
IF (hmat(1,1)%l_real) THEN IF (hmat(1,1)%l_real) THEN
smat(s1,s2)%data_r(j,i0) = smat(s1,s2)%data_r(j,i0) + REAL(sij) smat(s1,s2)%data_r(j,i0) = smat(s1,s2)%data_r(j,i0) + REAL(sij)
ELSE ELSE
...@@ -167,11 +167,11 @@ CONTAINS ...@@ -167,11 +167,11 @@ CONTAINS
DO j = 1,MIN(i,lapw%nv(jspin1)) DO j = 1,MIN(i,lapw%nv(jspin1))
jk = map2(j,jspin1) jk = map2(j,jspin1)
IF (jspin2>jspin1) THEN IF (jspin2>jspin1) THEN
hij = CONJG(CONJG(a(j,jspin2))* (tuuv(jk,ik)*a(i,jspin1) +tudv(jk,ik)*b(i,jspin1))& hij = CONJG(CONJG(a(j,jspin1))* (tuuv(jk,ik)*a(i,jspin2) +tudv(jk,ik)*b(i,jspin2))&
+ CONJG(b(j,jspin2))* (tddv(jk,ik)*b(i,jspin1) +tduv(jk,ik)*a(i,jspin1))) + CONJG(b(j,jspin1))* (tddv(jk,ik)*b(i,jspin2) +tduv(jk,ik)*a(i,jspin2)))
ELSE ELSE
hij = CONJG(a(i,jspin1))* (tuuv(ik,jk)*a(j,jspin2) +tudv(ik,jk)*b(j,jspin2))& hij = CONJG(a(i,jspin2))* (tuuv(ik,jk)*a(j,jspin1) +tudv(ik,jk)*b(j,jspin1))&
+ CONJG(b(i,jspin1))* (tddv(ik,jk)*b(j,jspin2) +tduv(ik,jk)*a(j,jspin2)) + CONJG(b(i,jspin2))* (tddv(ik,jk)*b(j,jspin1) +tduv(ik,jk)*a(j,jspin1))
ENDIF ENDIF
IF (hmat(1,1)%l_real) THEN IF (hmat(1,1)%l_real) THEN
hmat(s1,s2)%data_r(j,i0) = hmat(s1,s2)%data_r(j,i0) + REAL(hij) hmat(s1,s2)%data_r(j,i0) = hmat(s1,s2)%data_r(j,i0) + REAL(hij)
......
...@@ -53,6 +53,8 @@ CONTAINS ...@@ -53,6 +53,8 @@ CONTAINS
REAL u(vacuum%nmzd,dimension%nv2d,input%jspins),ud(vacuum%nmzd,dimension%nv2d,input%jspins) REAL u(vacuum%nmzd,dimension%nv2d,input%jspins),ud(vacuum%nmzd,dimension%nv2d,input%jspins)
REAL v(3),x(vacuum%nmzd), qssbti(2,2) REAL v(3),x(vacuum%nmzd), qssbti(2,2)
! .. ! ..
tuuv=0.0;tudv=0.0;tddv=0.0;tduv=0.0
udz=0.0;duz=0.0;ddnv=0.0;udz=0.;uz=0.
tail = .true. tail = .true.
np1 = vacuum%nmzxy + 1 np1 = vacuum%nmzxy + 1
!---> wronksian for the schrodinger equation given by an identity !---> wronksian for the schrodinger equation given by an identity
......
...@@ -267,7 +267,7 @@ MODULE m_types_mat ...@@ -267,7 +267,7 @@ MODULE m_types_mat
INTEGER:: i1,i2 INTEGER:: i1,i2
i1=mat%matsize1-n1+1 !space available for first dimension i1=mat%matsize1-n1+1 !space available for first dimension
i2=mat%matsize2-n1+1 i2=mat%matsize2-n2+1
i1=MIN(i1,mat1%matsize1) i1=MIN(i1,mat1%matsize1)
i2=MIN(i2,mat1%matsize2) i2=MIN(i2,mat1%matsize2)
IF (mat%l_real) THEN IF (mat%l_real) THEN
......
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