]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/fortran/doc/gfortran/intrinsic-procedures/ubound.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / fortran / doc / gfortran / intrinsic-procedures / ubound.rst
1 ..
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.
5
6 .. index:: UBOUND, array, upper bound
7
8 .. _ubound:
9
10 UBOUND --- Upper dimension bounds of an array
11 *********************************************
12
13 .. function:: UBOUND(ARRAY , DIM , KIND)
14
15 Returns the upper bounds of an array, or a single upper bound
16 along the :samp:`{DIM}` dimension.
17
18 :param ARRAY:
19 Shall be an array, of any type.
20
21 :param DIM:
22 (Optional) Shall be a scalar ``INTEGER``.
23
24 :param KIND:
25 (Optional) An ``INTEGER`` initialization
26 expression indicating the kind parameter of the result.
27
28 :return:
29 The return value is of type ``INTEGER`` and of kind :samp:`{KIND}`. If
30 :samp:`{KIND}` is absent, the return value is of default integer kind.
31 If :samp:`{DIM}` is absent, the result is an array of the upper bounds of
32 :samp:`{ARRAY}`. If :samp:`{DIM}` is present, the result is a scalar
33 corresponding to the upper bound of the array along that dimension. If
34 :samp:`{ARRAY}` is an expression rather than a whole array or array
35 structure component, or if it has a zero extent along the relevant
36 dimension, the upper bound is taken to be the number of elements along
37 the relevant dimension.
38
39 Standard:
40 Fortran 90 and later, with :samp:`{KIND}` argument Fortran 2003 and later
41
42 Class:
43 Inquiry function
44
45 Syntax:
46 .. code-block:: fortran
47
48 RESULT = UBOUND(ARRAY [, DIM [, KIND]])
49
50 See also:
51 :ref:`LBOUND`,
52 :ref:`LCOBOUND`