Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 6/24/2024
Public
Document Table of Contents

Program Control Statements

The following table lists statements that affect program control.

Unless identified as an image control statement, the statement affects execution on a single image. With the exception of STOP, ERROR STOP, and END PROGRAM, image control statements are used with coarrays; they involve synchronization of images and they divide the program into segments.

Name

Description

ALLOCATE1

Allocates a coarray.

BLOCK2

Identifies a block of code. It can contain declarations of entities that are local to the block.

CALL

Transfers control to a subroutine.

CALL MOVE_ALLOC1

Relocates a coarray in memory.

CASE

Within a SELECT CASE construct, marks a block of statements that are executed if an associated value matches the SELECT CASE expression.

CASE DEFAULT or CLASS DEFAULT

Identifies the block of statements to be executed in a SELECT CASE construct if the value of the expression does not match any of the CASE selectors, or in a SELECT TYPE construct if the dynamic type of the selector does not match the type of any of the TYPE IS or CLASS IS statements.

CHANGE TEAM3

Causes images of the current team to begin execution on sibling (sub) teams as specified by a team variable created by a FORM_TEAM statement previous executed by the team encountering the CHANGE_TEAM statement.

CLASS IS

Within a SELECT TYPE construct, marks a block of statements that are executed if the type or dynamic type of an expression matches the type of the CLASS IS expression.

CONTINUE

Often used as the target of GOTO or as the terminal statement in a DO loop; performs no operation.

CRITICAL3

Begins a critical construct. Only one image can execute the block of statements in the construct at a time.

CYCLE

Advances control to the end statement of a DO loop; the intervening loop statements are not executed.

DEALLOCATE1

Deallocates a coarray.

DO

Marks the beginning of a loop construct. Statements through and including the ending statement may be executed repeatedly.

DO CONCURRENT

Marks the beginning of a DO CONCURRENT construct. The order of executions of iterations of a DO CONCURRENT construct are indeterminate.

DO WHILE

Evaluates statements in the DO WHILE loop, through and including the ending statement, until a logical condition becomes .FALSE..

ELSE

Marks an optional branch in an IF construct.

ELSE IF

Marks an optional branch in an IF construct.

ELSEWHERE

Marks an optional branch in a WHERE construct.

END [PROGRAM]3

Marks the end the main program. When executed, it initiates normal termination for the image that executes it.

END [FUNCTION] | [MODULE] | [SUBROUTINE]4

Marks the end of a program unit.

END BLOCK4

Terminates a block construct.

END CRITICAL3

Terminates a critical construct.

END DO

Marks the end of a series of statements in a DO, DO CONCURRENT, or DO WHILE construct.

END FORALL

Marks the end of a series of statements following a block FORALL statement.

END IF

Marks the end of a series of statements following a block IF statement.

END SELECT

Marks the end of a SELECT CASE, SELECT RANK, or SELECT TYPE statement.

END TEAM3

Changes the current team to the parent team of the team of images that executes the END TEAM statement.

END WHERE

Marks the end of a series of statements following a block WHERE statement.

ERROR STOP

Initiates error termination for all images.

EVENT POST3

Increments the count of an event variable by one.

EVENT WAIT3

Tells the image executing this statement to wait until an event has been posted and to decrement the count of the event variable.

EXIT

Terminates execution of a DO loop or other construct. Execution continues with the first statement that follows the construct.

FAIL_IMAGE

Causes the image that executes it to execute no more statements and stop participating in program execution.

FORALL

Indicates a loop construct where the output from one iteration cannot change the input to another.

FORM TEAM3

Creates one or more subteams of the images in the current team and assigns a value describing the teams to a variable of type TEAM_TYPE, which is defined in the intrinsic module ISO_FORTRAN_ENV.

GOTO

Transfers control to a specified part of the program.

IF

Controls conditional execution of other statements.

LOCK3

Acquires a LOCK_TYPE variable, preventing other images from acquiring it until it has been unlocked by the image that locked it.

PAUSE

Suspends program execution and, optionally, executes operating-system commands.

RANK

Within a SELECT RANK construct, marks a block of statements that are executed if the rank of an assumed rank array matches the RANK selector.

RANK DEFAULT

Identifies the block of statements to be executed in a SELECT RANK construct if the rank of the array does not match any of the RANK selectors.

RETURN4

Returns control to the program unit that called a subroutine or function.

SELECT CASE

Transfers program control to a block of statements, determined by the value of an expression.

SELECT RANK

Transfers the program to a block of statements, determined by the rank of an assumed rank array.

SELECT TYPE

Transfers the program to a block of statements, determined by the dynamic type of an expression.

STOP

Initiates normal termination for the image that executes the statement.

SYNC ALL3

Synchronizes all of the images of the current team.

SYNC IMAGES3

Synchronizes an image with all of the specified images in the image set.

SYNC MEMORY3

Ends a segment and begins another; the two segments may be ordered in a user defined manner with respects to segments on other images.

SYNC TEAM3

Synchronizes all images on a specified team.

TYPE IS

Within a SELECT TYPE construct, marks a block of statements that are executed if the type or dynamic type of an expression matches the type of the TYPE IS expression.

UNLOCK3

Unlocks a variable of type LOCK_TYPE.

WHERE

Controls conditional execution of array assignments and elemental function calls.

1 This is an image control statement only if it involves a coarray; otherwise, it's not a program control statement.

2 This is an image control statement only if the block declares a non-allocatable, non-SAVEd coarray.

3 This is an image control statement

4 This is an image control statement only if it involves implicit deallocation of a coarray.