Commit 7e76c0cd authored by Gregor Michalicek's avatar Gregor Michalicek

Bugfix: Added missing reset of potential at beginning of SCF iteration

The bug was introduced in commit 62285e99.

Thanks to Patrick for pointing out that there was a bug.
parent 745d1a18
......@@ -922,6 +922,7 @@ MODULE m_types
PROCEDURE :: init_potden_types
PROCEDURE :: init_potden_simple
GENERIC :: init=>init_potden_types,init_potden_simple
PROCEDURE :: resetPotDen
END TYPE t_potden
CONTAINS
SUBROUTINE usdus_init(ud,atoms,jsp)
......@@ -1013,5 +1014,21 @@ CONTAINS
pd%mmpMat = CMPLX(0.0,0.0)
END SUBROUTINE init_potden_simple
SUBROUTINE resetPotDen(pd)
IMPLICIT NONE
CLASS(t_potden),INTENT(INOUT) :: pd
pd%pw=CMPLX(0.0,0.0)
pd%mt=0.0
pd%vacz=0.0
pd%vacxy=CMPLX(0.0,0.0)
pd%cdom = CMPLX(0.0,0.0)
pd%cdomvz = CMPLX(0.0,0.0)
pd%cdomvxy = CMPLX(0.0,0.0)
pd%mmpMat = CMPLX(0.0,0.0)
END SUBROUTINE resetPotDen
END MODULE m_types
......@@ -123,6 +123,10 @@ CONTAINS
! units: hartrees
!
CALL vTot%resetPotDen()
CALL vCoul%resetPotDen()
CALL vx%resetPotDen()
ALLOCATE ( alphm(stars%ng2,2),excpw(stars%ng3),excxy(vacuum%nmzxyd,oneD%odi%n2d-1,2),&
vbar(dimension%jspd),af1(3*stars%mx3),bf1(3*stars%mx3),xp(3,dimension%nspd),&
vpw_exx(stars%ng3,dimension%jspd),vpw_wexx(stars%ng3,dimension%jspd),&
......
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