# 7 Execution Control

A program normally executes statements in the order in which they are written. Executable control constructs and statements modify this normal execution by transferring control to another statement in the program, or by selecting blocks (groups) of constructs and statements for execution or repetition.

In Fortran 95/90, control constructs (CASE, DO, and IF) can be named. The name must be a unique identifier in the scoping unit, and must appear on the initial line and terminal line of the construct. On the initial line, the name is separated from the statement keyword by a colon ( : ).

A block can contain any executable Fortran statement except an END statement. You can transfer control out of a block, but you cannot transfer control into another block.

DO loops cannot partially overlap blocks. The DO statement and its terminal statement must appear together in a statement block.

This chapter contains information on the following topics:

- Branch statements (Section 7.1)
- The CALL statement (Section 7.2)
- The CASE construct (Section 7.3)
- The CONTINUE statement (Section 7.4)
- The DO construct (Section 7.5)
- The END statement (Section 7.6)
- The IF construct and statement (Section 7.7)
- The PAUSE statement (Section 7.8)
- The RETURN statement (Section 7.9)
- The STOP statement (Section 7.10)

Previous Page Next Page Table of Contents