Twenty five example programs are presented in detail in the book A Practical Introduction to the Simulation of Molecular Systems. In spite of the differences between the versions of the DYNAMO library described there and in these web pages, the majority of the examples remain unchanged. The source code for the examples and the differences, if any, are given below. Note that the source code for the examples and their output files are included in the version of the library that can be downloaded.
In addition to the examples from the book, this page also includes four example programs that show the use of the semi-empirical quantum mechanical and hybrid potential modules in the DYNAMO library. In general, DYNAMO programs that perform calculations with QM, hybrid or MM potentials differ very little, except for a few statements that specify which atoms are to be treated quantum mechanically. Otherwise, the types of calculation and the way that these calculations are performed are the same.
Example 1 remains unchanged.
Example 2 remains unchanged.
Example 3 has changed in two respects:
Example 4 remains unchanged.
Example 5 has changed in one respect:
Example 6 has changed in one respect:
Example 7 has changed in one respect:
Example 8 remains unchanged.
Example 9 remains unchanged.
Example 10 remains unchanged.
Example 11 has changed in one respect:
Example 12 has changed due to the rearrangement of the dynamics modules. The alterations are due to the splitting up of the argument list that was processed by the old subroutine DYNAMICS into three parts - a part concerned with velocity assignment that is handled by the subroutine Velocity_Assign, a part concerned with options common to all of DYNAMO's dynamics algorithms that is handled by the subroutine Dynamics_Options, and a part specific to the implementation of the dynamics algorithm that is handled by the subroutine that does the dynamics calculation, in this case the subroutine Velocity_Verlet_Dynamics.
In detail the changes to Example 12 are:
Example 13 remains unchanged.
Example 14 has changed in two respects:
A further change that could be made to this subroutine and that would enhance the transparency of the example is the use of the module Constraint to define the harmonic distance constraints between the atoms. This change will be made in the future.
Example 15 remains unchanged.
Example 16 has changes similar to those made for Example 12 and concern how the subroutines from the dynamics modules are called. Please refer to Example 12 for a fuller discussion.
Example 17 has changed in two respects:
Example 18 has changes similar to those made for Example 12 and concern how the subroutines from the dynamics modules are called. Please refer to Example 12 for a fuller discussion. In constrast to Example 12, however, Example 18 uses a leapfrog Verlet algorithm, implemented in the subroutine Leapfrog_Verlet_Dynamics, to do the dynamics simulation with the Berendsen method of pressure and temperature control.
Example 19 has changed in three respects:
Example 20 has changed in two respects:
Example 21 remains unchanged.
Example 22 remains unchanged except for the renaming of the type variable and the subroutines associated with reading trajectories. The new items all start with the characters DCD_ and are from the module DCD_IO whereas the names of the old items started with the characters TRAJECTORY_ and were from the module TRAJECTORY_IO. Although the names of these items have changed their calling sequences and usage remain the same.
Example 23 remains unchanged.
Example 24 remains unchanged.
Example 25 remains unchanged.
QM Example 1 performs a geometry optimization of the bALA molecule using the AM1 semi-empirical QM potential. The geometry optimization is carried out in the same way as in Example 6 but with two differences:
QM Example 2 performs a path-integral molecular dynamics simulation of the molecule CH5+ in which all the atoms are treated quantum mechanically and all the atoms are treated as path-integral atoms with 32 copies of each. When doing path-integral calculations, each copy of a path-integral atom is considered to be independent and so each copy must be specified explicitly in the system definition. Thus, in this example, the coordinate file (in this case in XYZ format) that is used to define the atoms in the system contains 32 sets of coordinates for the CH5+ molecule. After the system has been defined, the subroutine Mopac_Setup is called to indicate which atoms in the system are to be treated as QM atoms and which atoms are to path-integral atoms. In this example, all the atoms are QM atoms and all are path-integral atoms. The identity of the path-integral atoms is specified through the array argument, PIFLAG, which contains a list of the atoms in each of the path-integral `necklaces' or beads.
Hybrid Potential Example 1 performs a geometry optimization of a water dimer in which one of the molecules of water is treated with the AM1 semi-empirical QM potential and the second molecule with the OPLS-AA force field. The procedure for performing the optimization is similar to that of Example 6 except that the subroutine Mopac_Setup is called to specify which atoms are to treated quantum mechanically. The specification is made using the SELECTION argument and, in this case, is for the atoms of the second water molecule. It should be noted that Mopac_Setup must be called after the MM data for the system has been constructed or read in from an external file.
Hybrid Potential Example 2 performs a geometry optimization of the bALA molecule in which the methyl side-chain is treated quantum mechanically and the rest of the molecule molecular mechanically. DYNAMO uses a link-atom approximation to deal with molecules that have been partitioned between QM and MM regions but, as these are added automatically by the subroutine Mopac_Setup for each bond that exists between QM and MM atoms, the program is the same as that of HP Example 1.
AMBER Example 1 illustrates how data about a system can be written out in AMBER format. Coordinate data is written to AMBER coordinate files whereas information about a system's composition and its MM terms are written to AMBER topology files. This example was included primarily because the use of AMBER-format files is currently one of the easiest ways to transfer information between the older Fortran version of the DYNAMO library and its more recent cousins.
NEB Example 1 determines a reaction path for the transition between the chair and boat forms of cyclohexane using the NEB method. This is essentially the same as Example 9 but with the SAW commands replaced by their NEB versions.