Next: Declarations
Up: Arrays
Previous: Arrays
Examples of declarations:
REAL, DIMENSION(15) :: X
REAL, DIMENSION(1:5,1:3) :: Y, Z
The above are explicit-shape arrays.
If the lower bound is not explicitly stated it is taken to be 1.
Terminology:
- rank -- the number of dimensions up to and including 7
dimensions. X has rank 1, Y and Z have rank 2.
- bounds -- upper and lower limits of indices, an unspecified
bound is 1. X has lower bound 1 and upper bound 15, Y and
Z have lower bounds of 1 and 1 with upper bounds 5 and 3.
- extent -- number of elements in dimension (which can be
zero). X has extent 15, Y and Z
have extents 5 and 3.
- size -- either the total number of elements or, if
particular dimension is specified, the number of elements in that
dimension. All arrays have size 15.
- shape -- rank and extents. X has shape
(/15/)
,
Y and Z have shape (/5,3/)
. - conformable -- two arrays are conformable if they have the
same shape -- for operations between two
arrays the shapes (of the sections) must (generally) conform (just like in
mathematics). Y and Z have the same shape so they conform.
- there is no storage association for Fortran 90 arrays.
Explicit-shape arrays can have symbolic bounds so long as they are
initialisation expressions -- evaluatable at compile time.
Now try this question
Return to corresponding overview page
Next: Declarations
Up: Arrays
Previous: Arrays
©University of Liverpool, 1997
Wed May 28 20:20:27 BST 1997Not for commercial use.