Re: Allocating arrays inside a subroutine.

Tim: A couple years ago Mike Metcalf posted an example of allocating
a global array, the actual allocation being done via a subprogram.
See the code at:

Skip Knoble

On Tue, 29 Aug 2006 16:39:48 +1000, Timothy Hume <T.Hume@xxxxxxxxxx> wrote:

-|I'm wondering if someone could point me in the right direction with this
-|problem. I'm a new Fortran 90/95 user, but am familiar with 77.
-|I want to create a Fortran 90 subroutine that reads data from a file, and
-|returns it in an array, which is one of the arguments to the subroutine.
-|Something like this:
-|I don't know in advance how big DATA_ARRAY needs to be ... I can only tell
-|once I've opened up FILENAME and read some header records. At first I
-|thought I could do this by passing an unallocated array to the subroutine,
-|and then allocate the array inside the subroutine once the appropriate
-|header records that inform me how much data there are have been read.
-|However, I have found that you can't pass unallocated arrays to subroutines.
-|I'm sure this must be a common problem?
-|Any tips would be appreciated.
-|Tim Hume
-|Bureau of Meteorology Research Centre