8.280 TEAM_NUMBER — Retrieve team id of given team

Synopsis:
RESULT = TEAM_NUMBER([TEAM])
Description:

Returns the team id for the given TEAM as assigned by FORM TEAM. If TEAM is absent, returns the team number of the current team.

Class:

Transformational function

Arguments:
TEAM(optional, intent(in)) The handle of the team for which the number, aka id, is desired.
Return value:

Default integer. The id as given in a call FORM TEAM. Applying TEAM_NUMBER to the initial team will result in -1 to be returned. Returns the id of the current team, if TEAM is null.

Example:
use, intrinsic :: iso_fortran_env
type(team_type) :: t

print *, team_number() ! -1
form team (99, t)
print *, team_number(t) ! 99
Standard:

Fortran 2018 and later.

See also:

GET_TEAM — Get the handle of a team,
TEAM_NUMBER — Retrieve team id of given team