Re: double precision g77
- From: Ron Shepard <ron-shepard@xxxxxxxxxxxxxxxxxx>
- Date: Thu, 24 Aug 2006 12:16:12 -0500
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
.
- References:
- double precision g77
- From: Richard Pitman
- Re: double precision g77
- From: Richard Maine
- Re: double precision g77
- From: Brooks Moses
- Re: double precision g77
- From: Richard Pitman
- Re: double precision g77
- From: Tim Prince
- Re: double precision g77
- From: Richard E Maine
- Re: double precision g77
- From: glen herrmannsfeldt
- Re: double precision g77
- From: Tim Prince
- Re: double precision g77
- From: Brooks Moses
- Re: double precision g77
- From: kilter
- double precision g77
- Prev by Date: Re: double precision g77
- Next by Date: Re: draw random number from array
- Previous by thread: Re: double precision g77
- Next by thread: Re: double precision g77
- Index(es):
Relevant Pages
|