HP Fortran Programmer's Reference (September 2007)

Intrinsic procedures
Intrinsic procedure specifications
Chapter 11636
Arguments
ARRAY may be of any type. It must not be scalar. It must not be a pointer that is
disassociated or an allocatable array that is not allocated. If ARRAY is an
assumed-size array, DIM must be present with a value less than the rank of
ARRAY.
DIM (optional) must be scalar and of type integer with a value in the range 1 <= DIM <=
n
,
where
n
is the rank of ARRAY. The corresponding actual argument must not
be an optional dummy argument.
Result type,
type parameters,
and shape
The result is of type default integer. It is scalar if DIM is present; otherwise, the result is an
array of rank one and size
n
, where
n
is the rank of ARRAY.
Result value
Case 1 For an array section or for an array expression, other than a whole array or
array structure component, UBOUND(ARRAY, DIM) has a value equal to the
number of elements in the given dimension; otherwise, it has a value equal
to the upper bound for subscript DIM of ARRAY if dimension DIM of ARRAY does
not have size zero and has the value zero if dimension DIM has size zero.
Case 2 UBOUND(ARRAY) has a value whose
i
th component is equal to UBOUND(ARRAY,
i
), for
i
= 1, 2, ...,
n
, where
n
is the rank of ARRAY.
Specific forms
KUBOUND.
UNPACK(VECTOR, MASK, FIELD)
Description
Unpack an array of rank one into an array under the control of a mask.
Class
Transformational function.