Commit 0e1bcd00 authored by Gregor Michalicek's avatar Gregor Michalicek

Put reset of Broyden history into an own subroutine

parent 244d0af6
......@@ -192,6 +192,31 @@ SUBROUTINE writeVVec(input,hybrid,vecLen,currentIter,dfivi,vVec)
END SUBROUTINE writeVVec
SUBROUTINE resetBroydenHistory()
INTEGER :: i
LOGICAL :: l_exist
CHARACTER(LEN=20) :: filename
INQUIRE(file='broyd',exist=l_exist)
IF (l_exist) THEN
CALL system('rm broyd')
PRINT *,"Broyden history has been reset."
END IF
DO i = 1, 9
filename = 'broyd.'//CHAR(i+48)
INQUIRE(file=TRIM(ADJUSTL(filename)),exist=l_exist)
IF (l_exist) THEN
CALL system('rm '//TRIM(ADJUSTL(filename)))
END IF
filename = 'hf_broyd.'//CHAR(i+48)
INQUIRE(file=TRIM(ADJUSTL(filename)),exist=l_exist)
IF (l_exist) THEN
CALL system('rm '//TRIM(ADJUSTL(filename)))
END IF
END DO
END SUBROUTINE resetBroydenHistory
LOGICAL FUNCTION initBroydenHistory(input,hybrid, vecLen)
! Initializes a Broyden history
! returns true if there already exists a Broyden history
......
......@@ -42,6 +42,7 @@ CONTAINS
USE m_pldngen
USE m_optional
USE m_cdn_io
USE m_broyd_io
USE m_qfix
USE m_vgen
USE m_rhodirgen
......@@ -730,16 +731,7 @@ CONTAINS
CLOSE(2)
PRINT *,"qfix set to F"
ENDIF
INQUIRE(file='broyd',exist=l_exist)
IF (l_exist) THEN
CALL system('rm broyd')
PRINT *,"broyd file deleted"
ENDIF
INQUIRE(file='broyd.7',exist=l_exist)
IF (l_exist) THEN
CALL system('rm broyd.7')
PRINT *,"broyd.7 file deleted"
ENDIF
CALL resetBroydenHistory()
ENDIF
CALL juDFT_end(" GEO new inp.xml created ! ",mpi%irank)
END SUBROUTINE priv_geo_end
......
......@@ -249,16 +249,7 @@ SUBROUTINE mix(stars,atoms,sphhar,vacuum,input,sym,cell,noco,oneD,&
IF (atoms%n_u > 0) THEN
IF (.NOT.l_densityMatrixPresent) THEN
inDen%mmpMat(:,:,:,:) = outDen%mmpMat(:,:,:,:)
INQUIRE(file='broyd',exist=l_exist)
IF (l_exist) THEN
CALL system('rm broyd')
PRINT *,"broyd file deleted because new density matrix is created."
ENDIF
INQUIRE(file='broyd.7',exist=l_exist)
IF (l_exist) THEN
CALL system('rm broyd.7')
PRINT *,"broyd.7 file deleted because new density matrix is created."
ENDIF
CALL resetBroydenHistory()
END IF
ENDIF
......
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