To: J3 J3/20-124 From: Tom Clune Subject: Edits for rank-agnostic bounds Date: 2020-February-27 Reference: 18-007r1, 20-115r1 Introduction: Paper 20-115r1 provided syntax for rank-agnostic bounds in the form of BOUNDS and RANK attributes. This paper provides edits for these features. Edits: [xiii Introduction] In paragraph 2, in the bullet for "Data declaration" , append the following sentence: " RANK and BOUNDS attributes have been introduced to support rank-agnostic declarations. " [91:19+ 8.2 Type declaration statement] insert into R802 attr-spec: " <> BOUNDS ( ) " [91:30+ 8.2 Type declaration statement] insert into R802 attr-spec: " <> RANK ( ) " [91:39+ 8.2 Type declaration statement] insert constraint: " C### At most one of BOUNDS, DIMENSION, and RANK shall appear in a . " {While consistent duplication is possible, it is at best confusing.} [95:16- 8.5.5 BIND attribute for data entities] Insert new subclause. " 8.5.6 BOUNDS attribute The BOUNDS attribute specifies the rank and bounds of an entity. <> <> R### <> BOUNDS ( ) R### <> [:] <> : <> : R### <> is C### If has two s, they shall have the same size. C### shall be a rank one integer array with constant size. R### <> BOUNDS ( : ) C### An entity declared with an shall be a dummy data object. If only one expression appears in , it specifies the rank and upper bounds of the array. The rank is the size of the . If an expression appears before a colon in it specifies the lower bounds of the array. Otherwise, the lower bounds in each dimension are equal to one. If appears in , it is broadcast to the shape of . An entity declared with a zero-sized is scalar. Note ### Examples of BOUNDS attribute specifications are: CHARACTER, BOUNDS([80,24]) :: X3 ! lower bounds are default (=1) INTEGER, PARAMETER(*) :: UPPER = [10,10,10] INTEGER, BOUNDS (0:UPPER) :: X4 ! implicit broadcast of lower REAL, BOUNDS([1,2,3]:10) :: X5 ! implicit broadcast of upper INTEGER :: LB(2) INTEGER :: UB(2) INTEGER, BOUNDS(LB:UB) :: X6A, X6B ! multiple declarations REAL, BOUNDS([1,1,1]:) :: X7 ! assumed shape dummy INTEGER, BOUNDS([7,7,7]) :: X8A, X9B(10) ! array spec overrides bounds [105:17- 8.5.15 PROTECTED attribute] Insert new subclause. " 8.5.16 RANK attribute The RANK attribute specifies the rank of an entity. If the rank is greater than zero and the entity has the ALLOCATABLE or POINTER attribute, it has deferred shape. Otherwise, if the rank is greater than zero, it has assumed shape. R### <> RANK ( ) C### The value of in a shall be nonnegative. C### An entity declared with a shall be a dummy data object or have the ALLOCATABLE or POINTER attribute. NOTE ### Examples of RANK attribute specifications are: INTEGER, RANK(3), ALLOCATABLE :: X1 REAL, RANK(0) :: X2 ! scalar dummy "