J3/14-217r1 To: J3 From: Nick Maclaren & Stan Whitlock Subject: Coarrays with allocatable components as arguments Date: 2014 October 14 This does not qualify as an interp. "coarray" should have been declared with the SAVE attribute. An explicit interface is not required in this case, see 12.4.2.2, so the restriction should not be converted to a constraint. There will be no further processing of this paper. ---------------------------------------------------------------------- NUMBER: TBD TITLE: Coarrays with allocatable components as arguments KEYWORD: Coarrays, allocatable DEFECT TYPE: Clarification STATUS: J3 consideration in progress QUESTION: Should a diagnostic be required for the following program ? PROGRAM Main TYPE :: Mytype INTEGER, ALLOCATABLE :: data(:) END TYPE Mytype TYPE(Mytype) :: coarray[*] ALLOCATE(coarray%data(THIS_IMAGE())) coarray%data = 10*THIS_IMAGE() SYNC ALL CALL Fred(coarray[1]) CONTAINS SUBROUTINE Fred (arg) TYPE(Mytype) :: arg CONTINUE END SUBROUTINE Fred END PROGRAM Main DISCUSSION: 12.5.2.4p6 says "If the actual argument is a coindexed object with an allocatable ultimate component, the dummy argument shall have the INTENT (IN) or the VALUE attribute." Because both of those require an explicit interface, which is statically checkable. It seems to be an oversight not to have made it a constraint. ANSWER: It was intended that a diagnostic should be required. Edits are supplied to correct this oversight. EDITS: [290] After 12.5.1 C1237, add "C12xx An actual argument that is a coindexed object with an allocatable ultimate component shall be associated with a dummy argument with the INTENT (IN) or the VALUE attribute." [293] 12.5.2.4p6 delete the paragraph. SUBMITTED BY: Nick Maclaren HISTORY: m205 14-nnn Submitted