g77 and allocated arrays

Toon Moene toon@moene.indiv.nluug.nl
Mon Jan 20 21:34:00 GMT 2003


Lars Segerlund wrote:

>  Is there any way of using dynamically allocated arrays in g77 ? I have 
> been checking out automatic arrays but havent got the grip on them yet, 
> and according to the doc's the 'f90 extensions' for allocating storage 
> is not supported.

Fortran 90's ALLOCATE and DEALLOCATE is not supported by g77.  g77 does 
do automatic arrays.

An automatic array is an array (in a subprogram) that gets its size from 
a dummy argument of the subprogram, e.g.:

       SUBROUTINE SUB(A,N)
       DIMENSION A(N), B(N)
       ...
       END

Here A is a normal, dummy argument array, whereas B is an automatic 
array that is allocated everytime control enters the subroutine SUB.

Hope this helps,

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://gcc-g95.sourceforge.net/ (under construction)



More information about the Gcc-help mailing list