Perl Utility for Specification Checking
The establishment of code specifications allows FMS to commit to a standard interface, allowing for source that is much easier to read, maintain, and, when necessary, override. Concerns of time commitment to migrating codes to such a standard have lead the computing services group to create scripts which perform a large number of tests on Fortran 90 code in order to locate many specification conflicts quickly. This document describes the primary tool currently used.
Setting Up
In order to use the specification code, you must first set up some environmental variables. The easiest way to do so is to add information to your .cshrc file and source it. The lines to be added are at the end of this document. Once that is complete, you can start using the program.
The program: Controller.pm
The primary program to be used is Controller.pm. It is fairly simple
to use for a single file. Just enter
Controller.pm filename
at the command line. Various other options are available through
flags
It should be noted that documentation is available in two forms via the unix
prompt. A brief description of the flags is available through the --help
flag:
Controller.pm --help or Controller.pm -h
For more thorough documentation, a perldoc page has been written:
perldoc Controller.pm
This will bring up a man-like documentation page.
Flags
Perl allows for the use of flags as command line arguments. These flags are written
in the form
--flagname[[=]value]
There are several important options in using perl flags.
- either a single (-) or double (--) dash can be used.
- if a value is required, the equals sign is optional, but, in its absence, a space must be used.
- flag names only need to be typed to the point at which they are unique (thus -h can be used instead of --help)
- flag names are not case sensitive
That said, the flags for Controller.pm are as follows:
-h, --help- prints brief help information
-l, --list=filelist- specifies an input file containing a newline seperated file list.
-d, --dir=directory- indicates a directory to search for Fortran files.
-r, --recursive- when used with -d directory, will recursively search any subdirectories
-o, --out=outputfile- specifies an output file for error messages
Note that if Controller.pm is not passed either the -d or -l flags, it must be passed a filename to work with.
Bug Reports and Comments
Please send any bug reports or comments to Zhi
Insert into .cshrc
#.cshrc stuff begins: setenv PATH ${PATH}:/home/bnd/local/bin setenv PATH
${PATH}:/home/bnd/bin/perl5 if ( $?MANPATH ) then setenv MANPATH ${MANPATH}:/home/bnd/local/share/man:/home/bnd/local/man
else setenv MANPATH /home/bnd/local/share/man:/home/bnd/local/man endif if ( $?PERLLIB
) then setenv PERLLIB ${PERLLIB}:/home/bnd/local/lib/site_perl/5.6.0 else setenv
PERLLIB /home/bnd/local/lib/site_perl/5.6.0 endif setenv PERLLIB ${PERLLIB}:/home/z1l/public_html/cgi-bin/code_spec
setenv PERLLIB ${PERLLIB}:/home/bnd/local/lib/site_perl/5.6.0/i386-linux setenv
PERLLIB ${PERLLIB}:/home/bnd/local/lib/5.6.0/i386-linux setenv PERLLIB ${PERLLIB}:/home/bnd/lib/perl5

