Table of Contents
idf - Input Directive File (IDF) processor
[-- idf_parameter=value ...]
idf creates an input parameter file
by changing selected parameters based on an Input Directive File (IDF).
An IDF describes named and typed input parameters meant to supply parameters
to a program. This file then matched to an actual example of this parameter
file, where the parameters are not named (list a list of numbers). Selected
named parameters can be changed then written out to a new parameter file
in order for an external program to run and use this parameter file.
example of use would be where two input files (foobar.idf and foobar.inp)
create an output file (run1.inp) where two parameters were given a new value:
idf foobar.idf foobar.inp run1.inp -- n=100 eps=0.01
foobar < run1.inp
but see also the EXAMPLES below.
For a full description of the format, see
The following parameters are recognized in any order
if the keyword is also given, and need to be given before the IDF PARAMETERS
The following IDF parameters have
to be preceded by the standard -- separator, such that NEMO parsing can stop.
- Input Directive File. This file is the template with type
and name information for the parameters. See also idf(5NEMO)
. If none supplied,
the internal example is shown that can be played with. No default.
parameter file. This file is an example that another program will use as
input file, but where some of the values need to be modified. If none supplied,
only IDF parsing is attempted. Default: none.
- Output parameter file.
The file contains the changed parameter based on the new values given to
the IDF parameters. If none supplied, only substituation is attempted, as
long as the input parameter file is given. Default: none
- Add linenumbers
to IDF output? A debug option [f]
- Check types (real/integer/string/...).
Not implemented yet. [f]
- Report all key=val pairs for the IDF_parameters.
Useful as a reminder [f]
ended array IDF keywords do not use nemoinp(1NEMO)
style expression yet,
.e.g. you cannot use rad=2:10:2, but instead would need (csh notation):
- Any parameters after this designator is not parsed by the NEMO command
line processor (see also getparam(3NEMO)
), but the keyword names are expected
to be present in the IDF file.
- Any set of named IDF_parameters can
be listed here. Currently very little parsing checks are done here.
set rtmp=(‘nemoinp 2:10:2‘)
IDF keyword do not use getparam(3NEMO)
yet, so interesting constructs such
as firstname.lastname@example.org cannot be used here.
In the following example an
integer and real parameter are read by a program from standard input:
% cat foobar.idf
# comments for the ’foobar’ program
% cat foobar.par
% idf foobar.idf foobar.par run1.par -- eps=0.1
% cat run1.par
% foobar < run1.par
FORTRAN programs have a variety of styles of getting input parameters. The
most common ones that don’t use a NAMELIST are:
1) read directly from standard
input: ’foobar < foobar.inp’
2) ask for the file that contains the parameters:
’echo foobar.inp | foobar’
3) fixed name, where it expects that file (e.g.
foobar.inp) to be present: ’foobar’
In addition, some programs also have
little flexibility to change their output filename, which results in the
usage of a run directory in order for programs to run in parallel.
src/kernel/io/idfio.c source code
$NEMODAT/idf/*.idf Example IDF for various NEMO examples
12-aug-2014 V0.1 man page written PJT
13-aug-2014 implemented single open ended array PJT
Table of Contents