2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
6 .. index:: MINVAL, array, minimum value, minimum value
10 MINVAL --- Minimum value of an array
11 ************************************
13 .. function:: MINVAL(ARRAY , MASK)
15 Determines the minimum value of the elements in an array value, or, if
16 the :samp:`{DIM}` argument is supplied, determines the minimum value along
17 each row of the array in the :samp:`{DIM}` direction. If :samp:`{MASK}` is
18 present, only the elements for which :samp:`{MASK}` is ``.TRUE.`` are
19 considered. If the array has zero size, or all of the elements of
20 :samp:`{MASK}` are ``.FALSE.``, then the result is ``HUGE(ARRAY)`` if
21 :samp:`{ARRAY}` is numeric, or a string of ``CHAR(255)`` characters if
22 :samp:`{ARRAY}` is of character type.
25 Shall be an array of type ``INTEGER`` or
29 (Optional) Shall be a scalar of type
30 ``INTEGER``, with a value between one and the rank of :samp:`{ARRAY}`,
31 inclusive. It may not be an optional dummy argument.
34 Shall be of type ``LOGICAL``,
35 and conformable with :samp:`{ARRAY}`.
38 If :samp:`{DIM}` is absent, or if :samp:`{ARRAY}` has a rank of one, the result
39 is a scalar. If :samp:`{DIM}` is present, the result is an array with a
40 rank one less than the rank of :samp:`{ARRAY}`, and a size corresponding to
41 the size of :samp:`{ARRAY}` with the :samp:`{DIM}` dimension removed. In all
42 cases, the result is of the same type and kind as :samp:`{ARRAY}`.
48 Transformational function
51 .. code-block:: fortran
53 RESULT = MINVAL(ARRAY, DIM [, MASK])
54 RESULT = MINVAL(ARRAY [, MASK])