## UCOBOUND intrinsic function

### Standard: F77 F90 F95 F2003 F2008 Example program

### ＜Syntax＞

UCOBOUND ( COARRAY [ , DIM , KIND ] )

COARRAY : coarray of any type and corank *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 upper cobound of that codimension of COARRAY.
If DIM does not appear, the result is a vector of length *N* containing all the upper cobounds of COARRAY.
The actual argument for DIM must not itself be an optional dummy argument.

Note that if COARRAY has corank *N*>1, and the number of images in the current execution is not an integer multiple of the coextents up to codimension *N*−1, the images do not make a full rectangular pattern.
In this case, the value of the last upper cobound is the maximum value that a cosubscript can take for that codimension; e.g. with a coarray-spec of `[1:3,1:*]`

and four images in the execution, the last upper cobound will be equal to 2 because the cosubscripts `[1,2]`

are valid even though `[2,2]`

and `[2,3]`

are not.