STAT= specifier

Standard: F77 F90 F95 F2003 F2008 F2018 Example program


STAT = variable

The variable must be a scalar Integer. It should be able to support values from −9999 to +9999, i.e. it should be at least 16 bits.

The STAT= specifier is allowed in ALLOCATE and DEALLOCATE statements, the image control statements CHANGE TEAM, END TYPE, LOCK, SYNC ALL, SYNC IMAGES, SYNC MEMORY and UNLOCK, and in image selectors. A STAT= variable in an image control statement or image selector is not allowed to be a coindexed object.


The STAT= specifier in ALLOCATE or DEALLOCATE sets its variable to the status of the allocation or deallocation. If all allocations or deallocations succeed, the variable will be set to zero. If any allocation or deallocation fails, the variable will be set to an error code. These error codes for STAT= may be found in the F90_STAT module.

The STAT= specifier in an image control statement sets the variable to zero if the operation was successful, and to an error code otherwise.

The STAT= specifier in an image selector sets the variable to STAT_FAILED_IMAGE (from ISO_FORTRAN_ENV) if the image selected is a failed image, and to zero otherwise.


ALLOCATE statement, CHANGE TEAM statement, DEALLOCATE statement, END TEAM statement, ERRMSG= specifier, EVENT POST statement, EVENT WAIT statement, Image selectors, LOCK statement, SYNC ALL statement, SYNC IMAGES statement, SYNC MEMORY statement, UNLOCK statement