What you need to know to use vector subprograms
Fortran storage of arrays
DIMENSION A(N1,N2),B(N3)
EQUIVALENCE (A,B)
where N3 = N1 X N2. Then A(I,J) is associated with the same memory location as B(K) where
K = I + (J−1) ⋅ N1
Successive elements of a column of A are adjacent in memory, while successive elements of a row of A are stored with a difference of N1 storage units between them. Remember that the size of a storage unit depends on the data type.
Fortran array argument association
When a Fortran subprogram is called with an array element as an argument, the value is not passed. Instead, the subprogram receives the address in memory of the element. Consider the following code segment:
REAL A(10,10) J = 3
L = 10
CALL SUBR (A(1,J),L)
.
.
.
SUBROUTINE SUBR (X,N) REAL X(N)
.
.
.
SUBR is given the address of the first element of the third column of A. Because it treats that argument as a
34HP MLIB User’s Guide