It is sometimes useful to place a series of jobs into a single ASCII file. This feature is supported by Q-Chem and is invoked by separating jobs with the string @@@ on a single line. All output is subsequently appended to the same output file for each job within the file.
Note: The first job will overwrite any existing output file of the same name in the working directory. Restarting the job will also overwrite any existing file.
In general, multiple jobs are placed in a single file for two reasons:
To use information from a prior job in a later job
To keep projects together in a single file
The @@@ feature allows these objectives to be met, but the following points should be noted:
Q-Chem reads all the jobs from the input file on initiation and stores them. The user cannot make changes to the details of jobs which have not been run post command line initiation.
If any single job fails, Q-Chem proceeds to the next job in the batch file.
No check is made to ensure that dependencies are satisfied, or that information is consistent (e.g. an optimization job followed by a frequency job; reading in the new geometry from the optimization for the frequency). No check is made to ensure that the optimization was successful. Similarly, it is assumed that both jobs use the same basis set when reading in MO coefficients from a previous job.
Scratch files are saved between multi-job/single files runs (i.e., using a batch file with @@@ separators), but are deleted on completion unless a third qchem command line argument is supplied (see Chapter 2).
Using batch files with the @@@ separator is clearly most useful for cases relating to point 1 above. The alternative would be to cut and paste output, and/or use a third command line argument to save scratch files between separate runs.
For example, the following input file will optimize the geometry of H at HF/6-31G*, calculate vibrational frequencies at HF/6-31G* using the optimized geometry and the self-consistent MO coefficients from the optimization and, finally, perform a single point energy using the optimized geometry at the MP2/6-311G(d,p) level of theory. Each job will use the same scratch area, reading files from previous runs as instructed.
Example 3.18 Example of using information from previous jobs in a single input file.
$comment
Optimize H-H at HF/6-31G*
$end
$molecule
0 1
H
H 1 r
r = 1.1
$end
$rem
JOBTYPE opt Optimize the bond length
METHOD hf
BASIS 6-31G*
$end
@@@
$comment
Now calculate the frequency of H-H at the same level of theory.
$end
$molecule
read
$end
$rem
JOBTYPE freq Calculate vibrational frequency
METHOD hf
BASIS 6-31G*
SCF_GUESS read Read the MOs from disk
$end
@@@
$comment
Now a single point calculation at at MP2/6-311G(d,p)//HF/6-31G*
$end
$molecule
read
$end
$rem
METHOD mp2
BASIS 6-311G(d,p)
$end
Note: (1) Output is concatenated into the same output file.
(2) Only two arguments are necessarily supplied to the command line interface.