This chapter describes the various types of Fortran statements.
Fortran statements can be grouped into five categories. They are
There are restrictions on where a given statement can appear in a program unit or subprogram. In general,
The following table summarizes statement order rules. Vertical lines separate statements that can be interspersed. Horizontal lines separate statements that cannot be interspersed.
Statement Order |
||
|---|---|---|
|
PROGRAM, FUNCTION, SUBROUTINE, MODULE, or BLOCK DATA statement |
||
|
USE statements |
||
|
FORMAT and ENTRY statements |
IMPLICIT NONE |
|
|
PARAMETER statements |
IMPLICIT statements |
|
|
PARAMETER and DATA statements |
Derived-type definitions, interface blocks, type declaration statements, statement function statements, and specification statements |
|
|
DATA statements |
Executable statements |
|
|
CONTAINS statement |
||
|
Internal subprograms or module subprograms |
||
|
END statement |
||
Statements are restricted in what scoping unit they may appear, as follows: