06.03.2014 Views

Intel Fortran Language Reference - NCI National Facility

Intel Fortran Language Reference - NCI National Facility

Intel Fortran Language Reference - NCI National Facility

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3 <strong>Intel</strong> <strong>Fortran</strong> <strong>Language</strong> <strong>Reference</strong><br />

An array has the following properties:<br />

• Data type<br />

An array can have any intrinsic or derived type. The data type of an array (like any other<br />

variable) is specified in a type declaration statement or implied by the first letter of its name.<br />

All elements of the array have the same type and kind parameters. If a value assigned to an<br />

individual array element is not the same as the type of the array, it is converted to the array's<br />

type.<br />

• Rank<br />

The rank of an array is the number of dimensions in the array. An array can have up to seven<br />

dimensions. A rank-one array represents a column of data (a vector), a rank-two array<br />

represents a table of data arranged in columns and rows (a matrix), a rank-three array<br />

represents a table of data on multiple pages (or planes), and so forth.<br />

• Bounds<br />

Arrays have a lower and upper bound in each dimension. These bounds determine the range<br />

of values that can be used as subscripts for the dimension. The value of either bound can be<br />

positive, negative, or zero.<br />

The bounds of a dimension are defined in an array specification.<br />

• Size<br />

The size of an array is the total number of elements in the array (the product of the array's<br />

extents).<br />

The extent is the total number of elements in a particular dimension. It is determined as<br />

follows: upper bound – lower bound + 1. If the value of any of an array's extents is zero, the<br />

array has a size of zero.<br />

• Shape<br />

The shape of an array is determined by its rank and extents, and can be represented as a<br />

rank-one array (vector) where each element is the extent of the corresponding dimension.<br />

Two arrays with the same shape are said to be conformable. A scalar is conformable to an<br />

array of any shape.<br />

The name and rank of an array must be specified when the array is declared. The extent of each<br />

dimension can be constant, but does not need to be. The extents can vary during program<br />

execution if the array is a dummy argument array, an automatic array, an array pointer, or an<br />

allocatable array.<br />

A whole array is referenced by the array name. Individual elements in a named array are<br />

referenced by a scalar subscript or list of scalar subscripts (if there is more than one dimension). A<br />

section of a named array is referenced by a section subscript.<br />

3-36

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!