- Array categories
Fortran 90
provides several categories of arrays: explicit-shape (including
automatic and adjustable), assumed-shape, deferred-shape (including
allocatable and pointer), and assumed-size. They are each described
later in this chapter.
- Whole array processing
Expressions
may contain array operands and be array-valued. They may also contain
array sections, which are array-valued. Function results may also
be array valued. There is no implied order in which the element-by-element
operations are performed. If such operations appear in an assignment
statement where the left-hand side is an array, the effect is as
if the right-hand side were completely evaluated before any part
of the assignment takes place. A scalar may also be used in array
expressions; more details of array expressions appear later in this
chapter.
- Masked array assignment
Certain array elements,
selected by a mask, can be assigned in array assignment statements
using the WHERE
statement or WHERE
construct. For any elemental operation in the assignments, only
the elements selected by the mask participate in the computation.
Masked array assignments are described later in Chapter 5
and under the WHERE
statement in Chapter 10.
- Intrinsic functions
A number of new intrinsic functions
have been provided to manipulate arrays. They are mostly classed
as transformational functions; see Chapter 11 for details.
- Array sections
A selected portion of an array, called an array section,
can be specified. It is then treated as an array in its own right
and can be used as such. The section can be specified by the use
of subscript triplets, vector subscripts, or both.
- Array substrings
It
is possible to attach a substring specifier to the subscript list
of a character array; the result is considered to be an array section,
that (as noted above) is itself an array.
- Array constructors
An array constructor allows an array to be constructed
from a list of scalar values and arrays of any rank. An array constructor
is a one-dimensional array and can be used wherever such an array
is valid. Arrays of higher rank can be constructed by combining
an array constructor with the RESHAPE
intrinsic function.
- Zero-sized arrays
Fortran 90 has introduced the concept
of an array with no elements. These arrays are known as zero-sized
arrays and allow certain algorithms to be written naturally without
having to allow for edge conditions; more details are given later
in this chapter.