To: J3 J3/14-190r1 From: David Muxworthy Subject: UK proposal UK-11 Assumed coshape Date: 2014 June 24 Title: Assumed coshape Status: For Consideration Basic Functionality: Allow a dummy coarray to assume its coshape from the actual argument, similarly to the way that a dummy (assumed-shape) array can assume its shape from the actual argument. Rationale: This would be convenient and there seems to be no technical problem with providing such a facility. To get functionality in Fortran 2008 that matches that shown in the example in the edits would require passing the coshape or working exclusively with allocatable coarrays. Specification: Add syntax for "assumed-coshape" that can only be used to declare a dummy argument. A dummy argument so declared assumes the cosh(ape) (but not necessarily the cobounds) of the actual argument. Syntax: The syntax should be the same as for assumed-shape (but with square brackets), i.e. each codimension is [ ] : including the final codimension. Edits to J3/10-007r1 (=N2014) [93:18+] 5.3.6 CODIMENSION attribute, 5.3.6.1 General. Add to R509 <> [94:1-] 5.3.6 CODIMENSION attribute, 5.3.6.1 General, NOTE 5.8. add new penultimate line: REAL :: A[:,:] ! Assumed-coshape coarray [95:14-] Before 5.3.7 CONTIGUOUS attribute, add section: <<5.3.6.4 Assumed-coshape coarray>> An assumed-coshape coarray is a dummy argument coarray that takes the extents of its codimensions from its effective argument. R513a is [ ] : The corank is equal to the number of colons in the . If appears, it specifies the lower cobound; otherwise, the lower cobound is 1. If the lower cobound is , the upper cobound is , where and are the lower and upper cobounds of the effective argument. [298:26+] 12.5.2.8 Coarray dummy variables, after para 2. Add paragraph: If a dummy argument is an assumed-coshape coarray, the corank of the actual argument shall be the same as the corank of the dummy argument. [299:1-] 12.5.2.8 Coarray dummy variables. At the end of the secton, add NOTE 12.34A Suppose a subroutine for writing coarrays of a given rank and corank to disk in parallel is desired. For rank and corank 3, the interface interface subroutine i33write(filename, coarray) character*(*), intent(in) :: filename integer, intent(in) :: coarray(:,:,:)[:,:,:] end interface would allow code such as this character(clen) :: filename integer, dimension(nx,ny,nz), codimension[px,py,*] :: ca ... call i33write(filename, ca) to invoke the subroutine. Intrinsic functions could be used within the subroutine to determine the bounds and cobounds.