A newer version of this document is available. Customers should click here to go to the newest version.
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 |
---|---|
Allocates a coarray. |
|
Identifies a block of code. It can contain declarations of entities that are local to the block. |
|
Transfers control to a subroutine. |
|
Relocates a coarray in memory. |
|
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. |
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. |
Often used as the target of GOTO or as the terminal statement in a DO loop; performs no operation. |
|
Begins a critical construct. Only one image can execute the block of statements in the construct at a time. |
|
Advances control to the end statement of a DO loop; the intervening loop statements are not executed. |
|
Deallocates a coarray. |
|
Marks the beginning of a loop construct. Statements through and including the ending statement may be executed repeatedly. |
|
Marks the beginning of a DO CONCURRENT construct. The order of executions of iterations of a DO CONCURRENT construct are indeterminate. |
|
Evaluates statements in the DO WHILE loop, through and including the ending statement, until a logical condition becomes .FALSE.. |
|
Marks an optional branch in an IF construct. |
|
Marks an optional branch in an IF construct. |
|
Marks an optional branch in a WHERE construct. |
|
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. |
Terminates a block construct. |
|
Terminates a critical construct. |
|
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. |
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. |
Initiates error termination for all images. |
|
Increments the count of an event variable by one. |
|
Tells the image executing this statement to wait until an event has been posted and to decrement the count of the event variable. |
|
Terminates execution of a DO loop or other construct. Execution continues with the first statement that follows the construct. |
|
Causes the image that executes it to execute no more statements and stop participating in program execution. |
|
Indicates a loop construct where the output from one iteration cannot change the input to another. |
|
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. |
|
Transfers control to a specified part of the program. |
|
Controls conditional execution of other statements. |
|
Acquires a LOCK_TYPE variable, preventing other images from acquiring it until it has been unlocked by the image that locked it. |
|
Suspends program execution and, optionally, executes operating-system commands. |
|
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. |
|
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. |
|
Returns control to the program unit that called a subroutine or function. |
|
Transfers program control to a block of statements, determined by the value of an expression. |
|
Transfers the program to a block of statements, determined by the rank of an assumed rank array. |
|
Transfers the program to a block of statements, determined by the dynamic type of an expression. |
|
Initiates normal termination for the image that executes the statement. |
|
Synchronizes all of the images of the current team. |
|
Synchronizes an image with all of the specified images in the image set. |
|
Ends a segment and begins another; the two segments may be ordered in a user defined manner with respects to segments on other images. |
|
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. |
Unlocks a variable of type LOCK_TYPE. |
|
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. |