scale parameters in a gromacs topology to implement solute or partial tempering

This command line tool is implemented as a shell script. Its help message is pasted below:

  plumed partial_tempering [--gromacs4] scale <

where scale is the Hamiltonian scaling factor and is a post-processed topology file (i.e. produced with grompp -pp)
where each "hot" atom has a "_" appended to the atom type, e.g.:

     1 amber99_43_     1    RC5    O5'      1    -0.6223         16   ; qtot -0.6223

Notice that the section that should be edited is the [atoms] section for all the
molecules that you wish to affect (typically only for the solute, but you may also
want to change solvent parameters).

Also remember to first produce the file with grompp -pp. Editing a normal file will not work, because it does not contain all the parameters.
The file should not have any "#include" statement.

# produce a processed topology
grompp -pp
# choose the "hot" atoms
# generate the actual topology
plumed partial_tempering $scale < > topol$

WARNING: It's not very robust and there might be force-field dependent issues!
A few tests are strongly suggested.

WARNING: This script requires gawk to be available on your system.

1. Compare partial_tempering with scale=1.0 to non-scaled force field. E.g.
grompp -o topol-unscaled.tpr
grompp -pp
vi # choose the "hot" atoms appending "_". You can choose whatever.
plumed partial_tempering 1.0 < > # scale with factor 1
grompp -p -o topol-scaled.tpr
# Then do a rerun on a trajectory
mdrun -s topol-unscaled.tpr -rerun rerun.trr
mdrun -s topol-scaled.tpr -rerun rerun.trr
# and compare the resuling energy files. they should be identical

2. Compare partial_tempering with scale=0.5 to non-scaled force field.
Repeat the same procedure but using "plumed partial_tempering 0.5".
Choose all the atoms in all the relevant [atoms] sections (e.g. solute, solvent and ions).
In the two resulting energy files you should see:
long range electrostatics, LJ, and dihedral energy is *half* in the scaled case
all other terms (bonds/bends) are identical.
Glossary of keywords and components