# Derived Types in the ISO_FORTRAN_ENV Module

The ISO_FORTRAN_ENV intrinsic module provides the following predefined derived types.

EVENT_TYPE | This is a derived type with private components. It is an extensible type with no type parameters. Each component that is nonallocatable is initialized by default. A scalar variable of type EVENT_TYPE is an event variable. The value of an event variable contains its event count, which is modified by a sequence of EVENT POST and EVENT WAIT statements. A modification to the event count is as if the intrinsic ATOMIC_ADD were executed with a variable that stores the count as its ATOM argument. A coarray that is of type EVENT_TYPE can be referenced or defined during execution of a segment that is unordered relative to the execution of another segment in which that coarray is defined. The event count is an integer of ATOMIC_INT_KIND. The initial value of the event count of a variable of type EVENT_TYPE is zero. A named entity with declared type EVENT_TYPE, or which has a noncoarray potential subobject component with declared type EVENT_TYPE, must be a variable. A component with type EVENT_TYPE must be a data component. A named variable with declared type EVENT_TYPE must be a coarray. A named variable with a noncoarray potential subobject component of type EVENT TYPE must be a coarray. An event variable must not appear in a variable-definition context except as the event-var argument in an EVENT POST or EVENT WAIT statement, as an allocatable object, or as an actual argument in a reference to a procedure with an explicit interface if the corresponding dummy argument has INTENT(INOUT). A variable with a nonpointer subobject of type EVENT_TYPE must not appear in a variable-definition context except as an allocatable object in an ALLOCATE statement without a SOURCE= specifier, as an allocatable object in a DEALLOCATE statement, or as an actual argument in a reference to a procedure with an explicit interface if the corresponding dummy argument has INTENT(INOUT). If EXTENDS appears in a TYPE statement and the type being defined has a potential subobject component of type EVENT_TYPE, its parent type must be EVENT_TYPE or LOCK_TYPE, or have a potential subobject component of type EVENT_TYPE or LOCK_TYPE.
LOCK_TYPE | This is a derived type with private components; none of the components can be allocatable or a pointer. It is an extensible type with no type parameters. It does not have the BIND (C) attribute or type parameters, and is not a sequence type. All components have default initialization. A scalar variable of type LOCK_TYPE is a lock variable. A lock variable can have one of two states: locked or unlocked. The unlocked state is represented by the one value that is the initial value of a LOCK_TYPE variable. The locked state is represented by all other values. The value of a lock variable can be changed with the LOCK and UNLOCK statements. A named variable of type LOCK_TYPE must be a coarray. A named variable with a noncoarray sub-component of type LOCK_TYPE must also be a coarray. A named constant cannot be of type LOCK_TYPE, nor can it have a noncoarrray potential subobject component with a declared type of LOCK_TYPE. If EXTENDS appears in TYPE statement and the type being defined has a potential subobject component of type LOCK_TYPE, its parent type must be EVENT_TYPE or LOCK_TYPE, or have a potential subobject component of type EVENT_TYPE or LOCK_TYPE. A lock variable must not appear in a variable definition context except as the lock-variable in a LOCK or UNLOCK statement, as an allocatable object, or as an actual argument in a reference to a procedure with an explicit interface where the corresponding dummy argument has INTENT (INOUT). A variable with a subobject of type LOCK_TYPE must not appear in a variable definition context except as an allocatable object or as an actual argument in a reference to a procedure with an explicit interface where the corresponding dummy argument has INTENT (INOUT).
TEAM_TYPE | This is an extensible derived type with private components whose values can identify a team of images. It has no type parameters, and the non-allocatable components are initialized by default. The initial values identify no team. A variable of type TEAM_TYPE, or a component of a derived type whose type is TEAM_TYPE is not permitted to be a coarray.

Parent topic: ISO_FORTRAN_ENV Module