HP Fortran Programmer's Reference (September 2007)

Intrinsic procedures
Intrinsic procedure speciļ¬cations
Chapter 11 591
Arguments
ARRAY must be of type integer or real. It must not be scalar.
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.
MASK (optional) must be of type logical and must be conformable with ARRAY.
Result type,
type parameters,
and shape
The result is of the same type and kind type parameter as ARRAY.
It is scalar if DIM is absent or ARRAY has rank one; otherwise, the result is an array of rank
n
-1
and of shape (
d
1
,
d
2
, ...,
d
DIM-1
,
d
DIM+1
, ...,
d
n
) where (
d
1
,
d
2
, ...,
d
n
) is the shape of ARRAY.
Result value
Case 1 The result of MAXVAL(ARRAY) has a value equal to the maximum value of all
the elements of ARRAY or has the value of the negative number of the largest
magnitude supported by the processor for numbers of the type and kind type
parameter of ARRAY if ARRAY has size zero.
Case 2 The result of MAXVAL(ARRAY, MASK = MASK) has a value equal to the
maximum value of the elements of ARRAY corresponding to .TRUE. elements
of MASK or has the value of the negative number of the largest magnitude
supported by the processor for numbers of the same type and kind type
parameter as ARRAY if there are no .TRUE. elements.
Case 3 If ARRAY has rank one, MAXVAL(ARRAY, DIM [,MASK]) has a value equal to
that of MAXVAL(ARRAY [,MASK = MASK]). Otherwise, the value of element
(
s
1
,
s
2
, ...,
s
DIM-1
,
s
DIM+1
, ...,
s
n
) of MAXVAL(ARRAY, DIM [,MASK]) is equal
to the following:
MAXVAL(ARRAY(
s
1
,
s
2
, ...,
s
DIM-1
, :,
s
DIM+1
, ...,
s
n
) [, MASK =
MASK(
s
1
,
s
2
, ...,
s
DIM-1
, :,
s
DIM+1
, ...,
s
n
) ] )
MCLOCK()
Description
Return time accounting for a program.