PSCF v1.4.0
Command Files

Parameter Files (Prev)         Field Files (Next)

For any PSCF simulation program, the parameter file is read first, followed by a command file. The name of the command file is specified when the program is invoked as the argument of the -c command line option. The command file contains a sequence of commands that are read and executed in the order in which they appear in the file. Each command begins with a command name that is given in upper case letters. Some commands take one or more parameters, which must appear after the command name on the same line, separated by whitespace. The program stops execution and returns control to the operating system when it encounters the command name 'FINISH' on a line by itself.

Full descriptions of all of the commands used by different PSCF programs that are relevant to SCFT calculations given here. Additional commands that are only relevant to PS-FTS calculations are described on a separate page.

Example

Suppose that pscf_rpc is used to perform an SCFT calculation, and is invoked from a directory that contains a parameter file named "param" and a command file named "command", using the command

pscf_rpc -e -p param -c command > log

Also suppose that the current working directory has subdirectories named "in" and "out", such that the "in" directory contains an initial w-field file named w.bf that is written in symmetry-adapted basis format, while all output files are written to the "out" directory.

An example of a minimal command file for a SCFT calculation of a structure with a specified space group symmetry is shown below:

READ_W_BASIS in/w.bf
ITERATE
WRITE_W_BASIS out/w.bf
WRITE_C_RGRID out/c.rf
FINISH

This command file could also be used by the GPU accelerated pscf_rpg program, which accepts the same set of commands and input file formats as scf_pc. This command file instructs the program to perform the following actions:

  • READ_W_BASIS: Read in an initial set of chemical potential fields (w-fields) from the file in/w.bf in symmetry-adapted Fourier basis format.
  • ITERATE: Iteratively solve the SCFT problem, using the iterator algorithm and parameters that are specified in the parameter file.
  • WRITE_W_BASIS: Write the converged chemical potential fields (w-fields) obtained by solving the SCFT problem to a file named out/w.bf in symmetry-adapted basis format.
  • WRITE_C_RGRID: Write the corresponding monomer concentration fields (c-fields) to a file out/c.rf in r-grid format, in which field values are given as values of nodes of a real-space grid.
  • FINISH: stop execution

The FINISH command is always the last command that is read in a command file, and causes execution of the program to halt.

In this example, w-fields are both read and written in basis format, using the commands READ_W_BASIS_and WRITE_W_BASIS. This is typical for SCFT calculations that are performed on a single unit cell of a structure of specified space group symmetry. The final monomer concentration fields have, however, been written in r-grid format, using the command WRITE_C_RGRID. Use of r-grid format for a c fields file allows the file to be processed by the POLYMER VISUAL program for visualization.

Use of file name prefixes

Many commands require the names of input or output files as arguments. By default, file names are interpreted as paths that are defined relative to the current working directory, i.e., relative to the directory from which the program executable was invoked. File name paths that appear in the command file may include names of subdirectories of this directory and path separator slash characters, as done in the above example.

This default behavior may, however, be modified by using the "-i" and "-o" command line options to automatically add prefixes to paths for input and output files.

Example (revisited) : The command file in the above example was designed for a case in which pscf_rpc or pscf_rpg is invoked without using the -i or -o command line options. Suppose that the program had instead been invoked using these options to specify prefixes of "in/" and "out/", e.g., as

> pscf_rpc -d 3 -p param -c command -i in/ -o out/ -e > log

Note that, if a prefix is used to specify a subdirectory path for input or output files, as in this example, then that prefix string must include a trailing backlash character, as done for the strings "in/" and "out/" in the above example. If the program were invoked using these prefix values, the corresponding command file could then have been modified to read as follows:

READ_W_BASIS w.bf
ITERATE
WRITE_W_BASIS w.bf
WRITE_C_RGRID c.rf
FINISH

In this modified version, the names of the input and output files that appear in the command file do not include explicit "in/" and "out/" subdirectory names. Instead, the prefix "in/" that was given as an argument to the "-i" command line option is automatically prepended to the name given for any input file, such as in/w.bf, while the prefix "out/" is prepended to the name of any output file, such as out/w.bf and out/c.rf.

Input and output file prefixes that are given as arguments of the -i and -o options are automatically applied to the names of input and output files that are specified either in the command file or in the parameter file. The input prefix is not, however, applied to the parameter and command file names that are given as arguments of the -p and -o command line options.


Parameter Files (Prev)         User Introduction (Up)         Field Files (Next)