Hello,
ARRAY is a whole array, ARRAY(:) is an array section.
Array sections have, by definition, lower bounds of 1.
The upper bound of an array section is the extent of the array section
along that dimension.
It's section 6.2.2 in the draft f2k standard (I don't have an f95
standard :-( ). To me, it reads as inscrutable standardese, but if
all the compilers are interpreting it the same way, it must make
sense to someone :-)
John Bray wrote:
>
> I was rather surprised to see this result (on Nag f90 on HP-UX and Cray f90
> on T3E)
>
> cat temp1.f90
> program temp1
>
> integer,allocatable :: a(:,:,:)
>
> allocate (a(0:2,0:2,0:2))
>
> print *, LBOUND(a)
> print *, LBOUND(a(:,:,:))
> print *, UBOUND(a)
> print *, UBOUND(a(:,:,:))
>
> end program temp1
> frjb@fr0400: a.out
> 0 0 0
> 1 1 1
> 2 2 2
> 3 3 3
>
> Why does adding the colon notation change the result?
>
> Jon
> --
> John Bray, Numerical Weather Prediction Tel: +44 (0) 1344 854035
> Room 337 [log in to unmask]
> The Met. Office http://www.met-office.gov.uk
> London Road, Bracknell, RG12 2SZ, UK http://www.jrbray.org.uk
--
Cheers!
Dan Nagle
Purple Sage Computing Solutions, Inc.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|