



Statement Types and Order END statement is executable
and so are all those in the lowest right-hand box of the table below; all other
statements are non-executable.
The general order of statements in a program unit is:
PROGRAM, SUBROUTINE, FUNCTION, or BLOCK DATA
statement)
END statement.PARAMETER statements can be intermixed with IMPLICIT statements)
but those in boxes separated vertically must appear in the proper order in
each program unit (thus all statement functions must precede all executable
statements).
| ||||||||||||||||||||||||||||||||||||||||||||||
A program starts by executing the first executable statement of the main program
unit. Execution continues sequentially unless control is transferred elsewhere: an IF
or GO TO statement, for example, may transfer control to another part of the same
program unit, whereas a CALL statement or function reference will transfer control
temporarily to a procedure.
A program continues executing until it reaches a STOP statement in any program
unit, or the END statement of the main program unit, or until a fatal error occurs.
When a program terminates normally (at STOP or END) the Fortran system closes any
files still open before returning control to the operating system. But when a program
is terminated prematurely files, especially output files, may be left with incomplete or
corrupted records.