SYNC TEAM statement

Standard: F77 F90 F95 F2003 F2008 F2018 Example program


<Syntax>

SYNC TEAM ( team-value [ , sync-stat ]... ) ]
sync-stat ::= STAT = stat-variable | ERRMSG = errmsg-variable

team-value ::= scalar-expression
The team-value must be of type TEAM_TYPE from the intrinsic module ISO_FORTRAN_ENV. A stat-variable must be a non-coindexed scalar Integer variable, and should be able to represent values from −9999 to +9999. An errmsg-variable must be a non-coindexed scalar Character variable with default kind.

<Semantics>

In multiple image execution of a coarray program, execution of a SYNC TEAM statement synchronises with corresponding SYNC TEAM statement executions on other images in the same team; the segment following the nth execution of a SYNC TEAM statement on one image in the specified team follows all the segments that preceded the nth execution of a SYNC TEAM statement on every other image in that team.

The team-value must identify the current team or an ancestor of the current team.

If the STAT= clause is present, zero is assigned to the stat-variable if no error occurs, and a positive value if an error occurs. If the ERRMSG= clause is present and an error occurs, the errmsg-variable is assigned an explanatory message; it remains unchanged if no error occurs.

<Related>

ERRMSG= specifier, Image control statements, STAT= specifier, SYNC ALL statement, SYNC IMAGES statement