HP Fortran Programmer's Reference (September 2007)

Arrays
Array fundamentals
Chapter 358
a(1,2)
a(2,2)
a(3,2)
The following array declarations illustrate some of the concepts presented in this section:
! The rank of a1 is 1 as it only has one dimension, the extent of
! the single dimension is 10, and the size of a1 is also 10.
! a1 has a shape represented by the vector [10].
REAL, DIMENSION(10) :: a1
! a2 is declared with two dimensions and consequently has a rank
! of 2, the extents of the dimensions are 2 and 4
! respectively,and the size of a2 is 8.
! The array’s shape can be represented by the vector [2, 4].
INTEGER, DIMENSION(2,4) :: a2
! a3 has a rank of 3, the extent of the first two dimensions is
! 5,and the extent of the third dimension is zero. The size of
! a3 is the product of all the extents and is therefore zero.
! The shape of a3 can be represented by the vector [5, 5, 0].
LOGICAL, DIMENSION(5,5,0) :: a3
! a and b are conformable, c and d are conformable. The shape of
! a and b can be represented by the vector [3, 4]. The shape of
! c and d can be represented by the vector [6, 8].
REAL, DIMENSION :: a(3,4), b(3,4), c(6,8), d(-2:3,10:17)