> Date: Thu, 29 Jul 2004 14:51:54 +0000
> From: [log in to unmask]
> > Hi,
> >
> > A quick question...
> >
> > When an array is passed to a subroutine or function as an assumed shape
> > array, do the references for each dimension of the dummy array begin at 1.
> > Is this a portable assumption??
> >
> Yes, it's portable. The standard requires it. It surprises pretty
> much everyone the first time the feature is applied to them. But,
> it's the only reasonable thing to do. Suppose your call were
>
> call A(main_array(2:8:4, 5:1:-3))
> or even
> call A(main_array(-1:8,1:5) + main_array(8:-1:-1,5:1:-1))
>
> there's no natural lower bound.
The natural lower bounds for the frst example are 2 and 5.
The default for the second is reasonably 1.
But there's no reason for defaulting to 1 for everything
including for the general case.
> Dick Hendrickson
|