MOPAC: Example#

Here, we demonstrate the non-interactive usage of the MOPAC image recipe.

Running MOPAC Non-interactively#

First, let’s create a temporary folder, temp in your home directory and cd to it

mkdir ~/temp && cd ~/temp

Use your favorite text editor to create a new input file. Let’s call it test.mop and copy-paste the following code block into it and then, save it.

AM1 1SCF
Formic acid
Example of a single-point calculation
O
C    1.20 1
O    1.32 1  116.8 1    0.0 0   2  1
H    0.98 1  123.9 1    0.0 0   3  2  1
H    1.11 1  127.3 1  180.0 0   2  1  3
0    0.00 0    0.0 0    0.0 0   0  0  0

This input file drives a single-point self-consistent field (SCF) calculation on formic acid using AM1 semi-empirical model.

Note

Using the keyword 1SCF is the recommended way to perform a single-point SCF energy calculation in MOPAC.

At this stage, the content of your directory should look like the following

temp
└── test.mop

It’s time to copy the docker run command from the catalog, paste it into your terminal and edit it to look like the following command line

docker run --rm -w /home -v $PWD:/home molssi/mopac220-mamba141:latest /bin/bash -c "mopac test.mop test.out"

then press Enter. If nothing goes wrong, you should see the following lines in your terminal

MOPAC Job: "test.mop" ended normally on Jun  1, 2023, at 18:19.

Your directory should now have the following structure

temp/
├── test.mop
├── test.arc
└── test.out

Note

If you’re a pessimist, run the following command to see if the job has finished normally

grep "JOB ENDED" test.out

You should see the following output in your terminal

* JOB ENDED NORMALLY *

Note

The same Docker image recipe can also be used with Apptainer (Singularity) to obtain the same result via the following command

apptainer exec docker://molssi/mopac220-mamba141:latest mopac test.mop test.out

Note that Apptainer binds /home/$USER, /tmp and current working directory ($PWD) from the host system to the running container by default. For further details see the Apptainer documentation.