Elsevier Science Home
Computer Physics Communications Program Library
Full text online from Science Direct
Programs in Physics & Physical Chemistry
CPC Home

[Licence| Download | New Version Template] aanj_v1_0.gz(7 Kbytes)
Manuscript Title: RDLIST: a portable NAMELIST facility.
Authors: A.C. Day
Program title: RDLIST AND PREPROCESSOR MAKEDATA
Catalogue identifier: AANJ_v1_0
Distribution format: gz
Journal reference: Comput. Phys. Commun. 22(1981)403
Programming language: Fortran.
Computer: IBM 360/65.
Operating system: WATFIV.
RAM: 6K words
Word size: 32
Keywords: General purpose, Utility, Namelist, Portable, Compatible, Character manipulation.
Classification: 4.14.

Nature of problem:
Programs often work by setting defaults and requiring users to change only a few of the parameters. The IBM Fortran NAMELIST facility is very convenient for this, allowing as it does the use of Fortran variable names in the input. The difficulty is that NAMELIST is not generally available. The problem is to write a portable Fortran replacement for NAMELIST.

Solution method:
The 'NAMELIST' entities are stored in a COMMON block. The names of these entities and any dimensions are stored in a second COMMON block by means of DATA statements in a BLOCK DATA subprogram. These DATA statements are automatically generated from the FORTRAN statement defining the first COMMON block, when this is fed as data into a preprocessor called MAKEDATA. A subroutine RDLIST is provided to read a list of assignments from the input and process them.

Restrictions:
Only one 'NAMELIST' is permitted. Only REAL variables and arrays are allowed. No repeat counts are possible (e.g. 3 * 1.0 to mean 1.0, 1.0, 1.0). Only input of information is provided for, not output.

Unusual features:
Fully portable character manipulation.

Running time:
MAKEDATA takes about 1 s. The time taken by RDLIST depends on the length of the list of input assignments, but typically takes a small fraction of a second per call.