HP Fortran Programmer's Reference (September 2007)

HP Fortran statements
DIMENSION (statement and attribute)
Chapter 10324
DIMENSION
ALLOCATABLE
COMMON
POINTER
TARGET
The
array-spec
(see Syntax, above) determines the category of the array being declared.
Array declarations” on page 59, describes these categories as:
Explicit-shape array
Assumed-shape array
Assumed-size array
Deferred-shape array
Examples
! These 2 declaration statements are equivalent.
REAL a (20,2), b (20,2), c (20,2)
REAL, DIMENSION (20,2) :: a, b, c
DIMENSION x(100), y(100) ! x and y are 1-dimensional
! lower bounds specified for jj (if not given, they default to 1)
INTEGER jj (0:100, -1:1)
! l is a 4-dimensional, allocatable, deferred shape logical array
LOGICAL l
ALLOCATABLE l(:,:,:,:)
COMPLEX s ! s has explicit shape and
TARGET :: s(10,2) ! the target attribute
DOUBLE PRECISION d
! d has 5 dimensions and is declared in common
COMMON /stuff/ d(2,3,5,9,8)
! arr1 is an adjustable array, arr2 an automatic array
SUBROUTINE calc(arr1, ib1, ib2)
REAL, DIMENSION (ib1, ib2) :: arr1, arr2
! arr3 is a deferred-shape array with the pointer attribute
REAL, POINTER, DIMENSION(:,:) :: arr3
! all three arrays have explicit shape; array specifier (10,10)