Reading an array from a text file into fortran
From: Glyn Edwards (glynedwards_at_fastmail.fm)
Date: 10/22/04
- Next message: Michael Metcalf: "Re: Reading an array from a text file into fortran"
- Previous message: FCC: "Re: system calls in g95"
- Next in thread: Michael Metcalf: "Re: Reading an array from a text file into fortran"
- Reply: Michael Metcalf: "Re: Reading an array from a text file into fortran"
- Reply: jan van oosterwijk: "Re: Reading an array from a text file into fortran"
- Reply: beliavsky_at_aol.com: "Re: Reading an array from a text file into fortran"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 22 Oct 2004 10:57:54 +0100
Hi, I have what I hope is a simple question
in fortran 95 is there a simple way to read in data of the following form
into an array?
N 2
M 4
1.2 3.4 5.6 7.8
9.0 2.3 6.5 8.7
Ideally I'd like to read in N, M (I can do that) allocate an array such
that it has dimensions a(N,M) and then read in the values below into
the array like
a(1,1) a(1,2) a(1,3) a(1,4)
a(2,1) a(2,2) a(2,3) a(2,4)
I can't see how best to set up a read statement to fill in the array when
I have to read in the value of M at run time.
Any thoughts
Thanks
Glyn
- Next message: Michael Metcalf: "Re: Reading an array from a text file into fortran"
- Previous message: FCC: "Re: system calls in g95"
- Next in thread: Michael Metcalf: "Re: Reading an array from a text file into fortran"
- Reply: Michael Metcalf: "Re: Reading an array from a text file into fortran"
- Reply: jan van oosterwijk: "Re: Reading an array from a text file into fortran"
- Reply: beliavsky_at_aol.com: "Re: Reading an array from a text file into fortran"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|