Re: Allocating arrays inside a subroutine.
- From: beliavsky@xxxxxxx
- Date: 29 Aug 2006 07:02:39 -0700
Timothy Hume wrote:
Hi,
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:
SUBROUTINE READ_DATA(FILENAME, DATA_ARRAY)
CHARACTER(LEN=128), INTENT(IN) :: FILENAME
REAL, DIMENSION(:), INTENT(OUT) :: DATA_ARRAY
.
.
.
END SUBROUTINE READ_DATA
Minor point -- I suggest declaring FILENAME as
CHARACTER(LEN=*), INTENT(IN) :: FILENAME
because it does not rely on the passed FILENAME having exactly 128
characters. This was discussed in the message
From: Richard Maine <nos...@xxxxxxxxxxxxx>
Newsgroups: comp.lang.fortran
Subject: Re: variable length strings
Date: 18 Aug 2004 13:42:25 -0700
.
- References:
- Allocating arrays inside a subroutine.
- From: Timothy Hume
- Allocating arrays inside a subroutine.
- Prev by Date: Re: closing unit=5 and unit=6 and print *
- Next by Date: Re: closing unit=5 and unit=6 and print *
- Previous by thread: Re: Allocating arrays inside a subroutine.
- Next by thread: Re: Allocating arrays inside a subroutine.
- Index(es):
Relevant Pages
|