name&dimensionality | kind | in/out | description |
---|---|---|---|
fname | CHR | IN | file containing the simulation parameters. If empty, parameters are obtained interactively. |
handle | PMF | INOUT | Object of type (paramfile_handle) used to store parameter information |
keyname | CHR | IN | name of the required parameter |
default | XXX | IN | optional argument containing the default value for a given simulation parameter; must be of appropriate type. |
vmin | XXX | IN | optional argument containing the minimum value for a given simulation parameter; must be of appropriate type. |
vmax | XXX | IN | optional argument containing the maximum value for a given simulation parameter; must be of appropriate type. |
descr | CHR | IN | optional argument containing a description of the required simulation parameter |
filestatus | CHR | IN | optional argument. If present, the parameter must be a valid filename. If filestatus=='new', the file must not exist; if filestatus=='old', the file must exist. |
code | CHR | IN | optional argument. Contains the name of the executable. |
silent | LGT | IN | optional argument. If set to .true. the parsing routines will run silently in non-interactive mode (except for warning or error messages, which will always appear). This is mainly intended for MPI usage where many processors parse the same parameter file: silent can be set to .true. on all CPUs except one. |
ROUTINES:
handle = parse_init (fname [,silent])
initializes the parser to work on the file fname, or interactively, if fname is empty
intval = parse_int (handle, keyname [, default, vmin, vmax, descr])
longval = parse_long (handle, keyname [, default, vmin, vmax, descr])
realval = parse_real (handle, keyname [, default, vmin, vmax, descr])
doubleval = parse_double (handle, keyname [, default, vmin, vmax, descr])
stringval = parse_string (handle, keyname [, default, descr, filestatus])
logicval = parse_lgt (handle, keyname [, default, descr])
These routines obtain integer(i4b), integer(i8b), real(sp), real(dp), character(len=*) and logical values,
respectively.
Note: parse_string will expand all environment variables of
the form ${XXX} (eg: ${HOME}). It will also replace a leading
~/
by the user's home directory.
call parse_summarize (handle [, code])
if the parameters were set interactively, this routine will print out a parameter file performing the same settings.
call parse_check_unused (handle [, code])
if a parameter file was read, this routine will print out all the parameters found in the file but not used by the code. Intended at detecting typos in parameter names.
call parse_finish (handle)
frees the memory
If a file is provided as command line argument when running the executable who_r_u, that file will be parsed in search of the lines starting with 'name =' and 'age =', otherwise the same questions will be asked interactively.
Version 3.83, 2024-11-13