NAGWare Fortran Tools - f95 Tools - nag_cbm95

 

Index

NAME
DESCRIPTION
OPTIONS
NOTES
SEE ALSO
 

NAME

nag_cbm95 - COMMON block to MODULE converter  

DESCRIPTION

nag_cbm95 is the NAGWare Fortran 95 COMMON block to MODULE converter, and it also optionally expands include files, and copies all necessary PARAMETER definitions to the MODULEs.

If a filename with no extension is provided the tool will look for a file with the extension `.f95', and if that does not exist, for a file with the extension `.f90'.

If a file has the extension `.f90' or `.f95', it will be assumed to contain free format Fortran code. If a file has the extension `.f', `.for', `.f77', or `.ftn', the file is assumed to contain fixed format Fortran code. The options -fixed and -free may be used to override this behaviour.

The input file is backed up to infile.original and the output file replaces the input file.

Modules (and include files) are expected to exist in the current working directory or in a directory named by the -I option, see nag_modules95.

 

OPTIONS

   Main Options

"Analyse only" (-analyse_only)
Analyse the input file(s) but do not produce any output files. This should be used in conjunction with the -listcpus and -listcvars options.

"Expand include files" (-expand_include)
This option tells nag_cbm95 to open, and include the contents of each file INCLUDEd in the analysis, and to place its contents in the output files. The default operation is to leave INCLUDE lines unchanged.

"Common block cross reference by program unit" (-listcpus)
List which program units contain references to which COMMON block (prior to processing). By default, processing will continue, but you can stop the tool at this stage with the -analyse_only option.

"Common block variable cross reference" (-listcvars)
List the variables within each COMMON block, and what operations are performed on them in the program units in which they are declared. By default, processing will continue, but you can stop the tool at this stage with the -analyse_only option.

"Common block MODULEs filename" (-modfile filename)
By default the module file is infile_cb.f90 where infile is the first source file name supplied, or infile_cb.f95 if the first source file has the extension `.f95'. This file is written to the directory specified by the -odir option, or in the current directory.

This option allows you to specify the name of the file to which to write the module containing the interface blocks and takes precedence over the -odir option.

   General Options
"Source format" (-fixed, -free)
Forces the tool to assume fixed or free format for the input file. If "Automatic" is set, .f90 files will be assumed to contain free format code , .f, .for, .f77, or .ftn are assumed to contain fixed format code.

"Include and module directories" (-I)
Add pathname to the list of directories which are to be searched for include files. The current working directory is always searched first, then any directories named in -I options.

"Fixed format source line length" (-132)
Increase the length of each fixed source form input line from 72 characters to 132 characters. This has no effect on free source form input.

"Allow double complex specific intrinsics" (-dcfuns)
Enable recognition of non-standard double precision complex intrinsic functions. These act as specific versions of the standard generic intrinsics as follows:

    Non-standard      Equivalent Fortran 95 Intrinsic
     CDABS(A)            ABS(A)
     DCMPLX(X,Y)         CMPLX(X,Y,KIND=KIND(0d0))
     DCONJG(Z)           CONJG(Z)
     DIMAG(Z)            AIMAG(Z)
     DREAL(Z)            REAL(Z) or DBLE(Z)

"Downgrade legacy code errors to warning" (-dusty)
Allows the analysis of ``legacy'' software by downgrading the category of common errors found in such software from ``Error'' to ``Warning'' (which may then be suppressed entirely with the -w option).

"Suppress information messages" (-info)
Suppress output of tool analysis stages information messages.

"Kind numbers"
"Byte kinds" (-kind=byte)
Alter the kind numbering system used so that the kind numbers for INTEGER, REAL and LOGICAL match the number of bytes of storage (e.g. default REAL is 4 and DOUBLE PRECISION is 8). Note that COMPLEX kind numbers are the same as its REAL components, and thus half of the total byte length in the entity.

"Sequential kinds" (-kind=sequential)
This confirms the default kind numbering system where all datatypes are numbered sequentially from 1 and increase with precision.

This option does not affect the interpretation of byte-length specifiers (an extension to Fortran 77).

"Downgrade argument checks between routines in different files" (-mismatch)
Downgrade consistency checking of procedure argument lists so that mismatches produce warning messages instead of error messages. This only affects calls to a routine which is not in the current file; calls to a routine in the file being compiled must still be correct.

"Downgrade argument checks between routines in the same file" (-mismatch_all)
Further downgrade consistency checking of procedure argument lists so that calls to routines in the same file which are incorrect will produce warnings instead of error messages.

"Continuation line limit" (-maxcontin)
Increase the limit on the number of continuation lines to N. The default, as specified by the Fortran standard, is 19 for fixed source form and 39 for free source form. This will not decrease the limit below the standard number.

"Output strict Fortran 95 obsolescent messages" (-strict95)
Produce obsolescence warning messages for use of ``CHARACTER*'' syntax. This message is not produced by default since most programs contain this syntax.

"Suppress warning messages" (-w=all)
Switch on or off tool analysis stages warning messages.

"Suppress obsolescent feature warning messages" (-w=obs)
Switch on or off warning messages about the use of obsolescent features.

"Suppress unused entity warning messages" (-w=unused)
Suppresses warning messages about unused entities. It is equivalent to -w=uda -w=uei -w=ulv -w=usy.

"Suppress unused dummy argument warning messages" (-w=uda)
Switch on or off warning messages about unused dummy arguments.

"Suppress unused explicit import warning messages" (-w=uei)
Switch on or off warning messages about unused explicit imports.

"Suppress unused local variable warning messages" (-w=ulv)
Switch on or off warning messages about unused local variables.

"Suppress unused symbol warning messages" (-w=usy)
Switch on or off warning messages about unused symbols.

"Suppress Fortran 77 extension warning messages" (-w=x77)
Switch on or off extension warnings for common extensions to FORTRAN 77. These are TAB format, byte-length specifiers and Hollerith constants.

"Suppress Fortran 95 extension warning messages" (-w=x95)
Switch on or off extension warnings for extensions to Fortran 95.

 

NOTES

This tool aims to remove all COMMON blocks from a given input file, placing the variables into MODULEs instead. These MODULEs are then referred to by USE statements which specify the particular variable to reference. As COMMON blocks can be used with the same name in several functions/modules, the tool will rename any alternate names used to specify the same COMMON block variable.

Any INCLUDEd files which appear in the input file are, by default, not expanded. With the -expand_include option these files are expanded and the processing of COMMON blocks inside these files is then done. With this option in use the tool will leave the INCLUDEd files expanded in the output file, even if they do not contain any COMMON blocks.

Any parameter statements/variables which appear in the input file which are used in the definition of variables in COMMON are moved into the module created for COMMON block in which they were used, or if the parameter is used to declare variables in multiple COMMON blocks or is used elsewhere in any program unit, it is moved to a SHARED_CONSTANTS module. If a parameter is only used within one program unit, and is used both in the declaration of a COMMON block variable, and other variables within that program unit, the parameter is copied to the COMMON blocks module, and made PRIVATE.

 

SEE ALSO

nag_polopt95, nag_modules95.

Copyright, Numerical Algorithms Group, Oxford, 1997-2001