Returns the upper bounds of an array, or a single upper bound along the
result = ubound(array [, dim [, kind]])
array- Shall be an array, of any type.
dim- (Optional) Shall be a scalar
kind- (Optional) An
integerinitialization expression indicating the kind parameter of the result.
The return value is of type
integer and of kind
kind is absent, the return value is of default integer kind. If
dim is absent, the result is an array of the upper bounds of
dim is present, the result is a scalar corresponding to the upper bound of the array along that dimension. If
array is 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.