HP Fortran Programmer's Reference (September 2007)

Language elements
Statements
Chapter 246
Statements
All HP Fortran statements are fully described in alphabetical order in Chapter 10, “HP
Fortran Statements.”
The required order for statements in a standard Fortran 90 program unit is illustrated in
Table 2-2. Vertical lines separate statements that can be interspersed, and horizontal lines
separate statements that cannot be interspersed. For example, the DATA statement can
appear among executable statements but may not be interspersed with CONTAIN statements.
Also, the USE statement, if present, must immediately follow the program unit heading.
Table 2-2 does not show where comments, the INCLUDE line, and directives may appear.
Comments may appear anywhere in a source file, including after the END statement. The
INCLUDE line may appear anywhere before the END PROGRAM statement.
Table 2-2 Statement order in a program unit
PROGRAM, FUNCTION, SUBROUTINE, MODULE, or BLOCK DATA statement
USE statement
IMPLICIT NONE statement
PARAMETER statement IMPLICIT statement
FORMAT Derived-type definitions,
and PARAMETER and Interface blocks,
ENTRY DATA statements Type declarations,
statements Statement functions, and
Specification statements
DATA statements Executable constructs
CONTAINS statement
Internal subprograms or module subprograms
END statement