MAXVAL — Maximum value of an array#
-
MAXVAL(ARRAY, MASK)#
Determines the maximum value of the elements in an array value, or, if the
DIMargument is supplied, determines the maximum value along each row of the array in theDIMdirection. IfMASKis present, only the elements for whichMASKis.TRUE.are considered. If the array has zero size, or all of the elements ofMASKare.FALSE., then the result is-HUGE(ARRAY)ifARRAYis numeric, or a string of nulls ifARRAYis of character type.- Parameters:
ARRAY – Shall be an array of type
INTEGERorREAL.DIM – (Optional) Shall be a scalar of type
INTEGER, with a value between one and the rank ofARRAY, inclusive. It may not be an optional dummy argument.MASK – (Optional) Shall be of type
LOGICAL, and conformable withARRAY.
- Returns:
If
DIMis absent, or ifARRAYhas a rank of one, the result is a scalar. IfDIMis present, the result is an array with a rank one less than the rank ofARRAY, and a size corresponding to the size ofARRAYwith theDIMdimension removed. In all cases, the result is of the same type and kind asARRAY.
- Standard:
Fortran 90 and later
- Class:
Transformational function
- Syntax:
RESULT = MAXVAL(ARRAY, DIM [, MASK]) RESULT = MAXVAL(ARRAY [, MASK])
- See also: