fpt and WinFPT Reference Manual - Command-line Commands
| SimCon Home | Ref Manual Home |
BUILD NAMELIST FOR COMMON BLOCKS
[DO NOT] BUILD NAMELIST [FOR] [COMMON] [BLOCKS]
fpt generates a NAMELIST which contains all of the variables in COMMON blocks in the entire program. The NAMELIST may then be used to initialise the program or to control it at run-time.
The NAMELIST is written in an INCLUDE file. The file name is made up of the base file name of the first FSP or Fortran source file specified, with the suffix "_nml and the default output file name extension for INCLUDE files (Please see INCLUDE OUTPUT FILE NAME EXTENSION). If a value for MAXIMUM BASE FILE NAME LENGTH has been specified, the file name may be shortened.
fpt writes the NAMELIST in either of two formats, controlled by the commands BUILD NAMELIST AS A SINGLE STATEMENT and BUILD NAMELIST AS MULTIPLE STATEMENTS.
If the NAMELIST is built as a single statement, it is written, for example:
NAMELIST /COMMONS/ADBATTRIB,ADBCOMNAME,ADBDIMTAB,ADBSYMNAME, & BEAR1,BEAR2,B_ADBCHARACTER,B_ADBINTEGER,B_DEVCOM,B_PATCOM,C1, & C2,CPATH,IRAN,MPATH,V1,V2,X1,X2,Y1,Y2,Z1,Z2
if it is built as multiple statements, it is written, for example:
NAMELIST /COMMONS/ADBATTRIB NAMELIST /COMMONS/ADBCOMNAME NAMELIST /COMMONS/ADBDIMTAB NAMELIST /COMMONS/ADBSYMNAME NAMELIST /COMMONS/BEAR1 NAMELIST /COMMONS/BEAR2 NAMELIST /COMMONS/B_ADBCHARACTER NAMELIST /COMMONS/B_ADBINTEGER NAMELIST /COMMONS/B_DEVCOM NAMELIST /COMMONS/B_PATCOM :
Most compilers will accept at least one of these formats, and most will allow many hundreds of names to be present in a NAMELIST.
By default, the NAMELIST for the COMMON blocks is named /COMMONS/. It may be changed by the command COMMON BLOCK NAMELIST NAME.
The declarations required for the NAMELIST may be generated by the command MOVE COMMON BLOCKS TO A SINGLE INCLUDE FILE.
By default, fpt recognises that variables with explicit data size declarations, and variables where the data size is inferred from the system defaults are potentially different, even when the sizes and all other attributes are actually the same. Separate NAMELIST entries are therefore generated for such variables. NAMELIST generation may be instructed to ignore the defaulting of data sizes by the command BUILD NAMELIST TO IGNORE DEFAULT SIZES.
Where to Use this Command
|Operating system command line||Yes|
|Configuration file, config.fsp||No|
|Specification (fsp) files, *.fsp||Yes|
|Interactively, to FPT> prompt||Yes|
|Interactive command files||Yes|
|Embedded in the Fortran code||No|
A NAMELIST is not generated by default (Note that defaults may be changed in the configuration file)
In an FSP file:
%build namelist as a single statement %build namelist for common blocks %move common blocks to a single INCLUDE file
BUILD NAMELIST AS A SINGLE STATEMENT
BUILD NAMELIST AS MULTIPLE STATEMENTS
COMMON BLOCK NAMELIST NAME
MOVE COMMON BLOCKS TO A SINGLE INCLUDE FILE
Copyright ©1995 to 2022 Software Validation Ltd. All rights reserved.