144. A variable ASSOCIATEd to an ALLOCATABLE variable is not ALLOCATABLE.#

topic: Associate

Note

This tip is a draft1.

In an ASSOCIATE statement the LHS is not ALLOCATABLE even if the RHS is. If the RHS is an allocatable array, it must already be ALLOCATED, and it should not be reallocated or deallocated within the ASSOCIATE block.



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.