[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Malloc in FORTRAN? (reprise)
- Subject: Re: Malloc in FORTRAN? (reprise)
- Date: Mon, 13 May 1996 09:07:25 -0600
Hi Craig,
> Since last talking with you, I've learned that FORTRAN-90
> supports dynamic memory allocation. Here's how my F90 book
> demonstrates the syntax for allocatable arrays:
>
> REAL, DIMENSION(:,:), ALLOCATABLE::A
>
> Read (*,*) idim, jdim ! Read in array dimensions
> c ! from user input.
> ALLOCATE ( A(idim,jdim) ) ! Allocate heap space.
>
> Do j = 1, jdim
> Do i = 1, idim
> A(i,j) = ... ! Do something with the array.
> End Do
> End Do
>
> DEALLOCATE ( A ) ! Array no longer needed;
> c ! recover storage.
>
> So, F90 seems to have aquired a lot of the functionality of C.
>
> I wonder if there are plans for support of F90 by NetCDF?
Yes, that's on our list. Version 3 of netCDF will probably include a new
Fortran interface (in addition to support for the current interface) that
has longer names and a Fortran-90 interface block to catch type errors at
compile time.
But we'll have to support the Fortran 77 interface for as long as programs
still use it.
--Russ