To: J3 J3/23-220r1 From: John Reid & Reinhold Bader && Malcolm Cohen Subject: Interp for MOVE_ALLOC with FROM a coarray Date: 2023-October-16 ---------------------------------------------------------------------- NUMBER: F23/010 TITLE: MOVE_ALLOC with coarray arguments KEYWORDS: MOVE_ALLOC, coarray DEFECT TYPE: Erratum STATUS: J3 consideration in progress QUESTION: If the FROM and TO arguments to MOVE_ALLOC are coarrays, are corresponding invocations of MOVE_ALLOC required to have their FROM (and TO) arguments be corresponding coarrays? For example, this program ends up with A and B not having the same allocation status on all images, which surely cannot be right. program trouble real, allocatable :: a[:], b[:] allocate(a[*],b[*]) if (this_image()>1) then call sub(a,b) ! Now, A is deallocated and B is allocated else call sub(b,a) ! Now, B is deallocated and A is allocated end if contains subroutine sub(s,t) real, allocatable :: s[:], t[:] call move_alloc(s,t) end subroutine end program ANSWER: Yes, those arguments are required to be corresponding coarrays. An edit is supplied to correct this error. EDIT to N2218 (Fortran 2023 FDIS): [423] In 16.9.147 MOVE_ALLOC, Arguments paragraph, At the end of the FROM argument description append "If it is a coarray, it shall correspond to the FROM arguments in all corresponding invocations of MOVE_ALLOC." At the end of the TO argument description append "If it is a coarray, it shall correspond to the TO arguments in all corresponding invocations of MOVE_ALLOC." SUBMITTED BY: John Reid & Reinhold Bader HISTORY: 23-170 m230 Submitted 23-220 m231 Revised 23-220r1 m231 Revised ----------------------------------------------------------------------