next up previous contents
Next: Array Sections Up: Arrays Previous: Conformance   Contents

Array Expressions

In F90 it is possible to build expressions using intrinsic operators and elemental intrinsic functions acting on arrays as variables. All arrays in an array expression must conform. The convention is that intrinsic operations are performed element-by-element (similarly, intrinsic functions applied to arrays act elementwise).

For example,

real, dimension(2,3) :: B, C, D
B = 3.0; C = 4.0
D = sqrt(B**2 + C**2)
will produce a matrix D full of 5's. The meaning of the last (array) statement is that of 6 elemental statements


Note that all six elemental statements are, conceptually, performed in parallel (this may or may not be true, depending on the architecture). In contradistinction, a nested pair of DO loops would produce the same result evaluating the elements of D in a predefined order.

In conclusion, array expressions are evaluated element by element, with no particular ordering implied; conceptually, all elemental operations are performed simultaneously.



Adrian Sandu 2001-08-26