To: J3 J3/17-206r2 From: Reinhold Bader & Anton Shterenlikht Subject: upper cobounds and UCOBOUND Date: 2017 October 18 References: N2137 Introduction: ~~~~~~~~~~~~~ The definition of upper cobounds in the standard appears to be distributed across multiple places. The base definition is in 8.5.6 CODIMENSION attribute. There, the last upper cobound is always excluded. This definition is sufficient to establish the mapping between coindices and image index in the current team (or, more generally with the rules from 9.6, in any specified team). In 16.9.197 UCOBOUND [439:10-11], this is extended by also defining the final upper cobound, a run time property, since obtaining it requires knowledge of the number of executing images. This makes sense because UCOBOUND needs to be able to return an array of size corank its argument, but is a bit confusing or even incorrect when considering references to cobounds in other places in the standard. It appears that everywhere except in the definition of UCOBOUND, the first definition is targeted. Note that 9.6 para 4 constrains the program to use valid image indices, implicitly constraining also the cosubscript in the final codimension. Edits are suggested to make a clearer distinction between the two cases. Edits to N2137: ~~~~~~~~~~~~~~~ [45:26-] Section 5.4.7 Coarray, add the following text to NOTE 5.10: "A corank n coarray has n lower and n-1 upper cobounds (8.5.6). A value for the upper cobound of the final codimension can be obtained by the program through invoking the UCOBOUND intrinsic. This final upper cobound is otherwise not included when this document references the term ''cobounds''." [438:36] Section 16.9.197 UCOBOUND replace "Description: Upper cobound(s) of a coarray." with "Description: Upper cobound(s) of a coarray, including that for the final codimension." ===END===