Re: double precision g77



In article <1156434189.889041.35780@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
"kilter" <richard.pitman3@xxxxxxxxxxxxxxx> wrote:

By the way, the use of a lower bound when dimensioning the limit vector
is to allow the routine to be called by a C program, which as I am sure
you know defaults to a lower bound of 0.

It is not that C "defaults" to a lower bound of 0, that is the only
way that arrays are referenced in C. In fortran, by contrast, the
lower bound can be specified to fit the problem. The "Numerical
Recipes in C" book attempted to overcome this fault in the C
language by doing tricks with pointer offsets, but this results in
illegal C code (which happens to work on most machines anyway, but
that is a separate issue).

Also, the lower bound in a subprogram has nothing to do with the
lower bound in the calling program, whether that calling program is
written in fortran or C. The same idea holds for row-major or
column-major indexing of multidimensional arrays. As long as the
array in both languages maps to the same physical memory layout, you
can call fortran subprograms from C without needing to shift the
lower bound or transpose the array beforehand.

$.02 -Ron Shepard
.