182. ALLOCATE has an optional ERRMSG specifier.#

topic: Allocation

Note

This tip is a draft1.

The ERRMSG specifier of ALLOCATE gives an error message when an ALLOCATE fails. Two common reasons are an already allocated variable or insufficient memory. ALLOCATE with ERRMSG should also have the STAT specifier to avoid program termination upon error.



1

From the perspective of FortranTip Browser, “draft” means that it hasn’t been edited for formatting, hasn’t had corresponding Fortran programs added, the text content hasn’t been enhanced, etc. Draft texts are extracted from the corresponding Tweet using the Twitter API.