To: J3 J3/14-181r3 From: David Muxworthy and Masayuki Takata Subject: UK proposal UK-19 COSHAPE intrinsic Date: 2014 June 26 Status: For Consideration Basic Functionality: Add COSHAPE intrinsic Rationale: It is irregular to have LCOBOUND and UCOBOUND intrinsics, but not to have COSHAPE. Specification: Add COSHAPE intrinsic to return the coshape of a coarray. Syntax: Add new intrinsic function COSHAPE. Edits to J3/14-007r1(= N2014): [xviii] Add to "Intrinsic procedures and Modules" the sentence: "The new intrinsic function COSHAPE returns the coshape of a coarray." [322] In 13.5 Standard generic intrinsic procedures, Table 13.1, after the entry for COSH add: "COSHAPE (COARRAY [, KIND]) I Sizes of codimensions of a coarray." [340:18+] In 13.7 Specifications of the standard intrinsic procedures, after the specification of COSH, add 13.7.5a COSHAPE (COARRAY [, KIND]) <> Sizes of codimensions of a coarray. <> Inquiry function. <> COARRAY shall be a coarray of any type. It shall not be an unallocated allocatable coarray. KIND (optional) shall be a scalar integer constant expression. <> Integer. If KIND is present, the kind type parameter is that specified by the value of KIND; otherwise, the kind type parameter is that of default integer type. The result is an array of rank one whose size is equal to the corank of COARRAY. <> The result has a value whose ith element is equal to UCOBOUND(COARRAY,)-LCOBOUND(COARRAY,)+1. <> The following code allocates the coarray D with the same size in each codimension as that of the coarray C, with the lower cobound 1. ALLOCATABLE :: C[:,:], D[:,:], COSHAPE_C(:) : COSHAPE_C = COSHAPE(C) ALLOCATE ( D[COSHAPE_C(1),*] )