.f
’,
‘.ff
’, ‘.for
’ or ‘.ftn
’ are assumed
to be fixed form source files.
All other files (e.g. those with the extension ‘.ff90
’) are
assumed to be free form source files.
These assumptions can be overridden by the -fixed and
-free options.
Tab format lines are recognised in fixed form.
A source file may contain fpp tokens. An fpp token is similar to a Fortran token, and is one of:
#
line-number file-name
#
) as the
first character on a line.
Blank and tab characters may appear after the initial ‘#
’
to indent the directive.
The directives are divided into the following groups:
#define
directive is used to define both simple string
variables and more complicated macros:
#define
name token-string
This is the definition of an fpp variable. Wherever ‘name’ appears in the source lines following the definition, ‘token-string’ will be substituted for it.
#define
name([argname1[,argname2]...]) token-string
This is the definition of a function-like macro. Occurrences of the macro ‘name’ followed by a comma-separated list of arguments within parentheses are substituted by the token string produced from the macro definition. Every occurrence of an argument name from the macro definition's argument list is substituted by the token sequence of the corresponding macro actual argument.
Note that there must be no space or tab between the macro name and the left parenthesis of the argument list in this directive; otherwise, it will be interpreted as a simple macro definition with the left parenthesis treated as the first character of the replacement token-string.
#undef
name
Remove any macro definition for name, whether such a definition was
produced by a -D option, a #define
directive or
by default.
No additional tokens are permitted on the directive line after the name.
The macro NAGFOR is defined by default.
#include "
filename"
#include <
filename>
Read in the contents of filename at this location. The lines read in from the file are processed by fpp as if they were part of the current file.
When the <
filename>
notation is used, filename is only
searched for in the standard “include” directories.
See the -I and -Y options above for more
detail.
No additional tokens are permitted in the directive line after the final
‘"
’ or ‘>
’.
#
line-number
["
filename"
]
Generate line control information for the next pass of the compiler.
The line-number must be an unsigned integer literal constant, and
specifies the line number of the following line.
If "
filename"
does not appear, the current filename is
unchanged.
#if condition_1 block_1 #elif condition_2 block_2 #else block_n #endif
#ifdef name block_1 #elif condition block_2 #else block_n #endif
#ifndef name block_1 #elif condition block_2 #else block_n #endif
The “#else” and “#elif” parts are optional.
There may be more than one “#elif” part.
Each condition is an expression consisting of fpp constants, macros and
macro functions.
Condition expressions are similar to cpp expressions, and may
contain any cpp operations and operands with the exception
of C long, octal and hexadecimal constants.
Additionally, fpp will accept and evaluate the Fortran logical operations
.NOT.
, .AND.
, .OR.
, .EQV.
, .NEQV.
,
the relational operators .GT.
, .LT.
, .LE.
, .GE.
,
and the logical constants .TRUE.
and .FALSE.
.