END TEAM statement

Standard: F77 F90 F95 F2003 F2008 F2018 Example program


END TEAM [ ( [ sync-stat [ , sync-stat ] ] ) ] [ construct-name ]

sync-stat ::= STAT = stat-variable | ERRMSG = errmsg-variable
At most one STAT= and ERRMSG= specifier may appear in an END TEAM statement. The stat-variable must be a non-coindexed scalar integer variable (and at least 16 bits), and errmsg-variable must be a scalar default character variable.

The END TEAM statement is the last statement of a CHANGE TEAM construct.


Executing the END TEAM statement implicitly synchronises the images of the team within the construct, which must all execute the same statement. It then restores the current team for those images to the team that was current before the CHANGE TEAM statement was executed.

If the STAT= specifier appears, the stat-variable is assigned the value zero for successful execution, and a positive value if an error occurs. If an error occurs and no STAT= specifier appears, the program is error-terminated.

If both STAT= and ERRMSG= appear and an error occurs, errmsg-variable is assigned an explanatory error message; otherwise, errmsg-variable is unchanged.


CHANGE TEAM statement, ERRMSG= specifier, STAT= specifier