Re: a.out file



wiggy13 wrote:
There is a reason to this. I got many files that need to be read as
inputs.

a.out < infile would do the job without modifiy the source code.


Maybe this is just a misunderstanding about what "infile" is?

Forgive me if you already know this but
a.out < infile
does *not* translate to
"open a file called 'infile' in my program"
What it means is to take the _contents_ of the file called "infile" and pass that to the Fortran program.


Let's say you want to process a file called "mydata.dat". Then you would create your "infile" like so (or variants thereof):

unix: echo mydata.dat > infile
unix: cat infile
mydata.dat
unix: a.out < infile

This will then pass the string "mydata.dat" to your program's READ statement.

Like I said, if you already knew this: apologies.

cheers,

paulv

--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC

.