IS_CONTIGUOUS(ARRAY) (Fortran 2008)

Purpose

Tests contiguity of an array.

Class

Inquiry function

Argument type and attributes

ARRAY
An INTENT(IN) argument of any type. The actual argument corresponding to ARRAY must be an array TS beginsor an assumed-rank object TS endsof any type. If the actual argument is a pointer, it must be associated.

Result type and attributes

Default logical scalar

Result value

Returns .TRUE. if ARRAY is contiguousTS begins or has rank zeroTS ends. Otherwise, returns .FALSE.

Examples

INTEGER, POINTER :: ap(:)
INTEGER, TARGET :: targ(10)
ap => targ(1:10:2)
PRINT *, IS_CONTIGUOUS(ap)       ! IS_CONTIGUOUS(ap) returns the .FALSE. value.