To: J3 J3/22-102r1 From: T. Burnus & R. Bader & M. Cohen Subject: Interp candidate: Lower bounds in sourced allocation Date: 2022-March-04 1. Introduction The lower bounds for an array allocation with no allocate-shape-spec-list (or upper-bounds-expr) are not explicitly stated for the source-expr being an array section or array expression. It can be deduced from the rest of the standard that the lower bounds in such a case should be equal to one, so an interp request is not really needed, but it should be explicit. Here is an example with an array section: PROGRAM what REAL,ALLOCATABLE :: a(:), b(:) ALLOCATE(a(-7:7)) ALLOCATE(b,MOLD=a(::2)) PRINT *,LBOUND(b) ! Does this print -7 or 1? END PROGRAM Also, the paragraph that is supposed to cover this case is defective when upper-bounds-expr is supplied as well as source-expr, even in the case when source-expr is a whole array. 2. Edits to 22-007 [144:3-5] 9.7.1.2 Execution of an ALLOCATE statement, p7, After "no allocate-shape-spec-list" insert "or upper-bounds-expr" Change "bounds of source-expr determine the bounds of the array" to "array is allocated with the shape of source-expr, with each lower bound equal to the corresponding element of LBOUND (source-expr)". The whole paragraph 7 then reads "When an ALLOCATE statement is executed for an array with no allocate- shape-spec-list or upper-bounds-expr, the array is allocated with the shape of source-expr, with each lower bound equal to the corresponding element of LBOUND (source-expr). Subsequent changes to the bounds of source-expr do not affect the array bounds." ===END===