Appendices

Appendix A: Namelist Input Syntax

NAMELIST input is available on many host computers, including all of the machines on which AMBER is supported. It dates back to the earlier 1960's on the IBM 709, but is regrettably not part of Standard FORTRAN (either 1966 or 1977). It is a part of the proposed Fortran 8.X standard. NAMELIST input groups take the form:

&name
var1=value, var2=value, var3(sub)=value,
var4(sub,sub,sub)=value,value,
var5=repeat*value,value,
&end

where the variables must be one of the names in the NAMELIST variable list. The order of the variables in the input list is of no significance, except that if a variable is specified more than once, later assignments may overwrite earlier ones. Blanks may occur anywhere in the input, except embedded in constants (other than string constants, where they count as ordinary characters). A comma (or the terminal &END) must follow each constant; end-of-line does NOT constitute a valid constant separator.

The NAMELIST name &name must ALWAYS begin in column 2 of an input record. The ampersand sign in &name and &end may optionally be replaced by a dollar sign, and the word ``end'' after the dollar sign may optionally be omitted. Column 1 of all input records is ignored, and only columns 2..80 are examined (in some implementations, a non-blank in the first column comments out the whole line). The terminal &end may occur anywhere in the input character stream (ignoring column 1 of course); it need not begin in column 2.

Letter case is ignored in all character comparisons, but case is preserved in string constants. An exception is that the namelist name itself must appear in lower case, e.g. &cntrl, not &CNTRL. String constants must be enclosed by single quotes ('). If the text string itself contains single quotes, indicate them by two consecutive single quotes, e.g. C1' becomes 'C1''' as a character string constant.

Scalar variables may NOT be subscripted, and must be followed by 0 or 1 constant.

Array variables may be subscripted or unsubscripted. An unsubscripted array variable is the same as if the subscript (1) had been specified. If a subscript list is given, it must have either one constant, or exactly as many as the number in the declared dimension of the array. Bounds checking is performed for ALL subscript positions, although if only one is given for a multi-dimension array, the check is against the entire array size, not against the first dimension. If more than one constant appears after an array assignment, the values go into successive locations of the array. It is NOT necessary to input all elements of an array.

There is one exception to the array specification syntax described above. For the most part, this only occurs in the case where the host machine does not adequately support namelist input, and the ``portable'' namelist routines supplied with AMBER are used. In this case, character arrays must be specified by explicit definition of each element of the array. E.g. ATNAME(1) = 'H', ATNAME(2) = 'O' will work, but ATNAME = 'H', 'O' will not. This exception to array specification should only occur for the ``portable'' namelist code, and only for character arrays (integer and real arrays can be specified as described above). To determine whether the ``portable'' namelist code was used, check the value assigned to MACHINEFLAGS in the file amber41/src/MACHINE. If -DREGNML is not specified (e.g. if -DnoREGNML is specified instead), the ``portable'' namelist is being used.

Any constant may optionally be preceded by a positive (1,2,3,..) integer repeat factor, so that, for example, 25*3.1415 is equivalent to twenty-five successive values 3.1415. The repeat count separator, *, may be preceded and followed by 0 or more blanks. Valid LOGICAL constants are 0, F, .F., .FALSE., 1, T, .T., and .TRUE.; lower case versions of these also work.

\


[Contents] [Previous] [Next]
Updated on January 5, 2000. Comments to case@scripps.edu