To: J3 11-125 From: John Reid Subject: Interop: UTI TR6 Date: 2011 January 26 References: N1838, ISO/IEC 1539-1:2010 DISCUSSION Constraint 5 in N1820 says that array strides of zero and overlapping elements are not supported. Edits are supplied to state properties that I believe Fortran arrays always have - no overlaps and counting most rapidly in the early dimensions. Array expressions can be different. It has been argued that more generality should be allowed; for example, transpose might be implemented without making a copy by permuting the descriptor. However, if we allow this, it would force the C programmer to code for the possibility. I think it is better to keep this simple by requiring simple constraints. However, the edits below could be modified so that they refer to the permutation of the sm members that puts them in monotonic increasing order. It has been argued that the constraints should be only on descriptors constructed in C, but we need to allow the C programmer to use a descriptor that has been sent by Fortran. Reinhold Bader suggests that the wording should be 0-based for the C programmer. Since we are describing the properties of a Fortran array, I prefer 1-based wording. Both alternatives are presented here. EDITS to N1838: Version 1. [10:19+] In 5.2.3 CFI_dim_t, add paragraph Suppose the object has rank n and the extent and sm members of the elements of the dim member are extent_i and sm_i, i = 1, ..., n. The absolute value of sm_1 shall be at least as large as the elem_len member and the inequalities |sm_{i+1}| >= |sm_i| extent_i, i = 1, ..., n-1 shall hold if n>1. If the attribute member indicates that the array is assumed-size, the value sm_1 shall be equal to the elem_len member of the descriptor and the inequality sm_{i+1} = sm_i extent_i, i = 1, ..., n-1 shall hold if n>1. Version 2. [10:19+] In 5.2.3 CFI_dim_t, add paragraph Suppose the object has rank n and the extent and sm members of the elements of the dim member are extent_i and sm_i, i = 0, ..., n-1. The absolute value of sm_0 shall be at least as large as the elem_len member and the inequalities |sm_i| >= |sm_{i-1}| extent_{i-1}, i = 1, ..., n-1 shall hold if n>1. If the attribute member indicates that the array is assumed-size, the value sm_0 shall be equal to the elem_len member of the descriptor and the equalities sm_i = sm_{i-1} extent_{i-1}, i = 1, ..., n-1 shall hold if n>1.