Comment and Noncomment Form Directives

XL Fortran directives belong to one of two groups: comment form directives and noncomment form directives.

Comment Form Directives

This section provides a detailed description of the following comment form directives:

COLLAPSE SNAPSHOT
SOURCEFORM SUBSCRIPTORDER

Additional comment form directives included in this section can be found in Directives and Optimization.

Format



>>-trigger_head--trigger_constant--directive-------------------><
 
 

trigger_head
is one of !, *, C, or c for fixed source form and ! for free source form.

trigger_constant
is IBM* by default. If you specify the -qsmp compiler option, IBM*, IBMT, SMP$, $OMP, and IBMP are recognized by default. Specifying the -qdirective compiler option will allow you to define other trigger constants.

Rules

The default value for the trigger_constant is IBM*.

By default if you use the -qsmp compiler option in conjunction with one of these invocation commands, the option -qdirective=IBM*:SMP$:$OMP:IBMP:IBMT will be on. If you specify the -qsmp=omp option this will be as if you set the option -qdirective=$OMP on by default. You can specify an alternate or additional trigger_constant with the -qdirective compiler option. See the -qdirective compiler option in the XL Fortran User's Guide for more details.

The compiler treats all comment form directives, with the exception of those using the default trigger_constant as comments, unless you define the appropriate trigger_constant using the -qdirective compiler option. As a result, code containing these directives is portable to non-SMP environments.

XL Fortran supports the OpenMP specification, as understood and interpreted by IBM(R). To ensure the greatest portability of code, we recommend that you use these directives whenever possible. You should use them with the OpenMP trigger_constant, $OMP; but you should not use this trigger_constant with any other directive.

XL Fortran also includes the trigger_constants IBMP and IBMT. The compiler recognizes IBMP if you compile using the -qsmp compiler option. You should use IBMP with the SCHEDULE directive, and IBM extensions to OpenMP directives. The compiler recognizes IBMT if you compile using the -qthreaded compiler option. IBMT is the default for the xlf_r, xlf90_r, or xlf95_r invocation commands; we recommend its use with the THREADLOCAL directive.

XLF directives include directives that are common to other vendors. If you use these directives in your code, you can enable whichever trigger_constant that vendor has selected. Specifying the trigger constant by using the -qdirective compiler option will enable the trigger_constant the vendor has selected. Refer to the -qdirective compiler option in the XL Fortran User's Guide for details on specifying alternative trigger_constants.

The trigger_head follows the rules of comment lines either in Fortran 90 free source form or fixed source form. If the trigger_head is !, it does not have to be in column 1. There must be no blanks between the trigger_head and the trigger_constant.

You can specify the directive_trigger (defined as the trigger_head combined with the trigger_constant, !IBM* for example) and any directive keywords in uppercase, lowercase, or mixed case.

You can specify inline comments on directive lines.

!IBM* INDEPENDENT,
NEW(i)    !This is a comment

A directive cannot follow another statement or another directive on the same line.

All comment form directives can be continued. You cannot embed a directive within a continued statement, nor can you embed a statement within a continued directive.

You must specify the directive_trigger on all continuation lines. However, the directive_trigger on a continuation line need not be identical to the directive_trigger that is used in the continued line. For example:

!IBM* INDEPENDENT &
!TRIGGER&  , REDUCTION (X)                    &
!IBM*&  , NEW (I)

The above is equivalent to:

!IBM* INDEPENDENT,
REDUCTION (X), NEW (I)

provided both IBM* and TRIGGER are active trigger_constants.

For more information, see Lines and Source Formats.

You can specify a directive as a free source form or fixed source form comment, depending on the current source form.

Fixed Source Form Rules

If the trigger_head is one of C, c, or *, it must be in column 1.

The maximum length of the trigger_constant in fixed source form is 4 for directives that are continued on one or more lines. This rule applies to the continued lines only, not to the initial line. Otherwise, the maximum length of the trigger_constant is 15. We recommend that initial line triggers have a maximum length of 4. The maximum allowable length of 15 is permitted for the purposes of backwards compatibility.

If the trigger_constant has a length of 4 or less, the first line of a comment directive must have either white space or a zero in column 6. Otherwise, the character in column 6 is part of the trigger_constant.

The directive_trigger of a continuation line of a comment directive must appear in columns 1-5. Column 6 of a continuation line must have a character that is neither white space nor a zero.

For more information, see Fixed Source Form.

Free Source Form Rules

The maximum length of the trigger_constant is 15.

An ampersand (&) at the end of a line indicates that the directive will continue. When you continue a directive line, a directive_trigger must appear at the beginning of all continuation lines. If you are beginning a continuation line with an ampersand, the directive_trigger must precede the ampersand. For example:

!IBM* INDEPENDENT &
!IBM*&  , REDUCTION (X)           &
!IBM*&  , NEW (I)

For more information, see Free Source Form.

Noncomment Form Directives

This section provides a detailed description of the following noncomment form directives:

EJECT INCLUDE
#LINE @PROCESS

Format



>>-directive---------------------------------------------------><
 
 

Rules

The compiler always recognizes noncomment form directives.

Noncomment form directives cannot be continued.

Additional statements cannot be included on the same line as a directive.

Source format rules concerning white space apply to directive lines. IBM Copyright 2003