To: J3 J3/21-150 From: Malcolm Cohen Subject: Interp F18/030 CO_REDUCE OPERATION with coarray arg Date: 2021-June-20 ---------------------------------------------------------------------- NUMBER: F18/030 TITLE: CO_REDUCE/REDUCE OPERATION with coarray argument DEFECT TYPE: Erratum STATUS: J3 consideration in progress QUESTION: Consider the function Pure Real Function f(a,b) Result(r) Real,Intent(In) :: a[*],b[*] r = a[1]*b[1] End Function This function appears to satisfy all the requirements on the OPERATION argument to CO_REDUCE. Q1. Was this intended to be a valid operation for CO_REDUCE? Q2. Was this intended to be a valid operation for REDUCE? ANSWER: A1. No, this was not intended to be valid; the arguments of OPERATION should not have been permitted to be coarrays. A2. Likewise, this was not intended to be valid. Edits are supplied to correct this oversight. EDIT to 18-007r1: [357:9] 16.9.49 CO_REDUCE, p3 Arguments, OPERATION argument, After "nonallocatable," insert "noncoarray,". That makes the first sentence of the argument read: "OPERATION shall be a pure function with exactly two arguments; the result and each argument shall be a scalar, nonallocatable, noncoarray, nonpointer, nonpolymorphic data object with the same type and type parameters as A." {The "noncoarray" requirement is superfluous for the result, but that is not harmful.} [408:36] 16.9.161 REDUCE, p3 Arguments, OPERATION argument, Before "nonpointer," insert "noncoarray,". That makes the first sentence of the argument read: "OPERATION shall be a pure function with exactly two arguments; each argument shall be a scalar, nonallocatable, noncoarray, nonpointer, nonpolymorphic, nonoptional dummy data object with the same type and type parameters as ARRAY." {It is "interesting" that these two very similar requirements are being expressed differently. Perhaps there is a good reason.} SUBMITTED BY: Malcolm Cohen HISTORY: 21-nnn m224 Submitted ----------------------------------------------------------------------