Commit aacbd539 authored by Henning Janssen's avatar Henning Janssen

Small fixes

parent 2ec00b4a
......@@ -7,10 +7,10 @@ MODULE m_denmat_dist
USE m_constants
INTEGER, INTENT(IN) :: natoms
COMPLEX, INTENT(IN) :: n_mmp_in(-lmaxU_const:lmaxU_const,-lmaxU_const:lmaxU_const,natoms,jspins)
COMPLEX, INTENT(IN) :: n_mmp_out(-lmaxU_const:lmaxU_const,-lmaxU_const:lmaxU_const,natoms,jspins)
TYPE(t_results), INTENT(INOUT) :: results
TYPE(t_input), INTENT(IN) :: input
COMPLEX, INTENT(IN) :: n_mmp_in(-lmaxU_const:lmaxU_const,-lmaxU_const:lmaxU_const,natoms,input%jspins)
COMPLEX, INTENT(IN) :: n_mmp_out(-lmaxU_const:lmaxU_const,-lmaxU_const:lmaxU_const,natoms,input%jspins)
TYPE(t_results), INTENT(INOUT) :: results
INTEGER ispin,i_at,j,k
REAL n_in,n_out
......
......@@ -358,9 +358,9 @@ MODULE m_hubbard1_setup
#ifdef CPP_MPI
!Broadcast both the potential and the density matrix here
CALL MPI_BCAST(pot%mmpMat(-lmaxU_const:lmaxU_const,-lmaxU_const:lmaxU_const,indStart:indEnd,:),&
49*atoms%n_hia*input%jspins,MPI_DOUBLE_COMPLEX,0,mpi%mpi_comm,ierr)
49*atoms%n_hia*MERGE(3,input%jspins,input%l_gfmperp),MPI_DOUBLE_COMPLEX,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(den%mmpMat(-lmaxU_const:lmaxU_const,-lmaxU_const:lmaxU_const,indStart:indEnd,:),&
49*atoms%n_hia*input%jspins,MPI_DOUBLE_COMPLEX,0,mpi%mpi_comm,ierr)
49*atoms%n_hia*MERGE(3,input%jspins,input%l_gfmperp),MPI_DOUBLE_COMPLEX,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(results%e_ldau,1,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
#endif
......
......@@ -72,7 +72,7 @@ CONTAINS
! mix here straight with given mixing factors
ALLOCATE (n_mmp(-3:3,-3:3,MAX(1,atoms%n_u),input%jspins))
ALLOCATE (n_mmp(-3:3,-3:3,MAX(1,atoms%n_u),MERGE(3,input%jspins,noco%l_mperp)))
n_mmp = CMPLX(0.0,0.0)
alpha = input%ldauMixParam
......@@ -91,6 +91,7 @@ CONTAINS
WRITE (6,'(a16,f12.6)') 'n_mmp distance =',sum1
ELSE
sum2 = 0.0
sum3 = 0.0
gam = 0.5 * alpha * (1.0 + spinf)
del = 0.5 * alpha * (1.0 - spinf)
DO i_u = 1,atoms%n_u
......@@ -98,6 +99,7 @@ CONTAINS
DO k = -3,3
sum1 = sum1 + ABS(n_mmp_out(k,j,i_u,1) - n_mmp_in(k,j,i_u,1))
sum2 = sum2 + ABS(n_mmp_out(k,j,i_u,2) - n_mmp_in(k,j,i_u,2))
IF(noco%l_mperp) sum3 = sum2 + ABS(n_mmp_out(k,j,i_u,3) - n_mmp_in(k,j,i_u,3))
n_mmp(k,j,i_u,1) = gam * n_mmp_out(k,j,i_u,1) + &
(1.0-gam) * n_mmp_in (k,j,i_u,1) + &
......@@ -108,11 +110,16 @@ CONTAINS
(1.0-gam) * n_mmp_in (k,j,i_u,2) + &
del * n_mmp_out(k,j,i_u,1) - &
del * n_mmp_in (k,j,i_u,1)
IF(noco%l_mperp) THEN
n_mmp(k,j,i_u,3) = alpha * n_mmp_out(k,j,i_u,3) + &
(1.0-alpha) * n_mmp_in (k,j,i_u,3)
ENDIF
END DO
END DO
END DO
WRITE (6,'(a23,f12.6)') 'n_mmp distance spin 1 =',sum1
WRITE (6,'(a23,f12.6)') 'n_mmp distance spin 2 =',sum2
IF(noco%l_mperp) WRITE (6,'(a23,f12.6)') 'n_mmp distance spin 3 =',sum3
ENDIF
n_mmp_in = n_mmp
DEALLOCATE (n_mmp)
......@@ -153,7 +160,7 @@ CONTAINS
DO i_u = 1, atoms%n_u
DO j = -3,3
DO k = -3,3
sum2 = sum2 + ABS(n_mmp_out(k,j,i_u,3) - n_mmp_in(k,j,i_u,3))
sum3 = sum3 + ABS(n_mmp_out(k,j,i_u,3) - n_mmp_in(k,j,i_u,3))
END DO
END DO
END DO
......
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