Compiler directives

FTN95 will successfully process simple programs which contain only Fortran source statements. Such usage of the compiler implies that, for many options such as run-time diagnostics, either the system default will operate or a FTN95 compiler option must be used to change this default for the whole program source. Clearly, in the case of large or complex programs, this is not satisfactory. FTN95 therefore provides a number of compiler directives (described below) which can be used to give fine control over the facilities that are available. Compiler directives can also be embedded within comments.

The following table provides a list of compiler directives that can be inserted into the FTN95 source code.

Directives

Purpose

OPTIONS

To specify one or more compiler options in a source file

INCLUDE '<pathname>'

To insert the contents of the specified file at the current point in the compilation. Useful for frequently used common blocks etc. (this is included in the draft Fortran 95 standard).

LIBRARY '<pathname>'

Used with /LINK and /LGO to access a specified library.

IMPLICIT NONE

Forces the programmer to give every variable an explicit type (this is included in the Fortran 90 standard).

CODE & EDOC

To start and terminate a 32-bit assembler sequence. These directives are only allowed if an /ISO compiler option has not been selected

WINAPP

Creates a Windows executable for use with ClearWin+ (see the ClearWin+ documentation for further information).

 

The following notes apply to all compiler directives:

  • In fixed format files, each directive must start in column 7 or beyond.

  • Unless otherwise stated, a compiler directive may appear anywhere in a source program.

  • For fixed format Fortran, spaces have no significance except in file names which appear as character constants within quotation marks.

  • Compiler directives other than CODE and EDOC must not be la belled. (CODE and EDOC can be treated as executable statements should this be desired.)

 

 

Basket
Empty
 
Copyright © 1999-2024 Silverfrost Limited