From 9908b42ba1bc36f6d9ca5cd808eea88c14226f22 Mon Sep 17 00:00:00 2001 From: Philipp Pracht Date: Thu, 10 Oct 2024 18:05:41 +0200 Subject: [PATCH] Fix maxcycle stop in ANCOPT so that microiterations don't overshoot --- src/optimize/ancopt.f90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/optimize/ancopt.f90 b/src/optimize/ancopt.f90 index de440835..287f46b5 100644 --- a/src/optimize/ancopt.f90 +++ b/src/optimize/ancopt.f90 @@ -221,6 +221,8 @@ subroutine ancopt(mol,calc,etot,grd,pr,wr,iostatus) esave = etot !> save energy before relaxation !>--- call the actual relaxation routine !> this routine will perform [maxmicro] relaxation steps + if(iter+maxmicro >= maxcycle) maxmicro = maxcycle - iter +!> [maxmicro] need to be adapted to not overshoot maxcycle call relax(molopt,calc,OPT,iter,maxmicro,etot,grd, & & ethr,gthr,converged, & & pr,wr,ilog,iostatus,avconv)