LBOUND intrinsic function

Standard: F77 F90 F95 F2003 F2008 Example program


<Syntax>

LBOUND ( ARRAY [ , DIM , KIND ] )

ARRAY : array of any type and rank N;
DIM : scalar Integer in the range 1 to N;
KIND : scalar Integer constant expression;

Result : Integer or Integer(Kind=KIND).

<Semantics>

If DIM appears, the result is scalar, being the value of the lower bound of that dimension of ARRAY. If DIM does not appear, the result is a vector of length N containing all the lower bounds of ARRAY. The actual argument for DIM must not itself be an optional dummy argument.

If the array is not a variable, or is an array section, the lower bounds are considered to be 1. Also, the lower bound of any dimension with zero extent is considered to be 1.

In Fortran 2003, the KIND argument should be used when the lower bound might not be representable in the default Integer kind.

<Related>

DIMENSION attribute, SHAPE intrinsic function, SIZE intrinsic function, UBOUND intrinsic function