Professional Documents
Culture Documents
Fortran 90 - Arrays
What are Arrays?
There are many examples of problems where
the data that are being considered have a
tabular structure.
Some of the special names given to these
structures include:
✓Linear list.
✓List.
✓Vector.
✓Array.
The term used most often, and in the majority
of books on Fortran programming, is array
1 2 3 4 5
1 6 11 16 21
1 4 10 1 6 2
A= 2 7 12 17 22 Integer A(5,5)
Rows (m)
X = Y;
Z = Y(:,5) – 3.0
Y = Z + 1.0;
Y(3,:) = Z
X(4,:) = Z;
X(5,:) = Z+Y(2,:)
CP 260 Lectures - Fortran Arrays 15
Arrays
Fortran stores higher
dimensional arrays as a
contiguous sequence of
elements Fortran: elements stored in order -
It is important to know [a11 a21 a31 a21 a22 a32 a13 a23 a33 ]
that 2-dimensional
arrays are stored by
column
◦ referred to as column-
major order C: elements stored in order -
◦ C uses row-major order [a11 a12 a13 a21 a22 a23 a31 a32 a33 ]