J3/14-228 To: J3 From: Nick Maclaren Subject: Types with coarray components Date: 2014 August 11 ---------------------------------------------------------------------- NUMBER: TBD TITLE: Types with coarray components KEYWORD: Coarrays, derived types DEFECT TYPE: Clarification STATUS: J3 consideration in progress Objects of types with coarray components must be nonpointer nonallocatable scalars, not coarrays or components of coarrays, and with the SAVE attribute or a dummy argument without the VALUE attribute (C525, C526, C557, C640 and C643). The component must be deferred coshape and allocatable (C442). There is some duplication and another constraint on type extension (C432). However, there are some restrictions on the use of coarrays that are not specified for such objects, and it is unclear whether that was intended. Some are very unlikely to arise in real code, but others could be seen as ways of using derived types to bypass various restrictions on the use of coarrays, as is already done with pointers. In some constraints, the use of types with coarray components is forbidden by other (non-constraint) restrictions, and is is unclear whether they were intended to be covered by the constraint (i.e. require a diagnostic). I do not guarantee that I have found all such constraints and restrictions, because they were located by string searches in the more obvious areas. There are also several cases where coarrays are explicitly excluded, but objects with coarray components are excluded only because coarray components must be allocatable. If that were ever to be relaxed, this issue would need to be revisited. QUESTION 1: 5.3.19 C560 says "The VOLATILE attribute shall not be specified for a coarray that is accessed by use (11.2.2) or host (16.5.1.4) association." Is this intended also to apply to ones with coarray components? See also questions 2 and 3. QUESTION 2: 5.3.19 C561 says "Within a BLOCK construct (8.1.4), the VOLATILE attribute shall not be specified for a coarray that is not a construct entity (16.4) of that construct." Is this intended also to apply to objects with coarray components? See also questions 1 and 3. QUESTION 3: 5.3.19p1 says "A noncoarray object that has the VOLATILE attribute may be associated with an object that does not have the VOLATILE attribute, including by use (11.2.2) or host association (16.5.1.4). Within a BLOCK construct (8.1.4), a noncoarray object may have the VOLATILE attribute even if it does not have the attribute outside the BLOCK construct. The relationship between coarrays, the VOLATILE attribute, and argument association is described in 12.5.2.8. The relationship between between coarrays, the VOLATILE attribute, and pointer association is described in 7.2.2.3." 16.5.1.4p2 says "..., and a noncoarray local entity may have the VOLATILE attribute even if the host entity does not. ..." Is this intended also to apply to objects with coarray components? See also questions 1 and 2. QUESTION 4: 12.4.2.2p1 says "A procedure other than a statement function shall have an explicit interface if it is referenced and ... (2) the procedure has a dummy argument that ... (c) is a coarray, ...." Is this intended also to apply to objects with coarray components? QUESTION 5: 12.5.2.8p1 says "If the dummy argument is a coarray, the corresponding actual argument shall be a coarray and shall have the VOLATILE attribute if and only if the dummy argument has the VOLATILE attribute." Is this intended also to apply to objects with coarray components? QUESTION 6: 12.8.1 C1289 says "All dummy arguments of an elemental procedure shall be scalar noncoarray dummy data objects and shall not have the POINTER or ALLOCATABLE attribute." Is this intended also to apply to objects with coarray components? QUESTION 7: 15.3.5p1 says "A named scalar Fortran variable is interoperable if and only if its type and type parameters are interoperable, it is not a coarray, it has neither the ALLOCATABLE nor the POINTER attribute, and if it is of type character its length is not assumed or declared by an expression that is not a constant expression." In the context of TS 29113, which removes the ALLOCATABLE and POINTER restrictions, is this intended also to apply to objects with coarray components? ANSWER: Awaiting statement of direction. EDITS: Awaiting statement of direction. SUBMITTED BY: Nick Maclaren HISTORY: m205 14-nnn Submitted