J3/nnn To: J3 From: Malcolm Cohen Subject: New functionality for interoperability TR Date: Whenever. 1. Introduction In discussion with a member of the MPI group, it appears that they have a desire to be able to convert a TYPE(C_PTR) to an array pointer of any type. This is not currently possible in Fortran 2003 or 2008. This paper contains Requirements, Specifications, Syntax and Edits. 2. Background The MPI_ALLOC_MEM procedure wishes to allocate ``special'' memory for use in communication. This memory should be able to be of any type. 3. Requirements (WG5) To be able to allocate, by means other than Fortran, memory that can be associated with a Fortran pointer of any type and rank. 4. Specifications (J3) To provide a facility for constructing an array pointer of any type starting from a base address and the shape. 5. Syntax (J3) Allow C_F_POINTER to be used to construct an array pointer of noninteroperable type. For symmetry, allow C_LOC to be used on a noninteroperable array. 6. Edits to N1854 [9:2-] Insert new clause 5.1, renumbering the existing 5.1 to 5.2 and the existing 5.2 to 5.3, "5.1 Removed restrictions on C_F_POINTER and C_LOC The subroutine C_F_POINTER from the intrinsic module ISO_C_BINDING has the restriction in ISO/IEC 1539-1:2010 that if FPTR is an array, it must be of interoperable type. The function C_LOC from the intrinsic module ISO_C_BINDING has the restriction in ISO/IEC 1539-1:2010 that if X is an array, it must be of interoperable type. These restrictions are removed." [28:12+] Insert new edits ``\hline In 15.2.3.3 paragraph 3, append a new paragraph to the description of FPTR: "If the value of CPTR is the C address of a storage sequence, FPTR becomes associated with that storage sequence. If FPTR is an array, its shape is specified by SHAPE and each lower bound is 1. The storage sequence shall be large enough to contain the target object described by FPTR, shall not be in use by another Fortran entity, and shall satisfy any other processor-dependent requirements for association." \hline At the end of 15.2.3.4, insert new note "NOTE 15.xx In the case of associating FPTR with a storage sequence, there might be a processor-dependent requirement on memory address alignment ." \hline In 15.2.3.6 paragraph 3, delete "scalar,".'' ===END===