To: J3 J3/19-208r1 From: John Reid Subject: US 12, arrays of coarrays Date: 2019-August-08 Discussion ---------- This paper proposes specs, syntax, and edits for US-12, see 18-280r1. It is likely that more edits will be needed. Proposed formal specifications ------------------------------ 1. Allow an object of a derived type that has an allocatable coarray ultimate component to be an array. There is a separate coarray for each element of the parent array and coarrays in separate elements are not required to have the same bounds and cobounds. 2. Allow an object of a derived type that has an allocatable coarray ultimate component to be allocatable, which implies that it is also allowed to be polymorphic. 3. In an allocate or deallocate statement for a coarray that is an ultimate component of a polymorphic variable, the types must be the same on all images and the type parameters must be the same on all images. 4. In an assignment for a variable that has a coarray ultimate component, and must have the same type, the same type parameters, and the same shape. 5. In an allocate or deallocate statement for a coarray that is an element of an array, the values of the subscripts must be the same on all images. Proposed syntax --------------- No new syntax. Edits to 18-007r1 ----------------- [95:26-27] In 8.5.6 CODIMENSION attribute, change C825 to "C825 An entity whose type has a coarray ultimate component shall not be a pointer, shall not be a coarray, and shall not be a function result." [96:12+] In 8.5.6.2 Allocatable coarray, add a new para 6: "An array of a type with a coarray ultimate component shall have the same lower bounds and the same upper bounds on all images of the current team." [132:30] In 9.7.1.1 Form of the ALLOCATE statement, delete "C937 (R927) type-spec shall not specify a type that has a coarray ultimate component." [133:20] In 9.7.1.1 Form of the ALLOCATE statement, delete "C949 (R930) The declared type of source-expr shall not have a coarray ultimate component." [134:17+] In 9.7.1.2 Execution of an ALLOCATE statement, at the end of para 3, add "If the coarray is an ultimate component of an array element, each of the subscripts that selects the array element shall have the same value on all active images of the current team. If the coarray is an ultimate component of a polymorphic variable, the variable shall have the same type and type parameters on all active images of the current team." [137:31] In 9.7.3.2 Deallocation of allocatable variables, para 10, after the first sentence, add "If the coarray is an ultimate component of an array element, each of the subscripts that selects the array element shall have the same value on all active images of the current team. If the coarray is an ultimate component of a polymorphic variable, the variable shall have the same type and type parameters on all active images of the current team." [160:10] In 10.2.1.2 Intrinsic assignment statement, para 1, item(3), change "not a coarray" to "not a coarray or an array with a coarray component" so that the item becomes "(3) the variable and expr shall be conformable unless the variable is an allocatable array that has the same rank as expr and is not a coarray or an array with a coarray component", [198:14] In 11.6.1 Image control statements, para 2, replace bullet 5 o ALLOCATE or DEALLOCATE statement that has a coarray allocate-object by the two bullets o ALLOCATE statement that has a coarray allocation; o DEALLOCATE statement that has a coarray allocate-object or an allocate-object that has a coarray ultimate component; [308:25-26] In 15.5.2.8 Coarray dummy variables, para 2, add ", is an array that has the CONTIGUOUS attribute and has a coarray ultimate component," after "CONTIGUOUS attribute" and change "is not of assumed shape" to "is neither of assumed shape nor of assumed rank". This makes the para. become "If the dummy argument is an array coarray that has the CONTIGUOUS attribute, is an array that has the CONTIGUOUS attribute and has a coarray ultimate component, or is neither of assumed shape nor of assumed rank, the corresponding actual argument shall be simply contiguous or an element of a simply contiguous array."