To: J3 J3/19-238r1 From: Daniel Chen & Bill Long Subject: C_F_POINTER modification for feature UK-01 Date: 2019-October-15 Reference: WG5/N2167, 18-007r1, 19-194r1 Introduction ------------ UK feature for F202X in WG5/N2167: UK-01 A pointer assignment allows an array pointer to have lower bounds other than 1. Intrinsic subroutine C_F_POINTER does not. This feature proposes to add the capability to specify lower bounds for the FPTR array in C_F_POINTER. Requirement: ------------ Allow specification of lower bounds for the FPTR argument in a call to C_F_POINTER. Specification and Syntax: ------------------------- Add an optional argument, LOWER, to the end of the argument list for C_F_POINTER. The LOWER argument is an integer array of rank one and the same size as the SHAPE argument. The values of the elements of LOWER are the lower bounds for the corresponding dimensions of the pointer FPTR. If LOWER is not present, the lower bounds for each dimension of FPTR are 1. Edits to 18-007r1 ---------------- [xiii] Introduction Add "The subroutine C_F_POINTER in the intrinsic module ISO_C_BINDING has an extra optional dummy argument, LOWER that specifies the lower bounds of FPTR." [470:13] Subclause 18.2.3.3 C_F_POINTER (CPTR, FPTR [, SHAPE]) replace "[, SHAPE]" by "[, SHAPE, LOWER]" The line now reads: 18.2.3.3 C_F_POINTER (CPTR, FPTR [, SHAPE, LOWER]) [470:24-25] Subclause 18.2.3.3 C_F_POINTER (CPTR, FPTR [, SHAPE]) replace " and each lower bound is equal to 1." by "; the lower bounds are specified by LOWER if it is present, and otherwise are equal to 1." The line now reads: "If FPTR is an array, its shape is specified by SHAPE; the lower bounds are specified by LOWER if it is present, and otherwise are equal to 1." [471:21-22] Subclause 18.2.3.3 C_F_POINTER (CPTR, FPTR [, SHAPE]) In Case (iii), replace " and each lower bound is 1" by ". The lower bounds are specified by LOWER if it is present; otherwise each lower bound is equal to 1." The line now reads: "If FPTR is an array, its shape is specified by SHAPE. The lower bounds are specified by LOWER if it is present; otherwise each lower bound is equal to 1." [471:26+] Subclause 18.2.3.3 C_F_POINTER (CPTR, FPTR [, SHAPE]) After the definition of SHAPE, add: "LOWER (optional) shall be a rank-one integer array. It is an INTENT (IN) argument. It shall not be present if SHAPE is not present. If LOWER is present, its size shall be equal to the rank of FPTR." [471:37-45] Examples. replace Case (ii) by: " Type t Real, Allocatable :: v(:,:) End Type Type(t), Target :: x(0:2) Type(t), Pointer :: y (:) Type(C_ptr) :: xloc xloc = C_Loc (x) ... Call C_F_Pointer (xloc, y, [3], [0]) "