UM 2p4
return to user manual index page
2.4 Syntax and structure of the parameter file
The above example should have given you a general impression on how parameter files are structured. In this section we will see the more general syntax and structure rules of a parameter file.
2.4.1 Syntax
General : No line should be longer than 128 characters. Any succession of white spaces and/or tabulation characters (ASCII code 9) is condensed into one single white space while interpreting the file. Leading and trailing blanks are removed, from keywords as well as from arguments, ie you may insert any number of spaces and/or tabulations between the beginning of the line, the keywords, the equal sign, the arguments and the comments. Blank lines are ignored. All input text files should be in Windows ANSI or DOS ASCII encoding, and should not contain any non-printable characters except for new line characters, tabulations and whitespaces.
Comments start with an exclamation mark and end at the end of the line. You may add comments after keywords and arguments on the same line. Any characters between an exclamation mark and an end of line character are ignored.
Keywords and arguments are separated by an equal sign (=) and optionally any whites- pace and tabulations. A keyword and its argument must be on a same line. The parts of a keyword consisting of more than one word must be separated by at least a white space or a tabulation, or any combination of white spaces and tabulations. Keywords and arguments are case sensitive.
Real arguments are to be given in the common scientific notation, ’e’, ’E’, ’d’ or ’D’ marking the exponent. For example the arguments
1.5e-3, 1.5d-03, 0.15D-2, 0.0015
are equivalent.
Complex arguments are to be given in the form
- (real part,imaginary part)
with real part and imaginary part following the syntax of real arguments. Assigning a real value (without brackets and imaginary part) to a keyword requiring a complex argument is not valid and assigns a random value to the imaginary part of the complex value.
Integer arguments are given as usual integers.
Logical arguments take the values .true. or .false. (as in Fortran).
Character string arguments may contain white spaces and tabulations, but any se- quence of white space or tabulation will be replaced by a single white space. A string argu- ment starts with the first non-blank character following the equal sign and ends with the last non-blank character preceding an exclamation mark or an end of line.
end : the end statement ends a parameter file: lines following the line of the end statement are ignored. If a parameter file ends before an end statement is encountered, execution stops and a warning message is written to the error file.
2.4.2 Structure
The general structure of a parameter file is as follows
- Definition of a structure,
- Definition of other physical parameters eg wavelength,
- Definition of FIBRE specific parameters, eg parameters relating to the algorithm used
by FIBRE , such as number of points in the determinant map, thresholds, etc. Most of
these parameters have default values and don’t need to be defined unless their default
value is not suited to the specific simulation. - Definition of file names or file name suffixes,
- Action keywords,
- end statement.
A parameter file may contain different simulations: any of the steps 1 to 4 can appear after an action keyword, redefining one or more parameters, before a new action keyword. An example of a parameter file running two successive simulations with different parameters is given in “My CUDOS MOF Files\samples\dispersion 2\parameters.txt”. However, when doing so, one should make sure to redefine the file name suffixes in order to avoid that one simulation overwrites results from the preceding simulation. (See also the ’overwrite’ keyword).
The order of definition statements between action statements is - up to a few exceptions (see section 2.5) - not important. The order of appearance of action keywords in the parameter file does, however, matter, since action keywords use information previously defined by information statements. Further, some action keywords define or modify previously defined parameters. For example you may not ask to save a structure with the ’save fibre’ action keyword before a structure has been defined, eg using the ’build fibre’ action keyword.
If a same information keyword is used more than once with different arguments, the argument will take the value defined in the last occurrence of the information keyword before encountering the action keyword. For example, if a parameter file contains
lambda=3.0 lambda=2.0 search modes [...] lambda=1.0 search modes
the first simulation will use lambda=2.0, the second simulation will use lambda=1.0.
If an action keyword occurs before all parameters required for the execution of the action have been defined, the program will stop and all required parameters which remained undefined will be listed in the error file.