To: J3 J3/15-173 Subject: Intrinsic that's either ASSOCIATED or ALLOCATED From: Van Snyder Reference: 15-007r1 Date: 2015 June 07 1. Introduction =============== I changed numerous components of numerous types from pointers to allocatable. I had to change all the references to ASSOCIATED to be references to ALLOCATED. One could write a family of generic functions, with each specific function consisting of an invocation of either the ASSOCIATED or ALLOCATED intrinsic function, but one would need a pair of specific functions for every type, spectrum of kind type parameters, and rank. An intrinsic function would be more convenient. 2. Proposal =========== Provide an intrinsic function that has either the effect of one-argument ASSOCIATED, or ALLOCATED, depending upon whether the actual argument has the POINTER or ALLOCATABLE attribute. The name proposed here is AVAILABLE, but another name, such as USABLE, would be acceptable. 3. Edits ======== [326 Table 13.1] Add to Table 13.1, in alphabetical order: " AVAILABLE ( A ) I Allocation or association status of variable " [343:13+ 13.8.30+] Insert a subclause " 13.8.30a AVAILABLE ( A ) <> Whether a variable is allocated, associated, or neither. <> Inquiry function. <> A shall be a variable that has either the ALLOCATABLE or POINTER attribute. <> Default logical. <> Case (i): If A has the ALLOCATABLE attribute, the result is true if the argument is allocated, and false otherwise. Case (ii): If A has the POINTER attribute, the result is true if the argument is associated with a target, and false otherwise. The association status shall not be undefined. "