FORTRAN PROGRAMMING ENVIRONMENT FEATURES

FPE HOME | Directives | Double Options | Format | Functions | Operators | Options | Recommend | Source | Statements

SOURCE FORMS

! trailing comment
Fortran 90 Available except in column 6 of fixed-form input.
IBM XLF Available except in column 6 of fixed-form input.
CIVIC Available. Alternate form is $$c or $$$ or $$*.
CF77 Available except in column 6 of non-tab formatted line.
CF90 Available except in column 6 of non-tab formatted fixed format line.
DEC F77 Available except in column 6 of non-tab formatted line.
DEC F90 Available except in column 6 of fixed-form input.
PGF77 Available except in column 6
Sun F77 Available except in column 6
Sun F90 Available except in column 6 of fixed-form input.
$ dollar sign character
IBM XLF Can be used in a symbolic name (including as first character)
CIVIC Not allowed in symbolic names. Used for comments and multiple statements per line.
CF77 Not allowed in symbolic names.
CF90 Can be used in a symbolic name (other than first character)
DEC F77 Can be used in a symbolic name (other than first character)
DEC F90 Can be used in a symbolic name (including as first character)
PGF77 Can be used in a symbolic name (including as first character)
Sun F77 Can be used in a symbolic name (other than first character)
Sun F90 Can be used in a symbolic name (other than first character)
& continuation mark
IBM XLF Only available for special continuation mark in free-form input.
CIVIC Not available for a special continuation mark in column 1. Used as the last character on a line to indicate that the next non-comment line is a continuation line.
CF77 Not available for a special continuation mark.
CF90 Only available for special continuation mark in free-form input.
DEC F77 Not available for a special continuation mark.
DEC F90 Only available for special continuation mark in free-form input.
PGF77 & in column 1 indicates continuation line.
Sun F77 & in column 1 indicates continuation line.
Sun F90 In Fixed Form: & in column 1 indicates continuation line
_ underscore character
Fortran 90 Can be used in symbolic names (other than as first character)
IBM XLF Can be used in symbolic names (including as first character)
CIVIC Can be used in symbolic names (including as first character)
CF77 Can be used in symbolic names (other than as first character)
CF90 Can be used in symbolic names (other than as first character)
DEC F77 Can be used in symbolic names (other than as first character)
DEC F90 Can be used in symbolic names (other than as first character)
PGF77 Can be used in symbolic names (including as first character)
Sun F77 Can be used in symbolic names (including as first character)
Sun F90 Can be used in symbolic names (including as first character)
@ at character
CF90 Can be used in symbolic names (other than as first character)
Binary constants forms of base 2 constants
Fortran 90 B'01010' or B"01010" in data statements only.
IBM XLF B'01010' or '01010'B or B"01010" or "01010"B
CF90 B'01010' or B"01010" treated as typeless.
DEC F77 B'01010' or '01010'B or B"01010" or "01010"B
DEC F90 B'01010' or B"01010"
Sun F77 B'01010' or '01010'B in data statements only.
Sun F90 B'01010' or '01010'B anyplace and are treated as typeless.
character constants forms of character (text) constants
Fortran 77 ' delimited.
Fortran 90 Either ' or " delimited.
IBM XLF Either ' or " delimited; length limit is 32,767; C backslash escapes (\n,etc.) accepted unless -qnoescape is used; character constant actual arguments are null terminated if -qnullterm is used; zero length allowed.
IBM XLHPF Either ' or " delimited; length limit is 32,767; C backslash escapes (\n,etc.) accepted unless -qnoescape is used; character constant actual arguments are null terminated if -qnullterm is used; zero length allowed.
CIVIC Either ' or " delimited; length limit is 8191 characters.
CF77 Either ' or " delimited; length limit is 2,097,151 on YMP or 16,384 characters on other machines.
CF90 Either ' or " delimited.
DEC F77 Either ' or " delimited; C backslash escapes (\n,etc.) accepted.
DEC F90 Either ' or " delimited; C backslash escapes (\n,etc.) not normally accepted. If string is followed immediately by C then backslash escapes are accepted and the string is NULL terminated. Length must be in the range 0 to 2000.
PGF77 Either ' or " delimited; C backslash escapes (\n,etc.) accepted.
Sun F77 Either ' or " delimited; length limit is 65,535; C backslash escapes (\n,etc.) accepted; If not in a data statement, then followed by a null; zero length character constants are allowed only as actual arguments.
Sun F90 Either ' or " delimited; length limit is 65,535; C backslash escapes (\n,etc.) accepted; If not in a data statement, then followed by a null.
character set characters available for use in source text
Fortran 77 Always case insensitive except in character strings.
Fortran 90 Always case insensitive except in character strings.
IBM XLF Case sensitive if -U is specified.
CIVIC Always case insensitive except in character strings.
CF77 Case insensitive except in character strings.
CF90 Case insensitive except in character strings.
DEC F77 Case sensitive if -names as_is or -U is used; external names are forced to upper case if -names uppercase is given.
DEC F90 Case sensitive if -names as_is is used; external names are forced to upper case if -names uppercase is given.
PGF77 All (including external names) converted to lower case unless -Mupcase is used.
Sun F77 Case sensitive if -U is specified.
Sun F90 Not case sensitive.
Comment lines lines of non-compiled comments
Fortran 77 Use c C or * in column 1.
IBM XLF Use c C * d D or ! in column 1; (d or D compiled if -qdlines option used)
CIVIC Use c C * ! or $ in column 1.
CF77 Use c C * or ! in column 1.
CF90 Use c C * or ! in column 1 in fixed form.
DEC F77 Use c C * d D or ! in column 1; (d or D compiled if -d_lines option used)
DEC F90 Use c C * d D or ! in column 1; (d or D compiled if -d_lines option used)
PGF77 Use c C * d D or ! in column 1; (d or D compiled if -Mdlines option used)
Sun F77 Use c C * d D or ! in column 1; (d or D compiled if -xld option used)
Sun F90 Use c C * or ! in column 1 in fixed form.
continuation lines continue a statement from a previous line
In fixed form, any character other than a blank or a zero in column 6 indicates a continuation line.
Fortran 90 In free form input, an & at the end of a line indicates that the next non-comment line is a continuation line. If the first character on that continuation line is an & then the statement continues after that &; otherwise it continues with column 1 of the continuation line.
IBM XLF 6700 characters are allowed in a statement, spread out over any number of continuation lines. No tab convention in fixed-form input is provided. Free form input is the same as Fortran 90.
CIVIC A statement label starting before column 6 may include a character in column 6. An & at the end of a line indicates that the next non-comment line is a continuation line.
CF77 Tab in columns 1-5 followed by non-zero digit taken as continuation with digit in column 6. Up to 99 continuation lines allowed.
CF90 Tab in columns 1-5 followed by non-zero digit taken as continuation with digit in column 6 in fixed form. Up to 99 continuation lines allowed in fixed form, 59 in free form.
DEC F77 Tab in columns 1-5 followed by non-zero digit taken as continuation with digit in column 6. Up to 99 continuation lines allowed.
DEC F90 In fixed form, tab in columns 1-5 followed by non-zero digit taken as continuation with digit in column 6. Up to 511 continuation lines allowed.
PGF77 & in column 1 or non-zero digit in column 6 or after initial tab; Up to 99 continuation lines allowed.
Sun F77 & in column 1 or non-zero digit after first tab if initial line starts with tab in 1-6. Up to 99 continuation lines allowed by default-- the -Nlk option can be used to change the number of continuation lines allowed to k.
Sun F90 non-zero digit after first tab if initial line starts with tab in 1-6. Up to 99 continuation lines allowed by default
file names length of file names (per link in path and entire path)
IBM XLF 255 characters in link; 1023 characters in path.
CIVIC 16 characters in link; 255 characters in path on NLTSS 255 characters in link; 1024 characters in path on UNICOS.
CF77 256 characters in link; 1023 characters in path.
CF90 256 characters in link; 1023 characters in path.
Sun F77 512 characters in link; 1024 characters in path.
Sun F90 512 characters in link; 1024 characters in path.
Hexadecimal constants forms of base 16 constants
Allowed representations of the hexadecimal numbers 05AF and -0fAF are shown here:
Fortran 77 Not available.
Fortran 90 Z'05af' or Z"05af" only in data statements.
IBM XLF Z'05af' or Z"05af" or '05af'Z or "05af"Z or X'05af' or X"05af" or '05af'X or "05af"X are allowed in any expression. Z05af is allowed only in data statements.
CIVIC #05af
CF77 X'05af' or X"05af" or X'-05af' or X"-05af"
CF90 X'05af' or X"05af" or X'-05af' or X"-05af" or Z'05af' or Z"05af" allowed anywhere and treated as typeless.
DEC F77 Z'05af' or Z"05af" or '05af'Z or "05af"Z or X'05af' or X"05af" or '05af'X or "05af"X
DEC F90 Z'05af' or Z"05af" or '05af'X or "05af"X
PGF77 z'05af' or Z'05af' or '05af'x or '05af'X (single quotes only; up to 64 bits).
Sun F77 z'05af' or x'05af' or '05af'x or '05af'z
Sun F90 Z'05af' or Z"05af" or x'05af' or x"05af" can be used anywhere and are treated as a typeless. Up to 8 hex digits are allowed.
Hollerith constants forms of Hollerith and related character constants
Allowed representations of the Hollerith constants are shown here (including some forms that give left or right justification and blank or null fill):
Fortran 77 2Hab
Fortran 90 Not available.
IBM XLF 2Hab with a maximum count of 255.
CIVIC 2Hab 2Rab 2Lab
CF77 2Hab 'ab'H "ab"H 2Rab 'ab'R "ab"R 2Lab 'ab'L "ab"L
CF90 2Hab 'ab'H "ab"H 2Rab 'ab'R "ab"R 2Lab 'ab'L "ab"L
DEC F77 2Hab
DEC F90 2Hab with a maximum count of 2000.
PGF77 2Hab can be used as arithmetic constant but not as characer constant; maximum count is 2000.
Sun F77 2Hab
Sun F90 2Hab 'ab'H "ab"H 2Rab 'ab'R "ab"R 2Lab 'ab'L "ab"L A Hollerith constant may have 1 to 4 characters.
integer constants range of integer constants
IBM XLF Allowed range is -2**63 to 2**63-1; the kind is promoted as necessary to be of a kind large enough to contain the constant.
CIVIC Allowed range is -2**63 to 2**63-1.
CF77 Default range is -2**45 to 2**45-1.
CF90 Default range is -2**46 to 2**46-1.
DEC F77 Allowed range is -2**63 to 2**63-1.
DEC F90 Allowed range is -2**63 to 2**63-1 for kind=8.
PGF77 Allowed range is -2147483648 to 2147483647 (-2**31 to 2**31-1 inclusive).
Sun F77 Allowed range is -2147483648 to 2147483647 (-2**31 to 2**31-1 inclusive) unless the -dbl option is set (in which case the range is -2**63 to 2**63-1).
Sun F77 Allowed range is -2147483648 to 2147483647 (-2**31 to 2**31-1 inclusive)
label statement label
A label is one to five digits in columns 1 to 5. At least one digit must be non-zero.
Fortran 90 A label may start in any column if all preceeding columns on the line are blank.
CIVIC Alphanumeric labels are allowed. Label starts in columns 1-5 but may extend beyond column 5. A colon (:) may be used after a label to separate it from the statement.
logical constants forms of logical constants
Fortran 77 .false. and .true.
Fortran 90 .false. and .true.
IBM XLF .false. (0) and .true. (1)
CIVIC .false. (0) and .true. (1)
CF77 .false. (0) and .true. (-1) on XMP/YMP or .t. and .f.
CF90 .false. (0) and .true. (-1) or .t. and .f.
DEC F77 .false. (0) and .true. (-1)
DEC F90 .false. (0) and .true. (-1); can use integers as logicals.
PGF77 .false. (0) and .true. (-1) or any with low-order bit set taken as .true.; can use logicals as integers and integers as logicals; Can use T and F in data statements and in namelist input; with -Munixlogical .true. is 1 and any non-zero is taken as .true.
Sun F77 .false. (0) and .true. (1) or any non-zero taken as .true.; can use logicals as integers and integers as logicals.
Sun F90 .false. and .true.
name lengths number of characters allowed in local and Global variable names.
Fortran 77 Globals: 6 characters -- Locals: 6 characters.
Fortran 90 Globals: 31 characters -- Locals: 31 characters.
IBM XLF Globals: 250 characters -- Locals: 250 characters
CIVIC Globals: 31 characters -- Locals: no limit.
CF77 Globals: 31 characters -- Locals: 31 characters.
CF90 Globals: 31 characters -- Locals: 31 characters.
DEC F77 Globals: 31 characters -- Locals: 31 characters.
DEC F90 Globals: 31 characters -- Locals: 31 characters.
PGF77 Globals: 31 characters -- Locals: 31 characters (beyond 31 allowed but ignored).
Sun F77 Globals: 32 characters -- Locals: 32 characters.
Sun F90 Globals: 32 characters -- Locals: 32 characters.
Octal constants forms of base 8 constants
  Allowed representations of the octal number 1357 are shown here:
