Commit 8f0376cc authored by Henning Janssen's avatar Henning Janssen

Make sure that factors are not zero

parent 2061ad19
......@@ -116,9 +116,9 @@ CONTAINS
DO ispin = 1, input%jspins
tr = 0.0
DO i = -l,l
tr = tr + REAL(mmpmat(i,i,ispin))/(3-input%jspins)
IF(REAL(mmpmat(i,i,ispin))/(3-input%jspins).GT.1.05&
.OR.REAL(mmpmat(i,i,ispin))/(3-input%jspins).LT.-0.01) THEN
tr = tr + REAL(mmpmat(i,i,ispin))/(3.0-input%jspins)
IF(REAL(mmpmat(i,i,ispin))/(3.0-input%jspins).GT.1.05&
.OR.REAL(mmpmat(i,i,ispin))/(3.0-input%jspins).LT.-0.01) THEN
err = .TRUE.
WRITE(message,9110) ispin,i,REAL(mmpmat(i,i,ispin))
CALL juDFT_warn(TRIM(ADJUSTL(message)),calledby="occmtx")
......
......@@ -360,7 +360,7 @@ MODULE m_hubbard1_setup
INTEGER, INTENT(IN) :: l
INTEGER, INTENT(IN) :: jspins
LOGICAL, INTENT(IN) :: l_vmperp
COMPLEX, INTENT(IN) :: vmmp(-lmaxU_const:,-lmaxU_const:,:)
COMPLEX, INTENT(IN) :: vmmp(-lmaxU_const:,-lmaxU_const:,:)
INTEGER ns,i,j,m,mp,ispin
......@@ -372,8 +372,8 @@ MODULE m_hubbard1_setup
mp = j-1-l
DO ispin = 1, MERGE(3,jspins,l_vmperp)
IF(ispin < 3) THEN
mat(i+(ispin-1)*ns,j+(ispin-1)*ns) = mat(i+(ispin-1)*ns,j+(ispin-1)*ns) - vmmp(m,mp,ispin)/(3-jspins)
IF(jspins.EQ.1) mat(i+ns,j+ns) = mat(i+ns,j+ns) - vmmp(-m,-mp,ispin)/(3-jspins)
mat(i+(ispin-1)*ns,j+(ispin-1)*ns) = mat(i+(ispin-1)*ns,j+(ispin-1)*ns) - vmmp(m,mp,ispin)/(3.0-jspins)
IF(jspins.EQ.1) mat(i+ns,j+ns) = mat(i+ns,j+ns) - vmmp(-m,-mp,ispin)/(3.0-jspins)
ELSE
!----------------------------------------------------------------------------
! The offdiagonal elements only have to be removed if they are actually added
......
......@@ -433,7 +433,7 @@ MODULE m_types_greensf
ELSE
gmat%data_c(ind1,ind2) = this%gmmpMat(iz,m,mp,spin_ind,ipm,i_gf)
ENDIF
IF(l_full) gmat%data_c(ind1,ind2) = gmat%data_c(ind1,ind2)/(3-input%jspins)
IF(l_full) gmat%data_c(ind1,ind2) = gmat%data_c(ind1,ind2)/(3.0-input%jspins)
ENDIF
ENDDO
ENDDO
......@@ -503,6 +503,7 @@ MODULE m_types_greensf
DO ispin = MERGE(spin,1,PRESENT(spin)), MERGE(spin,ispin_end,PRESENT(spin))
!Find the right quadrant in gmat according to the spin index
IF(ispin.EQ.2.AND.input%jspins.EQ.1) CYCLE
IF(.NOT.PRESENT(spin)) THEN
IF(ispin < 3) THEN
spin1 = ispin
......@@ -520,14 +521,13 @@ MODULE m_types_greensf
ind1_start = 0
ind2_start = 0
ENDIF
IF(ispin.EQ.2.AND.input%jspins.EQ.1) CYCLE
ind1 = ind1_start
DO m = -l,l
ind1 = ind1 + 1
ind2 = ind2_start
DO mp = -lp_loop,lp_loop
ind2 = ind2 + 1
this%gmmpMat(iz,m,mp,ispin,ipm,i_gf) = gmat%data_c(ind1,ind2)*MERGE(1,2/input%jspins,PRESENT(spin))
this%gmmpMat(iz,m,mp,ispin,ipm,i_gf) = gmat%data_c(ind1,ind2)*MERGE(1.0,2.0/input%jspins,PRESENT(spin))
ENDDO
ENDDO
ENDDO
......
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