Commit 926ac62a authored by Daniel Wortmann's avatar Daniel Wortmann

Try to fix problem with LOs and spin-spirals

parent ed223412
This diff is collapsed.
......@@ -198,8 +198,8 @@ CONTAINS
REAL,ALLOCATABLE :: gkrot(:,:)
LOGICAL :: l_apw
ALLOCATE(c_ph(lapw%nv(1),MERGE(2,1,noco%l_ss)))
ALLOCATE(gkrot(3,lapw%nv(1)))
ALLOCATE(c_ph(maxval(lapw%nv),MERGE(2,1,noco%l_ss)))
ALLOCATE(gkrot(3,maxval(lapw%nv)))
lmax=MERGE(atoms%lnonsph(n),atoms%lmax(n),l_nonsph)
......
......@@ -34,7 +34,7 @@ CONTAINS
! ..
! .. Scalar Arguments ..
INTEGER, INTENT (IN) :: na,ntyp
INTEGER, INTENT (IN) :: iintsp,jintsp
INTEGER, INTENT (IN) :: jintsp,iintsp
COMPLEX, INTENT (IN) :: chi
INTEGER, INTENT(IN) :: isp
! ..
......@@ -54,7 +54,7 @@ CONTAINS
COMPLEX, ALLOCATABLE :: cph(:,:)
ALLOCATE(cph(MAXVAL(lapw%nv),2))
DO i=MIN(iintsp,jintsp),MAX(iintsp,jintsp)
DO i=MIN(jintsp,iintsp),MAX(jintsp,iintsp)
CALL lapw%phase_factors(i,atoms%taual(:,na),noco%qss,cph(:,i))
ENDDO
......@@ -81,26 +81,26 @@ CONTAINS
clo1(lo)* clo1(lo) )
DO nkvec = 1,invsfct* (2*l+1) !Each LO can have several functions
!+t3e
locol = lapw%nv(iintsp)+lapw%index_lo(lo,na)+nkvec !this is the column of the matrix
locol = lapw%nv(jintsp)+lapw%index_lo(lo,na)+nkvec !this is the column of the matrix
IF (MOD(locol-1,mpi%n_size).EQ.mpi%n_rank) THEN
locol=(locol-1)/mpi%n_size+1 !this is the column in local storage
!-t3e
k = lapw%kvec(nkvec,lo,na)
!---> calculate the overlap matrix elements with the regular
!---> flapw basis-functions
DO kp = 1,lapw%nv(jintsp)
DO kp = 1,lapw%nv(iintsp)
fact2 = con * fl2p1 * (&
fj(kp,l,jintsp)* ( alo1(lo) + &
fj(kp,l,iintsp)* ( alo1(lo) + &
clo1(lo)*ud%uulon(lo,ntyp,isp))+&
gj(kp,l,jintsp)* ( blo1(lo) * ud%ddn(l,ntyp,isp)+&
gj(kp,l,iintsp)* ( blo1(lo) * ud%ddn(l,ntyp,isp)+&
clo1(lo)*ud%dulon(lo,ntyp,isp)))
dotp = dot_PRODUCT(lapw%gk(:,k,iintsp),lapw%gk(:,kp,jintsp))
dotp = dot_PRODUCT(lapw%gk(:,k,jintsp),lapw%gk(:,kp,iintsp))
IF (smat%l_real) THEN
smat%data_r(kp,locol) = smat%data_r(kp,locol) + chi*invsfct*fact2 * legpol(l,dotp) *&
cph(k,iintsp)*CONJG(cph(kp,jintsp))
cph(k,jintsp)*CONJG(cph(kp,iintsp))
ELSE
smat%data_c(kp,locol) = smat%data_c(kp,locol) + chi*invsfct*fact2 * legpol(l,dotp) *&
cph(k,iintsp)*CONJG(cph(kp,jintsp))
cph(k,jintsp)*CONJG(cph(kp,iintsp))
ENDIF
END DO
!---> calculate the overlap matrix elements with other local
......@@ -118,14 +118,14 @@ CONTAINS
clo1(lo)*ud%uloulopn(lop,lo,ntyp,isp)))
DO nkvecp = 1,invsfct* (2*lp+1)
kp = lapw%kvec(nkvecp,lop,na)
lorow=lapw%nv(jintsp)+lapw%index_lo(lop,na)+nkvecp
dotp = dot_PRODUCT(lapw%gk(:,k,iintsp),lapw%gk(:,kp,jintsp))
lorow=lapw%nv(iintsp)+lapw%index_lo(lop,na)+nkvecp
dotp = dot_PRODUCT(lapw%gk(:,k,jintsp),lapw%gk(:,kp,iintsp))
IF (smat%l_real) THEN
smat%data_r(lorow,locol) =smat%data_r(lorow,locol)+chi*invsfct*fact3*legpol(l,dotp)* &
cph(k,iintsp)*conjg(cph(kp,jintsp))
cph(k,jintsp)*conjg(cph(kp,iintsp))
ELSE
smat%data_c(lorow,locol) =smat%data_c(lorow,locol)+chi*invsfct*fact3*legpol(l,dotp)*&
cph(k,iintsp)*CONJG(cph(kp,jintsp))
cph(k,jintsp)*CONJG(cph(kp,iintsp))
ENDIF
END DO
ELSE
......@@ -135,14 +135,14 @@ CONTAINS
!---> orbital with itself
DO nkvecp = 1,nkvec
kp = lapw%kvec(nkvecp,lo,na)
lorow=lapw%nv(jintsp)+lapw%index_lo(lo,na)+nkvecp
dotp = dot_PRODUCT(lapw%gk(:,k,iintsp),lapw%gk(:,kp,jintsp))
lorow=lapw%nv(iintsp)+lapw%index_lo(lo,na)+nkvecp
dotp = dot_PRODUCT(lapw%gk(:,k,jintsp),lapw%gk(:,kp,iintsp))
IF (smat%l_real) THEN
smat%data_r(lorow,locol) = smat%data_r(lorow,locol) + chi*invsfct*fact1*legpol(l,dotp) *&
cph(k,iintsp)*CONJG(cph(kp,jintsp))
cph(k,jintsp)*CONJG(cph(kp,iintsp))
ELSE
smat%data_c(lorow,locol) = smat%data_c(lorow,locol) + chi*invsfct*fact1*legpol(l,dotp)*&
cph(k,iintsp)*CONJG(cph(kp,jintsp))
cph(k,jintsp)*CONJG(cph(kp,iintsp))
ENDIF
END DO
ENDIF ! mod(locol-1,n_size) = nrank
......
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