Next: Subscripting
Up: Arrays
Previous: Memory Storage
  Contents
In F90 the following terminology is used:
- Size = total number of elements. Both A and B
have size = 6.
- Rank = number of dimensions.
In F90 the rank should be less than or equal to 7.
A has rank 1, B has rank 2.
- Extent = number of elements in each dimension.
A has extent 6, B has extents 2 and 3. Note that
the extent can be ZERO (in this case the expressions involving the
array are simply ignored).
- Bounds = upper and lower limits of indices; by default,
they are taken 1:Extent.
E.g: A index varies between 1 and 6,
while B indices vary between 1 and 2,
and 1 and 3 respectively.
These bounds can be changed
using declarations of the form
real, dimension(-2:3) :: a
real, dimension(-10:-9,5:7) :: b
real :: a(-2:3), b(-10:-9,5:7) ! shorthand form
- Shape = rank and extents.
E.g: A
has shape (/6/) and B has shape (/2,3/).
F90 provides a number of intrinsic functions that ``inquire'' the
arrays about their attributes and status. These intrinsics are useful inside
procedure bodies; for example we can obtain the dimensions (extents)
of an input array argument without explicitly requiring them
in the argument list.
The inquiry intrinsic functions may return the lower and the upper subscript
bounds (LBOUND and UBOUND), the shape (SHAPE)
and the size (SIZE) of an array.
For example
Next: Subscripting
Up: Arrays
Previous: Memory Storage
  Contents
Adrian Sandu
2001-08-26