NAGWare Fortran Tools - f95 Tools - nag_modules95

 

Index

NAME
DESCRIPTION
MODULES
MODULE BUILDING USING THE NAGWare f95 COMPILER
MODULE BUILDING USING nag_modules95
THE -I OPTION
KEEPING MODULE FILES UP TO DATE
OPTIONS
SEE ALSO

 

NAME

nag_modules95 - Module builder

 

DESCRIPTION

If your Fortran code contains USE statements for modules that are contained in a separate file, please read this document for information on how to pre-compile the modules that the NAGWare f95 Tools nag_cbm95, nag_coverage95, nag_decs95, nag_fcalls95, nag_mkintf95, nag_prest95, nag_struct95, nag_ustan95 and nag_xref95 require.

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.

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

 

MODULES

The NAGWare f95 Parser, which is part of nag_cbm95, nag_coverage95, nag_decs95, nag_fcalls95, nag_mkintf95, nag_prest95, nag_struct95, nag_ustan95 and nag_xref95, requires to read pre-compiled module files (``.mod'' files) for any modules that are USEd but are not previously defined in the current file. These files are the same files that the NAGWare f95 Compiler produces and reads.

There are two ways to create these pre-compiled module files.

1. Using the NAGWare f95 Compiler.

2. Using nag_modules95.

Modules not previously defined in the file being processed by the NAGWare compiler or nag_modules95 must exist. So files must be processed in the correct order: to ensure this, see nag_depend95.

 

MODULE BUILDING USING THE NAGWare f95 COMPILER

If you have compiled your Fortran 95 source code with the NAGWare f95 Compiler, the ``.mod'' files that were created by the compiler are those required by the Tools. If you only want to create the ``.mod'' files for the Fortran 95 source file example.f90, the simplest command is:


  f95 -M example.f90

The ``-M'' option will stop the compiler after module files have been output. Any successful compile command will create these ``.mod'' files, or the directory specified by -mdir.

Module files have the same name as the MODULE with the extension ``.mod'' appended, and replace any existing file with the same name in the current directory, or the directory specified by -mdir.

 

MODULE BUILDING USING nag_modules95

If you do not have access to the NAGWare f95 Compiler, nag_modules95 may be used to build module files. These are incompatible with module files produced by other compilers, and should be kept separate.

Module files have the same name as the MODULE with the extension ``.mod'' appended, and replace any existing file with the same name in the current directory or in a directory specified using the ``-mdir'' option.

 

THE -I OPTION

nag_cbm95, nag_coverage95, nag_decs95, nag_fcalls95, nag_mkintf95, nag_modules95, nag_prest95, nag_struct95, nag_ustan95, and nag_xref95 and the NAGWare f95 Compiler allow you to specify other directories to search for ``.mod'' files using the -I option. These tools need to be able to read ``.mod'' files for any modules USEd that are not previously defined in the input file.

 

KEEPING MODULE FILES UP TO DATE

If, for example, you modify the precision of a file containing modules, with nag_prest95, don't forget to regenerate the modules before doing further tool processing or compilation.

The Tools will warn you if the ``.mod'' file is out of date with respect to its source file.

 

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.

 

SEE ALSO

nag_depend95.

Copyright, Numerical Algorithms Group, Oxford, 1997-2001