Commit ac09716d authored by Gregor Michalicek's avatar Gregor Michalicek

Move u_mix call from main/cdngen.F90 to main/mix.F90

parent 1cd3a060
......@@ -12,7 +12,7 @@ CONTAINS
SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
dimension,kpts,atoms,sphhar,stars,sym,obsolete,&
enpara,cell,noco,jij,vTot,results,oneD,coreSpecInput,&
inIter,inDen,outDen)
inDen,outDen)
!*****************************************************
! Charge density generator
......@@ -21,7 +21,6 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
!*****************************************************
USE m_constants
USE m_umix
USE m_prpqfftmap
USE m_cdnval
USE m_cdn_io
......@@ -66,14 +65,13 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
!Scalar Arguments
INTEGER, INTENT (IN) :: eig_id
INTEGER, INTENT (IN) :: inIter
! Local type instances
TYPE(t_noco) :: noco_new
!Local Scalars
REAL fix,qtot,scor,stot,sval,dummy
INTEGER iter,ivac,j,jspin,jspmax,k,iType
INTEGER ivac,j,jspin,jspmax,k,iType
LOGICAL l_enpara
!Local Arrays
......@@ -87,7 +85,6 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
COMPLEX,ALLOCATABLE :: qa21(:), cdomvz(:,:)
!pk non-collinear (end)
iter = inIter
CALL outDen%init(stars,atoms,sphhar,vacuum,noco,oneD,input%jspins,noco%l_noco,POTDEN_TYPE_DEN)
IF (mpi%irank.EQ.0) THEN
......@@ -104,7 +101,7 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
qvac(:,:,:,:) = 0.0
qvlay(:,:,:,:,:) = 0.0
outDen%iter = iter
outDen%iter = inDen%iter
!Set up pointer for backtransformation of from g-vector in
!positive domain fof carge density fftibox into stars
......@@ -130,9 +127,6 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
CALL timestop("cdngen: cdnval")
END DO
! lda+u
IF ((atoms%n_u.GT.0).and.(mpi%irank.EQ.0)) CALL u_mix(input,atoms,inDen%mmpMat,outDen%mmpMat)
IF (mpi%irank.EQ.0) THEN
IF (l_enpara) CLOSE (40)
CALL cdntot(stars,atoms,sym, vacuum,input,cell,oneD, outDen%pw,outDen%mt,outDen%vacz,.TRUE., qtot,dummy)
......
......@@ -572,7 +572,7 @@ CONTAINS
CALL cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
DIMENSION,kpts,atoms,sphhar,stars,sym,obsolete,&
enpara_out,cell,noco,jij,vTot,results,oneD,coreSpecInput,&
inDen%iter,inDen,outDen)
inDen,outDen)
IF ( noco%l_soc .AND. (.NOT. noco%l_noco) ) dimension%neigd=dimension%neigd/2
!+t3e
......
......@@ -33,6 +33,7 @@ SUBROUTINE mix(stars,atoms,sphhar,vacuum,input,sym,cell,noco,oneD,&
USE m_qfix
USE m_types
USE m_xmlOutput
USE m_umix
IMPLICIT NONE
......@@ -46,7 +47,7 @@ SUBROUTINE mix(stars,atoms,sphhar,vacuum,input,sym,cell,noco,oneD,&
TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_atoms),INTENT(INOUT) :: atoms !n_u is modified temporarily
TYPE(t_potden),INTENT(IN) :: outDen
TYPE(t_potden),INTENT(INOUT) :: outDen
TYPE(t_results),INTENT(INOUT) :: results
TYPE(t_potden),INTENT(INOUT) :: inDen
INTEGER, INTENT(IN) :: archiveType
......@@ -102,10 +103,11 @@ SUBROUTINE mix(stars,atoms,sphhar,vacuum,input,sym,cell,noco,oneD,&
! LDA+U (start)
n_mmpTemp = inDen%mmpMat
n_u_keep=atoms%n_u
IF (atoms%n_u.GT.0) CALL u_mix(input,atoms,inDen%mmpMat,outDen%mmpMat)
IF (l_densityMatrixPresent) THEN
!In an LDA+U caclulation, also the density matrix is included in the
!supervectors (sm,fsm) if no linear mixing is performed on it.
IF(input%ldauLinMix) THEN
IF (input%ldauLinMix) THEN
atoms%n_u = 0
ELSE
mmap = mmap + 7 * 7 * 2 * atoms%n_u * input%jspins ! add 7*7 complex numbers per atoms%n_u and spin
......
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