On Fri, 31 Mar 2000, Jose Marin wrote:
> On Fri, 31 Mar 2000, Malcolm Cohen wrote:
>
> > *automatic arrays* are deallocated on exit - they cannot be treated as SAVEd
> > (the size may vary from one invocation of the procedure to the next, and is
> > not known at compile-time in any case).
>
> I see, it makes sense. But then I wonder what other copilers do, see for
> example g77: [taken from the info manual]
>
> `-fno-automatic'
> Treat each program unit as if the `SAVE' statement was specified
> for every local variable and array referenced in it. Does not
> affect common blocks. (Some Fortran compilers provide this option
> under the name `-static'.)
>
> This seems to imply that this compiler switch forces all automatic objects
> to be allocated on the heap, and not deallocated on exit from the
> subroutine in question. Am I over-interpreting too much here?
>
> If that were the case, I see the problem: how do they treat cases where
> different invocations of the same subroutine would need an automatic array
> of different sizes? What gives?
>
>
> Jose
> --
> Jose L Marin [log in to unmask]
> Dept of Mathematics [log in to unmask]
> Heriot-Watt University
> Edinburgh EH14 4AS, U.K.
> Phone: +44 131 451 3717
> Fax: +44 131 451 3249
>
>
Note that g77 is only a Fortran 77 compiler... and thus does not support
Fortran 90 automatic arrays (or any dynamic allocation at all, as far as
I know). The `-fno-automatic' flag just specifies that the values of
'traditional' local (static) variables shall survive between routine
invocations.
cheers
Henry
=====================================================================
Henry Tillotson e-mail: [log in to unmask]
User Support phone: 0171 380 7827
Information Systems fax: 0171 388 5406
University College London, Gower Street, London WC1 E 6BT
=====================================================================
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|