Skip to content

Commit

Permalink
stop MD if SCF does not converge
Browse files Browse the repository at this point in the history
  • Loading branch information
marci73 committed Dec 5, 2018
1 parent 5e4b991 commit adb7c67
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/motion/md_run.F
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,13 @@ SUBROUTINE qs_mol_dyn_low(md_env, md_section, motion_section, force_env, globenv
END IF
IF (ehrenfest_md) force_env%qs_env%rtp%istep = istep
CALL cp_iterate(logger%iter_info, last=(istep == simpar%nsteps), iter_nr=itimes)
! CALL cp_iterate(logger%iter_info, last=(istep == simpar%nsteps), iter_nr=itimes)
IF(.NOT. logger%iter_info%last_iter(logger%iter_info%n_rlevel)) THEN
CALL cp_iterate(logger%iter_info, last=(istep == simpar%nsteps), iter_nr=itimes)
ELSE
CALL cp_iterate(logger%iter_info, last=.TRUE., iter_nr=itimes)
END IF
! Open possible Shake output units
simpar%info_constraint = cp_print_key_unit_nr(logger, constraint_section, "CONSTRAINT_INFO", &
extension=".shakeLog", log_filename=.FALSE.)
Expand Down Expand Up @@ -495,6 +501,7 @@ SUBROUTINE qs_mol_dyn_low(md_env, md_section, motion_section, force_env, globenv
CALL external_control(should_stop, "MD", globenv=globenv)

!check if upper bound of total steps has been reached
IF(.NOT. (istep == simpar%nsteps) .AND. logger%iter_info%last_iter(logger%iter_info%n_rlevel)) should_stop = .TRUE.
IF (itimes >= simpar%max_steps) should_stop = .TRUE.

! call external hook e.g. from global optimization
Expand Down

0 comments on commit adb7c67

Please sign in to comment.