Intel fortran-80 manual Order of Statements

Models: fortran-80

1 130
Download 130 pages 742 b
Page 12
Image 12
1.2.3 Order of Statements

Introduction To FORTRAN

FORTRAN-SO

1.2.3 Order of Statements

The following order must be observed in coding FORTRAN statements lines:

1.Comment lines can appear before or between statements. They cannot appear after the END statement.

2.The PROGRAM statement can appear only as the first statement of a main program. FUNCTION, SUBROUTINE, and BLOCK DATA can appear only as the first statement of a subprogram (Section 2.1.1).

3.FORMAT statements can appear anywhere before the END statement.

4.IMPLICIT statements must precede all other specification statements.

5.All specification statements (lists 1 and 2 in section 1.2.2) must precede all DATA statements, which must precede all statement function statements, which must precede all executable statements.

6.The last line of a program unit must be the END statement.

The rules for ordering FORTRAN statements are summarized in Figure 1-2.

PROGRAM, FUNCTION, SUBROUTINE, or BLOCK DATA

Statement

 

 

 

IMPLICIT Statements

 

 

 

 

Comment

FORMAT

 

Other Specification

Lines

Statements

 

Statements

 

 

 

 

 

 

 

DAT A Statements

 

 

 

 

 

 

 

Statement Function

 

 

 

Statements

 

 

 

 

 

 

 

Executable Statements

 

 

 

 

 

 

END Statement

 

 

 

Figure 1-2. Order of FORTRAN Statements

 

 

 

 

1-4

Page 12
Image 12
Intel fortran-80 manual Order of Statements