HP Fortran Programmer's Reference (September 2007)

Intrinsic procedures
Intrinsic procedure speciļ¬cations
Chapter 11628
The same value for ISEED generates the same sequence of random numbers. To vary the
sequence, call SRAND with a different ISEED value each time the program is executed. The
default for ISEED is 1.
SUM(ARRAY, DIM, MASK)
Optional arguments
DIM, MASK
Description
Sum all the elements of ARRAY along dimension DIM corresponding to the .TRUE. elements of
MASK.
Class
Transformational function.
Arguments
ARRAY must be of type integer, real, or complex. 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 of
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 SUM(ARRAY) has a value equal to a processor-dependent
approximation to the sum of all the elements of ARRAY or has the value zero
if ARRAY has size zero.