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)