jayponder/tinker — pull request #2 by leeping (2013-11-02 07:02:08+00:00)
Title: ForceBalance compatibility changes

This pull request highlights some changes that I made to TINKER in order to improve compatibility with ForceBalance. I don't intend for this to go directly into the main branch, but this thread would be a good place to start a discussion.

MAIN FEATURES

- Writes ".box" file during dynamics simulation when "save-box" option is activated; automatically read in during "analyze" program
- Number of digits in printout changed to reflect "digits" variable in several places
- Prints out multipole moments when analyzing the energy
- Avoids extra calculations in "induce" subroutine - on function call, coordinates are saved. If function is called again with the same coordinates, then function call is skipped.

```analyze.f```

- In program analyze, it checks for the presence of a .box file if we are looking at an .arc. It uses the .box file to update the periodic box as we loop over the .arc file.

- In subroutine propyze the number of digits is changed to reflect the "digits" .key option.

- In subroutine enrgyze (analyze.f) the multipole moments are now printed out, so you get the moments when entering the "E" option. This is mainly to improve the speed of multipole moment calculations.

```atoms.i```

- The arrays "(x,y,z)stor" were added for the saving of coordinates.

```induce.f```

At the end of subroutine induce, the current Cartesian coordinates are saved to arrays xstor, ystor and zstor after the calculation. At start of subroutine induce, the calculation is skipped if the Cartesian coordinates match those in xstor, ystor, and zstor. This avoids multiple calculations of the induced moments for the same geometry, which may happen when "analyze" is called.

```mdinit.f```

Reads in the "SAVE-BOX" variable.

```mdsave.f```

- In subroutine mdsave code was added to read the 'SAVE-BOX' variable. The box vectors are printed to a file (.box) every time the coordinates (.arc) is saved.

- The number of digits is changed to reflect the "digits" .key option.

```mdstat.f```

- The number of digits is changed to reflect the "digits" .key option.

mdstuf.i :

- The logical "boxsave" was added to specify whether boxes were being saved.

polarize.f :

- The number of digits is changed to reflect the "digits" .key option.

readxyz.f :

- Subroutine readbox was added to read the periodic box vectors from a ".box" file, mainly for the purpose of running the "analyze" program over a trajectory (.arc) file for an NPT simulation. (The .arc file doesn't contain the boxes.)