UBOUND — Upper dimension bounds of an array#
-
UBOUND(ARRAY, DIM, KIND)#
Returns the upper bounds of an array, or a single upper bound along the
DIMdimension.- Parameters:
ARRAY – Shall be an array, of any type.
DIM – (Optional) Shall be a scalar
INTEGER.KIND – (Optional) An
INTEGERinitialization expression indicating the kind parameter of the result.
- Returns:
The return value is of type
INTEGERand of kindKIND. IfKINDis absent, the return value is of default integer kind. IfDIMis absent, the result is an array of the upper bounds ofARRAY. IfDIMis present, the result is a scalar corresponding to the upper bound of the array along that dimension. IfARRAYis an expression rather than a whole array or array structure component, or if it has a zero extent along the relevant dimension, the upper bound is taken to be the number of elements along the relevant dimension.
- Standard:
Fortran 90 and later, with
KINDargument Fortran 2003 and later- Class:
Inquiry function
- Syntax:
RESULT = UBOUND(ARRAY [, DIM [, KIND]])
- See also:
LBOUND — Lower dimension bounds of an array, LCOBOUND — Lower codimension bounds of an array