lbound

Date:

10-12-2011

NAME

LBOUND - Returns all the lower bounds or a specified lower bound of an array

SYNOPSIS

LBOUND ([ARRAY=]array [,[DIM=]dim] [,[KIND=]kind])

IMPLEMENTATION

Cray Linux Environment (CLE)

STANDARDS

Fortran

DESCRIPTION

The LBOUND intrinsic function returns all the lower bounds or a specified lower bound of an array. It accepts the following arguments:

array

May be of any type. It must not be scalar. It must not be a pointer that is disassociated or an allocatable array that is not allocated.

dim

Must be scalar and of type integer with a value in the range 1 <= dim <= n, where n is the rank of array. The corresponding actual argument must not be an optional dummy argument.

kind

Determines the kind type of the return result. If this argument is not specified, the return result is of type default integer. This argument must be a scalar integer initialization expression.

LBOUND is an inquiry function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES

The result is of type integer. It is scalar if dim is present; otherwise, the result is an array of rank 1 and size n, where n is the rank of array.

For an array section or for an array expression, other than a whole array or array structure component, LBOUND (array,dim) has the value 1; otherwise, it has a value equal to the lower bound for subscript dim of array if dimension dim of array does not have size 0 and has the value 1 if dimension dim has size 0.

LBOUND (array) has a value whose ith component is equal to LBOUND (array,i) for i = 1, 2, …, n, where n is the rank of array.

EXAMPLES

Assume that A is declared by the following statement:

REAL A(2:3, 7:10)

The following are true:

  • LBOUND(A) yields [2,7].

  • LBOUND(A,DIM=2) yields 7.