Fortran 77 Not available.
Fortran 90 O'1357' or O"1357" only in data statements.
IBM XLF O'1357' or O"1357" or '1357'O or "1357"O (either upper or lower case O; up to 64 bits).
CIVIC 1357B
CF77 1357B or O'1357' or O"1357" treated as integers.
CF90 1357B or O'1357' or O"1357" treated as typeless.
DEC F77 O'1357' or O"1357" or '1357'O or "1357"O (which are typeless) or "1357 (which is typed integer)
DEC F90 O'1357' or O"1357" or '1357'O or "1357"O
PGF77 o'1357' or '1357'O (either upper or lower case O; single quotes only; up to 64 bits).
Sun F77 o'1357' or '1357'O
"1357 is octal representation of integer.
Sun F90 1357B or O'1357' or O"1357" treated as typeless. Up to 11 octal digits are allowed.
source line format formatting of valid source file lines
Fortran 77 Labels only in columns 1 to 5;
Always 72 colums (with possible comments starting in column 73);
Column 6 continuation only;
C or * in column 1 for comment;
No multiple statements per line or trailing comments.
Fortran 90 In Fixed Form, F77 plus:
Trailing comments with !
Multiple statements per line with ; seperator.

In Free Form:
Each line is up to 132 characters long;
Blanks are significant;
Trailing comments with !
Multiple statements per line with ; seperator;
Label must be followed by blank (and still maximum of 5 digits);
Continuation by putting & at end of line to continue (and also possibly at start of next line).

