"David Vowles" <[log in to unmask]>wrote:
...
> Suppose array IA is declared thus:
>
> INTEGER, DIMENSION(10) :: IA
>
> and a call to subroutine sub1 (see below) is made thus:
>
> CALL sub1(IA(2:1))
>
> Then I understand that a zero length array section is passed to sub1 and
> that there will be no bounds violations. Is my understanding correct?
...
> Finally, is the following array section valid:
>
> CALL sub1(IA(0:-1))
Seems like this came up a few months ago. Section 6.2.2.3 applies.
In an array-section having a section-subscript-list, each subscript-triplet
and vector-subscript in the section subscript list indicates a sequence of
subscripts which may be empty (6.2.2). Each subscript in such a sequence
must be within the bounds for its dimension unless the sequence is empty.
[...]
So, an empty subscript sequence need not be defined by values that are in
bounds for the array, since it contains no element which will actually be
used to subscript the array.
--
J. Giles
|