FORTRAN Reference Manual
Language Elements
FORTRAN Reference Manual—528615-001
2-18
Storage Order
To find the position of EMPLOYEE(-2, 7, 3) in the array EMPLOYEE(-5:5, 8, 5):
pos = 1 + (-2 -(-5))
+ (7 - 1) * 11
+ (3 - 1) * 11 * 8
pos = 1 + 3 + 66 + 176
pos = 246
The following example shows how to find the position of a character in a character
array. For example, to find ADDRESS(1, 52), you first determine the array element in
which the character appears:
CHARACTER*10 address(2,100)
array-element = 1 + (1 - 1)
+ (52 - 1) * 2
array-element = 103
Figure 2-2. Storage Order of Array Elements
VST0202.vsd
Plane 1
1,1,1
2,3,1
1,3,1
2,2,1
1,2,1
2,1,1
1,2,1
2,1,2
1,2,2
2,2,2
1,3,2
2,3,2
1,1,4
2,1,3
1,2,3
2,2,3
1,3,3
2,3,3
1,1,3
2,1,4
1,2,4
1,2,4
1,3.4
2,3,4
Plane 2 Plane 3 Plane 4










