TinkerTools / tinker

Tinker: Software Tools for Molecular Design
https://dasher.wustl.edu/tinker/
Other
129 stars 61 forks source link

Fix crashing NVE - return before thermostat #28

Closed jag1g13 closed 7 years ago

jag1g13 commented 7 years ago

Return from 'temper' subroutine before applying thermostat if using NVE.

Previously NVE crashed with NaNs originating from temperature scaling on line temper.f:101 under the default Bussi thermostat because the default value for 'kelvin' is -1 (set on dynamic.f:53). Skipping thermostatting when not running isothermally fixes this.

jayponder commented 7 years ago

This has been fixed via a modification of your suggestion. If not "isothermal", the code now returns from both "temper" and "temper2" immediately after computing the temperature. Also, if not restarting from an existing MD restart file (.dyn), the velocities are initialized from a distribution at a very small, nonzero temperature of 0.000001K in "mdinit".