13-224 To: J3 From: Dan Nagle Subject: duplicate array bounds Date: 2013 December 28 Fortran 1x proposal: Provide a simple syntax to declare an array with the same bounds as a previously-declared array. Problem Statement: Often subprograms must declare an automatic array with the same bounds as a dummy-argument array. Or, arrays differing in type or other attributes must have the same bounds; these arrays cannot be declared on the same declarative statement so the bounds must be repeated. If the lower bound of each extent may be assumed to be 1, the size inquiry intrinsic may be specified to duplicate the bounds. For the more general case of arbitrary lower bounds, both lbound and ubound must be specified. When the arrays are of higher rank, this can produce a lengthy . Lengthy expressions can also occur when the name of the array whose bounds are to be duplicated is long (perhaps it is a component of a derived type). As these factors accumulate, the specification of the can quickly become tedious, error-prone, and hard to read and maintain. Proposed Solution: A simple, compact declaration would therefore be helpful when writing and maintaining programs. For example, if something like real, dimension( lbound( a%b, dim= 1): ubound( a%b, dim= 1), & lbound( a%b, dim= 2): ubound( a%b, dim= 2)) :: tmp could be replaced by something like real, dimension( bounds( a%b)) :: tmp or similarly real :: tmp( bounds( a%b)) then the resulting code is clearer, less error-prone, and easier to read and maintain. Care should be taken so that, in the future, the agreed notation could be generalized to cases where only part of the bounds information is needed (perhaps only the first few extents), or to cases where the resulting whole is to express a higher rank than the original (that is, more extents could be added), or to a form that could be used in an allocate statement or other context. However, this proposal is for the exact duplication of only, in a declaration only. Enhancements are possibly too complex for f1x.