pf_check

Checks if .pf files in a directory need modification.

Synopsis:

Check all of the pf files in a directory to see if they require modification, alternatively run pieces of travis to make sure the parameter files will run.

Command line usage (if any):

usage:

pf_check.py directory_name

Description:

The program checks all the .pf files in a directory by running the file with Sirocco with the -i switch turned on so to check whether the pf file will run, querying the user for any missing inputs.

In order that ther original directory not be affected, it first copies all of the .pf files to a directory with the name:

pf_check_directory_date

The full path names to directories in the $SIROCCO/examples do not need to be given, so for example:

pf_check.py beta

will test the parameter files in $SIROCCO/examples/beta.

After running Sirocco in -i mode for each of the files, the routine diffs the .out.pf file with the original.pf file to see if changes should be made to the .pf file

A special procedure is used for the travis directory.

There the .travis.yaml file is parsed to see what options have been selected, e.g whether -d option has been included for that file. For the travis directory a -i option is added if it is missing, but then the travis commands are run.

It is up to the user to edit the .pf files and put them back in the original directory.

To help with this though, a file DoCommands is place in the output directory. One can source this file to re-execute the python runs

Primary routines:

doit

the main routine which runs everything

travis

the special routine for parsing the .travis.yaml file to get the commands to run

steer

interpret the command line

Notes

At present, there is no way general way (except for the travis directory) to handle .pf files which are supposed to be run with the -d switch. What could be done is to check for diagnostic commands and then add the -d switch.

History:

190304 ksl

Coding begun

Functions

doit(directory)

steer(argv)

Parse the command line and set everything up

travis()

Return a special set of commands when dealing with the travis directory