fpt and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Ref Manual Home |

MOVE COMMON BLOCKS ...

Syntax:

MOVE COMMON BLOCK[S] TO [A] SINGLE INCLUDE FILE

MOVE COMMON BLOCKS TO SEPARATE INCLUDE FILES

DO NOT MOVE COMMON BLOCKS

Function:

New INCLUDE Files

fpt generates new INCLUDE files as follows:

The Fortran PARAMETER INCLUDE file name, the COMMON block INCLUDE file name if a single INCLUDE file is specified, and the statement function INCLUDE file name are formed from the name of the first FSP or primary Fortran source file read by fpt, with the suffix _par, _cmn or _stf, and the current default INCLUDE output file name extension (Please see the command INCLUDE OUTPUT FILE NAME EXTENSION). The base file name preceding the suffix may be shortened or modified if a value for MAXIMUM BASE FILE NAME LENGTH has been specified.

The BLOCK DATA primary file name is formed from the name of the first FSP or primary Fortran source file read by fpt, with the suffix _bda and the current default primary output file name extension (Please see the command PRIMARY OUTPUT FILE NAME EXTENSION). Once again, the base file name preceding the suffix may be shortened or modified if a value for MAXIMUM BASE FILE NAME LENGTH has been specified. The BLOCK DATA sub-program name is constructed from the first main program name encountered, with the suffix _bda.

If MOVE COMMON BLOCKS TO SEPARATE INCLUDE FILES has been specified, a separate INCLUDE file is written for each COMMON block. The file names are then constructed from the COMMON block names, with the suffix _cmn and the current default INCLUDE output file name extension. The base file name preceding the suffix may be shortened if a value for MAXIMUM BASE FILE NAME LENGTH has been specified.

Name collisions between output file names are resolved by modifying the base file names preceding the suffices. Please see the descriptions of MAXIMUM BASE FILE NAME EXTENSION and of OVERWRITE EXISTING FILES for details of the changes made.

INCLUDE files and the BLOCK DATA primary file are not generated unless they are needed. If they are not generated, fpt issues a note advising the user that the file concerned has not been written.

Organisation of the Declarations

Type declarations are written for the Fortran PARAMETERS. The Fortran PARAMETER declarations are written with one PARAMETER declared in each statement. fpt seeks a legal ordering of the declarations, such that when PARAMETERS are defined by expressions involving other PARAMETERS, all values are defined before they are accessed. An error is reported if this is impossible. VMS PARAMETER declarations written without parentheses are converted to standard format as described for the command CHANGE PARAMETER STATEMENTS TO STANDARD FORMAT.

Data type declarations are inserted for statement functions. The statement function declaration statements are transcribed without change (other than in layout) from the original sources.

Type declaration statements are written for all variables in COMMON blocks. Array bound specifications are moved to the type declarations. Array bounds and character size specifications which depend on Fortran PARAMETERS are written with the Fortran PARAMETERS in place, the PARAMETERS are not converted to literal numbers. The COMMON block declarations are written with one variable declared in each statement. EQUIVALENCE statements are written or are constructed to fix each object in the original position in its COMMON block.

DATA statements are transcribed to the BLOCK DATA sub-program without change other than in layout.

Trailing comments which are present in any declaration of an object in the original code are attached to all data type, PARAMETER and COMMON block declaration statements for that object.

New INCLUDE Statements

INCLUDE statements are inserted in the code of all primary output files which require declaration of the Fortran PARAMETERS, statement functions and COMMON blocks. The declarations are written in the same file as the sub-program statements, and existing IMPLICIT, SAVE and INCLUDE statements may be moved in order to make this possible.

Removal of Existing Declarations

Existing declarations are removed if they are superseded by those in the new files. DATA statements may be modified in the situation where a single DATA statement refers both to local variables and to variables in COMMON blocks.

INCLUDE files which no longer contain any statements as a result of these changes are not output by fpt and INCLUDE statements for them are removed.

The BUILD DATA DICTIONARY Command

The commands described here are executed as a subset of the BUILD DATA DICTIONARY command. Messages generated when the MOVE COMMON BLOCKS commands are executed relate to the BUILD DATA DICTIONARY command.

Where to Use this Command

Operating system command line Yes
Configuration file, config.fsp Yes
Specification (fsp) files, *.fsp Yes
Interactively, to FPT> prompt Yes
Interactive command files Yes
Embedded in the Fortran code Yes

Default

COMMON blocks are not moved to INCLUDE files by default.

See Also

BUILD DATA DICTIONARY

CHANGE PARAMETER STATEMENTS TO STANDARD FORMAT

INCLUDE OUTPUT FILE NAME EXTENSION

MAXIMUM BASE FILE NAME LENGTH

OVERWRITE EXISTING FILES

PRIMARY OUTPUT FILE NAME EXTENSION

Copyright ©1995 to 2024 Software Validation Ltd. All rights reserved.