Several issues with Velocity Verlet and nstcalcenergy>1 - Redmine #2718
The md-vv integrator computes energies when step-1 is a multiple of nstcalcenergy. A comment in the code says that this is because the first part of the loop belongs to the previous ste But several other booleans, among which energy file writing, free-energy and expanded ensemble use step and not step-1 to decide at which step to do things. So it looks like energies written to file and used for free-energy and expanded ensemble are outdated by nstcalcenergy-1 steps or can be zero or partially filled (at least in case of expanded ensemble).
My suggestion is to force nstcalcenergy=1 with md-vv in mdrun.
(from redmine: issue id 2718, created on 2018-10-29 by berkhess, closed on 2018-10-31)
- Revision ef48ba37 by Berk Hess on 2018-10-31T07:20:44Z:
Correct VV integrator nstcalcenergy use With velocity Verlet integrators, mdrun would compute energies which contribute to averages in the energy output and might be used for expanded ensemble calculcations one step too late. Fixes #2718 Refs #2714 Change-Id: I67e4d00f7151ec9eb5dab6ca4e87b81ca12236e2
- Revision 626e3818 by Berk Hess on 2018-10-31T12:33:40Z:
Work around expanded ensemble issues Two bugs could cause expanded ensemble sampling to use outdated or zero energies. In these cases mdrun now modifies nstcalcenergy to 1 to avoid these bugs. Note: This change should not be merged upstream, since there is a proper fix for release-2019. Refs #2714 Refs #2718 Change-Id: I79be9c5da55eaebb857bac6a98e6671720532e0e