From aacbd539d46b5f7510293ea82e55d5aa699ae53f Mon Sep 17 00:00:00 2001 From: janssen Date: Sun, 22 Sep 2019 14:10:09 +0200 Subject: [PATCH] Small fixes --- ldahia/denmat_dist.f90 | 6 +++--- ldahia/hubbard1_setup.F90 | 4 ++-- mix/u_mix.f90 | 11 +++++++++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ldahia/denmat_dist.f90 b/ldahia/denmat_dist.f90 index 50f4ac2c..3c6f63ee 100644 --- a/ldahia/denmat_dist.f90 +++ b/ldahia/denmat_dist.f90 @@ -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 diff --git a/ldahia/hubbard1_setup.F90 b/ldahia/hubbard1_setup.F90 index c5209924..aae55a93 100644 --- a/ldahia/hubbard1_setup.F90 +++ b/ldahia/hubbard1_setup.F90 @@ -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 diff --git a/mix/u_mix.f90 b/mix/u_mix.f90 index e595ae8d..3314f133 100644 --- a/mix/u_mix.f90 +++ b/mix/u_mix.f90 @@ -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 -- GitLab