An expression represents either a data reference or a computation,
and is formed from operators, operands, and parentheses. The
result of an expression is either a scalar value or an array of
scalar values.
If the value of an expression is of intrinsic type, it has a kind
type parameter. (If the value is of intrinsic type CHARACTER, it
also has a length parameter.) If the value of an expression is of
derived type, it has no kind type parameter.
An operand is a scalar or array. An operator can be either
intrinsic or defined. An intrinsic operator is known to the
compiler and is always available to any program unit. A defined
operator is described explicitly by a user in a function subprogram
and is available to each program unit that uses the subprogram.
The simplest form of an expression (a primary) can be any of the
following:
o A constant; for example, 4.2
o A subobject of a constant; for example, 'LMNOP'(2:4)
o A variable; for example, VAR1
o A structure constructor; for example, EMPLOYEE(3472, "JOHN
DOE")
o An array constructor; for example, (/12.0,16.0/)
o A function reference; for example, COS(X)
o Another expression in parentheses; for example, (I+5)
Any variable or function reference used as an operand in an
expression must be defined at the time the reference is executed.
If the operand is a pointer, it must be associated with a target
object that is defined. An integer operand must be defined with an
integer value rather than a statement label value. All of the
characters in a character data object reference must be defined.
When a reference to an array or an array section is made, all of
the selected elements must be defined. When a structure is
referenced, all of the components must be defined.
In an expression that has intrinsic operators with an array as an
operand, the operation is performed on each element of the array.
In expressions with more than one array operand, the arrays must be
conformable (they must have the same shape). The operation is
applied to corresponding elements of the arrays, and the result is
an array of the same shape (the same rank and extents) as the
operands.
In an expression that has intrinsic operators with a pointer as an
operand, the operation is performed on the value of the target
associated with the pointer.
For defined operators, operations on arrays and pointers are
determined by the procedure defining the operation.
A scalar is conformable with any array. If one operand of an
expression is an array and another operand is a scalar, it is as if
the value of the scalar were replicated to form an array of the
same shape as the array operand. The result is an array of the
same shape as the array operand.
The ranking assigned to each numeric intrinsic data type follows:
Data Type Ranking
--------- -------
LOGICAL*1 and BYTE lowest
LOGICAL*2 .
LOGICAL*4 .
LOGICAL*8 .
INTEGER*1 .
INTEGER*2 .
INTEGER*4 .
INTEGER*8 .
REAL (REAL*4) .
REAL*16 .
DOUBLE PRECISION (REAL*8) .
COMPLEX (COMPLEX*8) .
DOUBLE COMPLEX (COMPLEX*16) .
COMPLEX*32 highest
Additional Information:
explode
extract