To: J3 J3/14-107 From: John Reid Subject: MOVE_ALLOC Date: 2014 January 24 References: N1996, N1999 Discussion ---------- In his vote (see N1999), Reinhold Bader pointed that MOVE_ALLOC needs to be modified to take account of the presence of failed images and that extra arguments should be added to provide warnings of failed images. When the arguments FROM and TO are coarrays, the subroutine behaves as a collective, but this is not the case for non-coarray arguments so the subroutine cannot be changed to be a collective. Edits to N1996: --------------- [26:10+] Add new subclause: 7.5.0 MOVE_ALLOC The description of the intrinsic function MOVE_ALLOC in ISO/IEC 1539-1:2010 is changed to take account of the possibility of failed images and to add two optional arguments STAT and ERRMSG and a modified result if either is present. The following text replaces paragraphs 4-6 of the description and the paragraph that was added by Corrigendum 2: STAT (optional) shall be a scalar of type default integer. It is an INTENT(OUT) argument. ERRMSG (optional) shall be a scalar of type default character. It is an INTENT(INOUT) argument. If the execution is successful (1) The allocation status of TO becomes unallocated if FROM is unallocated on entry to MOVE_ALLOC. Otherwise, TO becomes allocated with dynamic type, type parameters, array bounds, array cobounds, and value identical to those that FROM had on entry to MOVE_ALLOC. (2) If TO has the TARGET attribute, any pointer associated with FROM on entry to MOVE_ALLOC becomes correspondingly associated with TO. If TO does not have the TARGET attribute, the pointer association status of any pointer associated with FROM on entry becomes undefined. (3) The allocation status of FROM becomes unallocated. When a reference to MOVE_ALLOC is executed for which the FROM argument is a coarray, there is an implicit synchronization of all nonfailed images of the current team. On each nonfailed image, execution of the segment (8.5.2) following the CALL statement is delayed until all other nonfailed images of the current team have executed the same statement the same number of times. If the STAT argument is present and execution is successful, the argument is assigned the value zero. If the STAT argument is present and an error condition occurs, the argument is assigned a nonzero value. The value shall be that of the constant STAT_FAILED_IMAGE in the intrinsic module ISO_FORTRAN_ENV if the reason is that a failed image has been detected in the current team; otherwise, the value shall be that of the constant STAT_STOPPED_IMAGE in the intrinsic module ISO_FORTRAN_ENV if the reason is that a successful execution would have involved an interaction with an image that has initiated termination; otherwise, the value is a processor-dependent positive value that is different from the value of STAT_STOPPED_IMAGE or STAT_FAILED_IMAGE. If the ERRMSG argument is present and an error condition occurs, the processor shall assign an explanatory message to the argument. If no such condition occurs, the processor shall not change the value of the argument. [32:1-] Before the edit for 13.5 add {In 13.5 Standard generic intrinsic procedures, Table 13.1, edit the entry for MOVE_ALLOC as follows} MOVE_ALLOC (FROM, TO [, STAT, ERRMSG]) PS Move an allocation. [32:6+] Before the edit for 13.7.126 add {In 13.7.118 MOVE_ALLOC, replace the title by} 13.7.118 MOVE_ALLOC (FROM, TO [, STAT, ERRMSG]) --------------------------------------------------------------- {In 13.7.118 MOVE_ALLOC, make the changes given in subclause 7.5.0 of this Technical Specification.}