J3/14-216 To: J3 From: Nick Maclaren Subject: Unallocated coarray components Date: 2014 August 07 ---------------------------------------------------------------------- NUMBER: TBD TITLE: Unallocated coarray components KEYWORD: Coarrays, allocation DEFECT TYPE: Clarification STATUS: J3 consideration in progress QUESTION 1: Is the following program supposed to be conforming? PROGRAM Main TYPE :: Mytype INTEGER, ALLOCATABLE :: data(:) END TYPE Mytype TYPE(Mytype) :: coarray_1[*], coarray_2[*] IF (THIS_IMAGE() == 2) THEN ALLOCATE(coarray_2%data(3)) coarray_2%data = 123 END IF SYNC ALL IF (THIS_IMAGE() == 1) THEN coarray_1 = coarray_2[2] PRINT *, coarray_1%data END IF END PROGRAM Main QUESTION 2: Is the following program supposed to be conforming? PROGRAM Main TYPE :: Mytype INTEGER, ALLOCATABLE :: data(:) END TYPE Mytype TYPE(Mytype) :: coarray_1[*], coarray_2[*] IF (THIS_IMAGE() == 2) THEN ALLOCATE(coarray_2%data(3)) coarray_2%data = 123 END IF SYNC ALL IF (THIS_IMAGE() == 1) CALL Fred (coarray_1) CONTAINS SUBROUTINE Fred (arg) TYPE(Mytype) :: arg arg = coarray_2[2] PRINT *, arg%data END SUBROUTINE Fred END PROGRAM Main DISCUSSION: 7.2.1.2p1(3) says "the variable and expr shall be conformable unless the variable is an allocatable array that has the same rank as expr and is neither a coarray nor a coindexed object". 7.2.1.3p13 describes assignment of derived types, essentially to be recursive. This seems to forbid the first example but not the second, despite their near-equivalence, but I don't think that was intended. It needs clarifying, in any case. ANSWER: Awaiting statement of direction. EDITS: Awaiting statement of direction. SUBMITTED BY: Nick Maclaren HISTORY: m205 14-nnn Submitted