Purpose of Module

Module PotMod is a library of potential energy subroutines and interfaces to external potential energy calculation codes. It provides potential energies and corresponding gradients for included potentials or calls an external code to compute the required quantities. Currently, two subroutines are implemented within this module. A subroutine for the calculation of harmonic and Morse potential energies which requires a set of input parameters provided as an external file, and a subroutine containing the analytic ground state electronic energy for the \text{CH}_{5}^{+} system. [Jin]

Applications of the Module

This module is extensively used by the PaPIM code and PIM_wd and ClassMC modules for providing the necessary potentials and gradients of studied systems.


The code should be compiled in the ./source sub-directory using a Fortran compiler. A Makefile is present for an automatic compilation. Execute command ‘make’ in the ./source sub-directory to generate the PotModRun.exe executable:

cd source



For PotMod test purposes the numdiff package is used for automatic comparison purposes and should be made available before running the tests, otherwise the diff command will be used automatically instead but the user is warned that the test might fail due to numerical differences. The user is advised to download and install numdiff from here. The module is accompanied by a corresponding Fortran 90 test subroutine and a reference output. The reference output is located in sub-directory ./tests/REFERENCE_VALUE. The test can be executed automatically by running the script ./test.sh:

cd tests


or manually by executing the compiled PotModRun.exe code within the sub-directory ./tests (example ../source/PotModRun.exe > out) and comparing the output with the reference values in file REFERENCE_VALUE/tested_potentials.

Source Code

The source code is given at https://gitlab.e-cam2020.eu/Quantum-Dynamics/PIM/tree/PotMod. File harmonic_potential.f90 contains the subroutines for harmonic and Morse potential energy calculations, while file ch5_pes.f90 contains the subroutines for calculation of CH5+ potential energy. File PotMod.f90 controls and calls the included subroutines (harmonic_potential.f90 and ch5_pes.f90). The remaining subroutines (GlobType.f90, kinds.f90, ReadFiles.f90, PotModRun.f90) are subroutines for test purposes, where GlobType.f90 contains the definition of derived types used by PotMod module.

Source Code Documentation

The source code documentation is given at https://gitlab.e-cam2020.eu/Quantum-Dynamics/PIM/tree/PotMod/doc/. The documentation files (html and latex format) are obtained by executing the make command in the ./doc sub-directory:

cd doc



[Jin]Z. Jin, B. Braams, J. Bowman J. Phys. Chem. A 110 (2006) 1569 DOI: 10.1021/jp053848o