Commit 4d81f0b5 authored by Henning Janssen's avatar Henning Janssen

Fixes

-Removed unused files
-Readded later start of first Hubbard iteration (seems more stable)
-Fixed problem, where crystalfield is ignored on first Hubbard 1 iteration after restart
parent 47eda6dd
...@@ -17,8 +17,8 @@ MODULE m_gfcalc ...@@ -17,8 +17,8 @@ MODULE m_gfcalc
USE m_greensfImag USE m_greensfImag
USE m_greensfImag21 USE m_greensfImag21
USE m_greensfRes !USE m_greensfRes
USE m_greensfRes21 !USE m_greensfRes21
IMPLICIT NONE IMPLICIT NONE
......
...@@ -44,7 +44,7 @@ MODULE m_hubbard1_io ...@@ -44,7 +44,7 @@ MODULE m_hubbard1_io
CONTAINS CONTAINS
SUBROUTINE hubbard1_input(path,i_hia,l,f0,f2,f4,f6,hub1,mu,n,l_bath,l_new) SUBROUTINE hubbard1_input(path,i_hia,l,f0,f2,f4,f6,hub1,mu,n,l_bath,l_first,l_new)
IMPLICIT NONE IMPLICIT NONE
...@@ -56,11 +56,12 @@ MODULE m_hubbard1_io ...@@ -56,11 +56,12 @@ MODULE m_hubbard1_io
REAL, INTENT(IN) :: mu REAL, INTENT(IN) :: mu
INTEGER, INTENT(IN) :: n INTEGER, INTENT(IN) :: n
LOGICAL, INTENT(IN) :: l_bath LOGICAL, INTENT(IN) :: l_bath
LOGICAL, INTENT(IN) :: l_first
LOGICAL, INTENT(IN) :: l_new LOGICAL, INTENT(IN) :: l_new
!Old or new input format !Old or new input format
IF(l_new) THEN IF(l_new) THEN
CALL write_hubbard1_input_new(path,i_hia,l,f0,f2,f4,f6,hub1,mu,n,l_bath) CALL write_hubbard1_input_new(path,i_hia,l,f0,f2,f4,f6,hub1,mu,n,l_bath,l_first)
ELSE ELSE
CALL write_hubbard1_input_old(path,i_hia,l,f0,f2,f4,f6,hub1,mu,n) CALL write_hubbard1_input_old(path,i_hia,l,f0,f2,f4,f6,hub1,mu,n)
ENDIF ENDIF
...@@ -68,7 +69,7 @@ MODULE m_hubbard1_io ...@@ -68,7 +69,7 @@ MODULE m_hubbard1_io
END SUBROUTINE hubbard1_input END SUBROUTINE hubbard1_input
SUBROUTINE write_hubbard1_input_new(path,i_hia,l,f0,f2,f4,f6,hub1,mu,n,l_bath) SUBROUTINE write_hubbard1_input_new(path,i_hia,l,f0,f2,f4,f6,hub1,mu,n,l_bath,l_first)
USE m_generic_txtio USE m_generic_txtio
...@@ -82,6 +83,7 @@ MODULE m_hubbard1_io ...@@ -82,6 +83,7 @@ MODULE m_hubbard1_io
REAL, INTENT(IN) :: mu REAL, INTENT(IN) :: mu
INTEGER, INTENT(IN) :: n INTEGER, INTENT(IN) :: n
LOGICAL, INTENT(IN) :: l_bath LOGICAL, INTENT(IN) :: l_bath
LOGICAL, INTENT(IN) :: l_first
INTEGER :: info, io_error,i,j,k,ind1,ind2,i_exc,i_arg INTEGER :: info, io_error,i,j,k,ind1,ind2,i_exc,i_arg
REAL exc REAL exc
...@@ -180,7 +182,7 @@ MODULE m_hubbard1_io ...@@ -180,7 +182,7 @@ MODULE m_hubbard1_io
!------------------------------------ !------------------------------------
! Crystal field contribution ! Crystal field contribution
!------------------------------------ !------------------------------------
IF(hub1%ccf(i_hia).NE.0.0.AND..NOT.(hub1%iter==1)) THEN IF(hub1%ccf(i_hia).NE.0.0.AND..NOT.l_first) THEN
CALL writeValue(input_iounit, "cf") CALL writeValue(input_iounit, "cf")
CALL cfmat%init(.true.,2*(2*l+1),2*(2*l+1)) CALL cfmat%init(.true.,2*(2*l+1),2*(2*l+1))
......
...@@ -100,7 +100,7 @@ MODULE m_hubbard1_setup ...@@ -100,7 +100,7 @@ MODULE m_hubbard1_setup
CALL umtx(atoms%lda_u(indStart:indEnd),atoms%n_hia,f0(:,1),f2(:,1),f4(:,1),f6(:,1),u) CALL umtx(atoms%lda_u(indStart:indEnd),atoms%n_hia,f0(:,1),f2(:,1),f4(:,1),f6(:,1),u)
! check for possible rotation of n_mmp ! check for possible rotation of n_mmp
n_mmp = den%mmpMat(:,:,indStart:indEnd,:) n_mmp = den%mmpMat(:,:,indStart:indEnd,1:input%jspins)
zero = 0.0 zero = 0.0
CALL nmat_rot(atoms%lda_u(indStart:indEnd)%phi,atoms%lda_u(indStart:indEnd)%theta,zero,3,atoms%n_hia,input%jspins,atoms%lda_u(indStart:indEnd)%l,n_mmp) CALL nmat_rot(atoms%lda_u(indStart:indEnd)%phi,atoms%lda_u(indStart:indEnd)%theta,zero,3,atoms%n_hia,input%jspins,atoms%lda_u(indStart:indEnd)%l,n_mmp)
...@@ -189,7 +189,8 @@ MODULE m_hubbard1_setup ...@@ -189,7 +189,8 @@ MODULE m_hubbard1_setup
!------------------------------------------------------- !-------------------------------------------------------
! Write the main config files ! Write the main config files
!------------------------------------------------------- !-------------------------------------------------------
CALL hubbard1_input(xPath,i_hia,l,f0(i_hia,1),f2(i_hia,1),f4(i_hia,1),f6(i_hia,1),hub1,mu_dc,n_occ,l_bathexist,.true.) CALL hubbard1_input(xPath,i_hia,l,f0(i_hia,1),f2(i_hia,1),f4(i_hia,1),f6(i_hia,1),hub1,mu_dc,n_occ,&
l_bathexist,hub1%iter==1.AND.ALL(pot%mmpmat(:,:,indStart:indEnd,:).EQ.0.0),.true.)
ELSE ELSE
!If no Solver is linked we assume that the old solver is used and we write out some additional files !If no Solver is linked we assume that the old solver is used and we write out some additional files
!Crystal field matrix (old version) !Crystal field matrix (old version)
...@@ -207,7 +208,7 @@ MODULE m_hubbard1_setup ...@@ -207,7 +208,7 @@ MODULE m_hubbard1_setup
!------------------------------------------------------- !-------------------------------------------------------
! Write the main config files (old version) ! Write the main config files (old version)
!------------------------------------------------------- !-------------------------------------------------------
CALL hubbard1_input(xPath,i_hia,l,f0(i_hia,1),f2(i_hia,1),f4(i_hia,1),f6(i_hia,1),hub1,mu_dc,n_occ,.false.,.false.) CALL hubbard1_input(xPath,i_hia,l,f0(i_hia,1),f2(i_hia,1),f4(i_hia,1),f6(i_hia,1),hub1,mu_dc,n_occ,.false.,.false.,.false.)
ENDIF ENDIF
ENDIF ENDIF
ENDDO ENDDO
...@@ -288,7 +289,7 @@ MODULE m_hubbard1_setup ...@@ -288,7 +289,7 @@ MODULE m_hubbard1_setup
!---------------------------------------------------------------------- !----------------------------------------------------------------------
! Calculate the distance and update the density matrix ! Calculate the distance and update the density matrix
!---------------------------------------------------------------------- !----------------------------------------------------------------------
CALL n_mmp_dist(den%mmpMat(:,:,indStart:indEnd,:),mmpMat,atoms%n_hia,results,input%jspins) 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)) !For now LDA+U in FLEUR ignores spin offdiagonal elements den%mmpMat(:,:,indStart:indEnd,:) = mmpMat(:,:,:,1:MERGE(3,input%jspins,noco%l_mperp)) !For now LDA+U in FLEUR ignores spin offdiagonal elements
!---------------------------------------------------------------------- !----------------------------------------------------------------------
! Calculate DFT+U potential correction ! Calculate DFT+U potential correction
......
...@@ -484,7 +484,7 @@ CONTAINS ...@@ -484,7 +484,7 @@ CONTAINS
.AND.(input%minoccDistance<=results%last_occdistance& .AND.(input%minoccDistance<=results%last_occdistance&
.OR.input%minmatDistance<=results%last_mmpMatdistance) .OR.input%minmatDistance<=results%last_mmpMatdistance)
!Run after first overall iteration to generate a starting density matrix !Run after first overall iteration to generate a starting density matrix
hub1%l_runthisiter = hub1%l_runthisiter.OR.(iter==1.AND.(hub1%iter == 0& hub1%l_runthisiter = hub1%l_runthisiter.OR.(iter==5.AND.(hub1%iter == 0&
.AND.ALL(vTot%mmpMat(:,:,atoms%n_u+1:atoms%n_u+atoms%n_hia,:).EQ.0.0))) .AND.ALL(vTot%mmpMat(:,:,atoms%n_u+1:atoms%n_u+atoms%n_hia,:).EQ.0.0)))
!Prevent that the scf loop terminates !Prevent that the scf loop terminates
l_cont = l_cont.OR.hub1%l_runthisiter l_cont = l_cont.OR.hub1%l_runthisiter
......
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