Molecular dynamics example programs in Fortran 90
- md1.f90:
A simple molecular dynamics programs, using the Lennard-Jones
potential. The potential is computed analytically in the
force loop. The force loop goes over all the particle pairs.
This code is simple but slow.
- md2.f90:
As md1, but the potential is stored into numerical tables
(once for all, during initialization), and table look-up followed
by interpolation are performed in the force loop.
This brings little - if any - speed advantage for Lennard-Jones, but
allows to deal efficiently with other potentials, such as
those including trascendental functions in their definition, or with
those which are just given in a numerical form.
- md3.f90:
As md2, but with Verlet neighbor lists. Automatic list update,
based on the amplitude of the displacement of individual particles
since the last list formation. The program operation depends on
the skin parameter which can be tuned to optimize CPU time.
- md3glue.f90:
As md3, but for a many-body "glue" potential instead of
the Lennard-Jones potential.
The file aluminum.f, to be compiled
and linked with md3glue, contains the functions for the
ab initio-derived Al potential of Ercolessi and Adams.
The above programs require a starting configuration containing the
atomic positions and velocities. You can generate one such configuration
from scratch using crystal.f90, which
arranges atoms in an f.c.c. lattice, or use a configuration produced
by a previous molecular dynamics run.
See the README file for more detailed information.
Here are some exercises you can do with these codes.
Suggestions and/or bug reports are welcome.
Back to the molecular dynamics page,
containing a
molecular dynamics primer
Furio Ercolessi