Commit 2609a58a authored by Henning Janssen's avatar Henning Janssen

Small fixes to last commits

parent d59bb214
MODULE m_denmat_dist
CONTAINS
SUBROUTINE n_mmp_dist(n_mmp_in,n_mmp_out,natoms,results,input)
SUBROUTINE n_mmp_dist(n_mmp_in,n_mmp_out,input,results)
USE m_types
USE m_constants
INTEGER, INTENT(IN) :: natoms
IMPLICIT NONE
TYPE(t_input), INTENT(IN) :: input
COMPLEX, INTENT(IN) :: n_mmp_in(-lmaxU_const:,-lmaxU_const:,:,:)
COMPLEX, INTENT(IN) :: n_mmp_out(-lmaxU_const:,-lmaxU_const:,:,:)
COMPLEX, INTENT(IN) :: n_mmp_in(-lmaxU_const:,-lmaxU_const:,:)
COMPLEX, INTENT(IN) :: n_mmp_out(-lmaxU_const:,-lmaxU_const:,:)
TYPE(t_results), INTENT(INOUT) :: results
INTEGER ispin,i_at,j,k
INTEGER ispin,j,k
REAL n_in,n_out
!Calculates the distance for two density matrices (maximum distance between two elements)
......@@ -20,17 +21,15 @@ MODULE m_denmat_dist
n_in = 0.0
results%last_mmpMatdistance = 0.0
DO ispin = 1, MERGE(3,input%jspins,input%l_gfmperp)
DO i_at = 1, natoms
DO j = -3,3
DO k = -3,3
IF((ABS(n_mmp_out(k,j,i_at,ispin) - n_mmp_in(k,j,i_at,ispin))).GT.results%last_mmpMatdistance) THEN
results%last_mmpMatdistance = ABS(n_mmp_out(k,j,i_at,ispin) - n_mmp_in(k,j,i_at,ispin))
ENDIF
IF(j.EQ.k.AND.ispin<3) THEN
n_out = n_out + REAL(n_mmp_out(k,j,i_at,ispin))
n_in = n_in + REAL(n_mmp_in(k,j,i_at,ispin))
ENDIF
END DO
DO j = -3,3
DO k = -3,3
IF((ABS(n_mmp_out(k,j,ispin) - n_mmp_in(k,j,ispin))).GT.results%last_mmpMatdistance) THEN
results%last_mmpMatdistance = ABS(n_mmp_out(k,j,ispin) - n_mmp_in(k,j,ispin))
ENDIF
IF(j.EQ.k.AND.ispin<3) THEN
n_out = n_out + REAL(n_mmp_out(k,k,ispin))
n_in = n_in + REAL(n_mmp_in(k,k,ispin))
ENDIF
END DO
END DO
ENDDO
......
......@@ -281,8 +281,12 @@ MODULE m_hubbard1_setup
!----------------------------------------------------------------------
! Calculate the distance and update the density matrix
!----------------------------------------------------------------------
CALL n_mmp_dist(den%mmpMat(:,:,indStart:indEnd,:),mmpMat,atoms%n_hia,results,input)
den%mmpMat(:,:,indStart:indEnd,:) = mmpMat(:,:,:,1:MERGE(3,input%jspins,noco%l_mperp))
DO i_hia = 1, atoms%n_hia
CALL n_mmp_dist(den%mmpMat(:,:,atoms%n_u+i_hia,:),mmpMat(:,:,i_hia,:),input,results)
DO ispin = 1, MERGE(3,input%jspins,noco%l_mperp)
den%mmpMat(:,:,atoms%n_u+i_hia,ispin) = mmpMat(:,:,i_hia,ispin)
ENDDO
ENDDO
ENDIF
DEALLOCATE(selfen)
ELSE
......
......@@ -36,7 +36,7 @@ CONTAINS
REAL, INTENT(IN) :: f0(:),f2(:)
COMPLEX, INTENT(OUT) :: vs_mmp(-lmaxU_const:,-lmaxU_const:,:,:)
COMPLEX, INTENT(INOUT) :: ns_mmp(-lmaxU_const:,-lmaxU_const:,:,:)
COMPLEX, INTENT(IN) :: ns_mmp(-lmaxU_const:,-lmaxU_const:,:,:)
LOGICAL, INTENT(IN) :: spin_pol !Is the double-counting spin-polarised (reason: for spin-polarized calculations
!with DFT+Hubbard1 we use a non-spin polarized orbital in DFT)
......
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