IBM XLF In Fixed Form, F77 plus:
Trailing comments with ! (except in column 6);
Multiple statements per line with ; seperator;
Tab in columns 1 to 6 means that column 7 follows tab--label can't follow tab;
Any character in column 6 (including ! or ;) other than zero or blank indicates continuation.

In Free Form,
Same as Fortran 90 except that any number of columns are allowed on a line.

In IBM Free Form: Comment is " (double quote) in column 1 or ! in any column;
Blanks are not significant;
- (minus sign) at end of a line (or before trailing comment) means next line is a continuation line (although there is no indication on the continuation line itself). Maximum statement length is 6700 characters.

CIVIC Label may go beyond column 5;
Number of columns is settable on execute line;
Continuation can be by & at end of line to be continued;
$ in column 1 may be used for commend;
Multiple statements per line by using $ (but not ; )
Trailing comments with ! or $$c, etc.
CF77 Same as F77 except as follows:
Tab in columns 1 to 5 followed by non-zero digit is continuation;
Tab in columns 1 to 5 followed by letter is initial line;
Trailing comments with ! Number of columns may be increased to 80 with -N80 option.
CF90 Same as F90 except as follows in fixed form:
Tab in columns 1 to 5 followed by non-zero digit is continuation;
Tab in columns 1 to 5 followed by letter is initial line;
Trailing comments with ! Number of columns may be increased with -N80 or -N132 option.
DEC F77 Same as F77 except as follows:
Tab in columns 1 to 5 followed by non-zero digit is continuation;
Tab in columns 1 to 5 followed by letter is initial line;
Trailing comments with !
DEC F90 In Fixed Form, F77 plus:
Trailing comments with ! (except in column 6);
Multiple statements per line with ; seperator;
Tab in columns 1 to 6 means that column 7 follows tab--label can't follow tab;
Up to 511 continuation lines are allowed. Any character in column 6 (including ! or ;) other than zero or blank indicates continuation.

In Free Form, F90 plus:
Up to 511 continuation lines are allowed.

PGF77 Same as F77 except as follows:
Tab in columns 1 to 5 followed by non-zero digit is continuation;
Tab in columns 1 to 5 followed by letter is initial line;
Trailing comments with !
Sun F77 Same as F77 except as follows:
Tab in columns 1 to 5 followed by non-zero digit is continuation;
Tab in columns 1 to 5 followed by letter is initial line;
Trailing comments with !.
Sun F90 In Fixed Form, F77 plus:
Tab in columns 1 to 5 followed by non-zero digit is continuation;
Tab in columns 1 to 5 followed by letter is initial line;
Trailing comments with !. Up to 99 continuation lines are allowed.
In Free Form: Up to 99 continuation lines are allowed.

For the format of namelist input and output, please refer to the NAMELIST Statement