08-200r1 To: J3 From: Van Snyder Subject: Interp: Are lower bounds of assumed-shape arrays assumed? Date: 2008 June 11 References: 04-007 NUMBER: TBD TITLE: Are lower bounds of assumed-shape arrays assumed? KEYWORDS: LBOUND, assumed-shape array, initialization expression DEFECT TYPE: Clarification STATUS: J3 consideration in progress QUESTION: Does the following program conform to the 2003 Fortran standard? subroutine S ( A ) integer :: A(:,3:) integer, parameter :: R = size(lbound(A)) end subroutine S Processors disagree. If the lower bounds of an assumed-shape array are assumed, LBOUND(A) is not an initialization expression according to item (8)(b)(i) in subclause 7.1.7. If the lower bounds of an assumed-shape array are not assumed, LBOUND(A) is an initialization expression in this case, but might be a specification expression in other cases. ANSWER: This program conforms to the 2003 Fortran standard. The lower bounds of an assumed-shape array are not assumed. If a lower bound is not specified, it has the value 1 -- see the final sentence of the final paragraph of subclause 5.1.2.5.2. If a lower bound is specified, it must be specified either by an initialization expression or a specification expression. In the example in the question, the lower bound of the first dimension is omitted, and therefore has the value 1, while the lower bound of the second dimension is given by an initialization expression. Therefore, the reference to LBOUND is an initialization expression, and the reference to SIZE is therefore an initialization expression. EDITS: Before the last sentence of the final paragraph of 5.1.2.5.2, insert a sentence: "The lower bounds of an assumed-shape array are not assumed." or Insert a note after the final paragraph of 5.1.2.5.2: "The lower bounds of an assumed-shape array are not assumed." or None. SUBMITTED BY: Van Snyder HISTORY: 08-xxx m185 Submitted