[lammps-users] Different "thermo flag": different results ?

I performed a simple simulation with 750 water molecules (lammps 2001). Ewald method and LJ (12-6) potential energy were used for non-bond interactions between the water molecules. However, I found different values of “thermo flag “, which is used to control the frequency of printing the thermodynamic information to screen, had some influence on the results, including the thermodynamic info, and the atom positions at the same timesteps. For example, the “thermo flag” values were chose to be 1 and 50 for two test simulations with the same frequency of dumping the atoms (every 100 timesteps), the differences between the two thermodynamic info printed from the two simulations (at the same timesteps, such as the 2000th steps, etc ) were found. Also there are some differences for the atom positions in the two dump files. The differences become great with the simulation progress.

I check the original procedure “thermo.f” and it seems that this command has no influence on performing simulation (compute force and integrate the equation).

Any comments about this will be highly appreciated.

This behavior is the same in the current C++ LAMMPS, where
atom trajectories can change due to changing the frequency
of thermodynamic output. Since thermo output is really only
a diagnostic, it seems paradoxical. The reason for it is subtle.

It has to do with the order floating point operations are done.
Think of the total force on an atom as computed by

f = b1 + b2 + p1 + p2 versus
f = b1 + b2 + (p1 + p2)

The b terms are bond contributions; the p terms are pairwise.
The former is what happens on non-thermo timesteps, the
latter on thermo timesteps. Algebraically they give the same
answer, but not numerically. Hence you can get slightly different
forces which leads to diverging trajectories. The second form
is used on thermo timesteps in order to isolate the pairwise
forces to optimize the virial calculation for the pressure.

Bottom line: both results are "correct", they only differ due to
round-off. So you shouldn't worry about it.

Steve