Visible to Intel only — GUID: GUID-A81B0EEC-1E2E-45B0-9F4F-773C002A7484
Visible to Intel only — GUID: GUID-A81B0EEC-1E2E-45B0-9F4F-773C002A7484
Free Source Form
In free source form, statements are not limited to specific positions on a source line. In Standard Fortran, a free form source line can contain from 0 to 10,000 characters.
Blank characters are significant in free source form. The following are rules for blank characters:
Blank characters must not appear in lexical tokens, except within a character context. For example, there can be no blanks between the exponentiation operator **. Blank characters can be used freely between lexical tokensIntel® Fortran allows the line to be of any length. to improve legibility.
Blank characters must be used to separate names, constants, or labels from adjacent keywords, names, constants, or labels. For example, consider the following statements:
INTEGER NUM GO TO 40 20 DO K=1,8
The blanks are required after INTEGER, TO, 20, and DO.
Some adjacent keywords must have one or more blank characters between them. Others do not require any; for example, BLOCK DATA can also be spelled BLOCKDATA. The following list shows which keywords have optional or required blanks:
Optional Blanks
Required Blanks
BLOCK DATA
ABSTRACT INTERFACE
DOUBLE COMPLEX
CASE DEFAULT
DOUBLE PRECISION
CHANGE TEAM
ELSE IF
CLASS DEFAULT
ELSE WHERE
CLASS IS
END ASSOCIATE
DO CONCURRENT
END BLOCK
DO WHILE
END BLOCK DATA
ERROR STOP
END CRITICAL
EVENT POST
END DO
EVENT WAIT
END ENUM
FAIL IMAGE
END FILE
FORM TEAM
END FORALL
IMPLICIT type-specifier
END FUNCTION
IMPLICIT NONE
END IF
INTERFACE ASSIGNMENT
END INTERFACE
INTERFACE OPERATOR
END MODULE
MODULE PROCEDURE
END PROCEDURE
prefix1 [prefix …] FUNCTION
END PROGRAM
prefix1 [prefix …] type-specifier [prefix...] FUNCTION
END SELECT
prefix1 [prefix …] SUBROUTINE
END SUBMODULE
SYNC ALL
END SUBROUTINE
SYNC IMAGES
END TEAM
SYNC MEMORY
END TYPE
SYNC TEAM
END WHERE
type-specifier FUNCTION
GO TO
type-specifier prefix1 [prefix …] FUNCTION
IN OUT
SELECT CASE
SELECT TYPE
1prefix is ELEMENTAL or IMPURE or MODULE or NON_RECURSIVE or PURE or RECURSIVE. No prefix can be specified more than once. You cannot specify both IMPURE and PURE. You cannot specify both NON_RECURSIVE and RECURSIVE.
For information on statement separators (;) in all forms, see Source Forms.
Comment Indicator
In free source form, the exclamation point character (!) indicates a comment if it is within a source line, or a comment line if it is the first character in a source line.
Continuation Indicator
In free source form, the ampersand character (&) indicates a continuation line (unless it appears in a Hollerith or character constant, or within a comment). The continuation line is the first noncomment line following the ampersand. A comment line cannot be continued, but a comment can appear in a continuation line.
A line cannot contain a single "&" as the only non-blank character or as the only non-blank character before an "!" that begins a comment. The Fortran Standard limits a statement to a total of 1,000,000 characters, but it does not limit the number of continuation lines.
The following shows a continued statement:
TCOSH(Y) = EXP(Y) + & ! The initial statement line
EXP(-Y) ! A continuation line
If the first nonblank character on the next noncomment line is an ampersand, the statement continues at the character following the ampersand. For example, the preceding example can be written as follows:
TCOSH(Y) = EXP(Y) + &
& EXP(-Y)
If a lexical token must be continued, the first nonblank character on the next noncomment line must be an ampersand followed immediately by the rest of the token. For example:
TCOSH(Y) = EXP(Y) + EX&
&P(-Y)
If you continue a character constant, an ampersand must be the first non-blank character of the continued line; the statement continues with the next character following the ampersand. For example:
ADVERTISER = "Davis, O'Brien, Chalmers & Peter&
&son"
ARCHITECT = "O'Connor, Emerson, and Dickinson&
& Associates"
If the ampersand is omitted on the continued line, the statement continues with the first non-blank character in the continued line. So, in the preceding example, the whitespace before "Associates" would be ignored.
The ampersand cannot be the only nonblank character in a line, or the only nonblank character before a comment; an ampersand in a comment is ignored.