ABSTRACT

The matrix arithmetic subprograms we discussed in §6.1 and §6.3 were for 10 x 10 matrices and 10-element vectors, so the MATKNS and DDOT routines we wrote dimensioned their dummy arguments that way. If tomorrow we need to transpose an array that is, say, 20 x 30 instead, or to find the dot product of 50-element vectors, we can simply modify the source code of the affected routine to use the new dimensions, and recompile it. However, if in a single program we want to use MATRNS or DDOT repeatedly to process arrays having several different sizes, we need some way to have the dimensions inside the subprogram change from one invocation to the next. In this Chapter we will see how FORTRAN makes that possible.