J3/14-249r3 To: J3 From: Van Snyder Subject: Description of deallocation of allocatable objects Date: 2014 October 15 Reference: 14-007r2 1. Introduction =============== The description of deallocation in 6.7.3.2 is not obviously complete in its treatment of coarrays. By explicitly discussing synchronization only in the context of execution of DEALLOCATE, RETURN, or END statements, or termination of a BLOCK construct, it gives the appearance that deallocation of a coarray because of INTENT(OUT) or automatic deallocation of a subobject don't count. Presumably they all cause synchronization. Use of the term "subcomponent" in 6.7.3.2p12 could be confusing if the deallocated coarray is a subobject of an allocatable component (because it's not a subcomponent). 6.7.3.2p10 saves the day, because it says automatic deallocation is the same as executing a DEALLOCATE statement, but the reader ought not be expected to prove such a convoluted theorem. Other parts of the description could be simplified. 2. Edits to 14-007r2 ==================== These edits are intended not to change technical content. [134:33-135:1 6.7.3.2p4] Replace "either ... is allocatable" with "allocatable or has an allocatable subobject". [135:1-2 6.7.3.2p5] Replace "subobject that is an allocated allocatable entity in the result returned by the function" with "allocated allocatable subobject of the result". [135:4 6.7.3.2p5] Delete "either". Replace "a structure with" with "has". [135:5-6 6.7.3.2p5] Replace "subobject that is an allocated allocatable entity in the result returned by the function" with "allocated allocatable subobject of the result". {Presumably, 6.7.3.2p5 applies to the anonymous result in the invoking scoping unit.} [135:25-28 6.7.3.2p11] Replace "DEALLOCATE ... coarray" with "statement that deallocates a coarray is executed". Replace "the coarray is a" with "an is a coarray". Then move the paragraph to [135:23+ 6.7.3.2p9+]. {This makes the paragraph read "When a statement that deallocates a coarray is executed, there is an implicit synchronization of all images. On each image, execution of the segment (8.5.2) following the statement is delayed until all other images have executed the same statement the same number of times. If an is a coarray dummy argument, its ultimate argument (12.5.2.3) shall be the same coarray on every image." } [135:29-31 6.7.3.2p12] Replace now redundant paragraph with a note: "NOTE 6.23a (or NOTE 6.22a, before NOTE 6.23} For example, executing a RETURN, END or END BLOCK statement, or deallocating an object that has an allocatable subobject, can cause deallocation of a coarray."