Description: | Returns the total number of elements in an array, or the extent of an array along a specified dimension. | ||
Class: | Inquiry function; Generic | ||
Arguments: | ARRAY | Must be an array (of any data type). It must not be a disassociated pointer or an allocatable array that is not allocated. It can be an assumed-size array if DIM is present with a value less than the rank of ARRAY. | |
DIM (opt) | Must be a scalar integer with a value in the range 1 to n, where n is the rank of ARRAY. | ||
Results: | The result is a scalar of type integer. If DIM is present, the result is the extent of dimension DIM in ARRAY; otherwise, the result is the total number of elements in ARRAY. |
Examples
If B is declared as B(2:4, -3:1), then SIZE (B, DIM=2) has the value 5 and SIZE (B) has the value 15.