XL Fortran for AIX 8.1

Language Reference


SHAPE(SOURCE)

Returns the shape of an array or scalar.

SOURCE
is an array or scalar of any data type. It must not be a disassociated pointer, allocatable object that is not allocated, or assumed-size array.

Class

Inquiry function

Result Value

The result is a one-dimensional default integer array whose elements define the shape of SOURCES. The extent of each dimension in SOURCES is returned in the corresponding element in the result array.

Related Information

RESHAPE(SOURCE, SHAPE, PAD, ORDER).

Examples

! A is the array  | 7 6 3 1 |
!                 | 2 4 0 9 |
!                 | 5 7 6 8 |
!
       RES = SHAPE( A )
! The result is | 3  4 | because A is a rank-2 array
! with 3 elements in each column and 4 elements in
! each row.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]