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.
The control constructs ASSOCIATE, CASE, DO, IF, and SELECT TYPE contain blocks and 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.
The following are execution control statements or constructs:
ASSOCIATE construct
Creates a temporary association between a named entity and a variable or the value of an expression. The association lasts for the duration of the block.
CALL statement
Transfers control to a subroutine subprogram.
CASE construct
Conditionally executes one block of constructs or statements depending on the value of a scalar expression in a SELECT CASE statement.
CONTINUE statement
Primarily used to terminate a labeled DO construct when the construct would otherwise end improperly with either a GO TO, arithmetic IF, or other prohibited control statement.
CRITICAL construct
Limits execution of a block to one image at a time.
DO construct
Controls the repeated execution of a block of statements or constructs. The following statements are used in DO constructs:
DO CONCURRENT statement
Specifies that there are no data dependencies between the iterations of a DO loop.
DO WHILE statement
Executes the range of a DO construct while a specified condition remains true.
CYCLE statement
Interrupts the current execution cycle of the innermost (or named) DO construct.
EXIT statement
Terminates execution of a DO construct
END statement
Marks the end of a program unit.
The IF construct conditionally executes one block of statements or constructs. The IF statement conditionally executes one statement. The decision to transfer control or to execute the statement or block is based on the evaluation of a logical expression within the IF statement or construct.
PAUSE statement
Temporarily suspends program execution until the user or system resumes execution.
These statements are deleted features in Fortran 95. Intel® Fortran fully supports features deleted in Fortran 95.
RETURN statement
Transfers control from a subprogram to the calling program unit.
SELECT TYPE construct
Selects for execution at most one of its constituent blocks based on the dynamic type of an expression specified.
STOP and ERROR STOP statement
The STOP statement terminates program execution before the end of the program unit. The ERROR STOP statement initiates error termination of execution.
Copyright © 1996-2011, Intel Corporation. All rights reserved.