g77 large array
Dale Johannesen
dalej@apple.com
Wed Oct 15 17:58:00 GMT 2003
On Tuesday, October 14, 2003, at 08:00 PM, Robert Dewar wrote:
>> In this case, two arrays do not need memory at the same time.
>> Cannot SUBROUTINE B use the same memory area as A in Fortran compiler,
>> even if I do not declare explicitly COMMON I?
>
> Usually convention in Fortran is to allocate all storage statically.
> So indeed
> one would not expect these two arrays to overlap. I am not sure about
> the current
> Fortran standard, but earlier Fortran standards certainly *allowed*
> stack allocation
> of such arrays, but in practice, static allocation (also certainly
> allowed) was
> so standard, that all compilers do static allocation.
Actually, most modern Fortran compilers have a switch to control this.
g77 documents
-fautomatic to do what you want. I haven't tried it; the doc also
claims it is the default, so
it may not be working right in your environment, or it may have some
limit on how much
stack space it will allocate.
More information about the Gcc
mailing list