carbontrek
Programmer
Hi All,
I'm doing some self study from a book written by Brian Hahn (Fortran 90 for Scientists and Engineers).
There is a section that is particularly talking about reading data from text files.
I'm on a mac and compiling using gfortran filename.f90[/b] then running ./a.out on the following:
PROGRAM Practice
OPEN (1, FILE = 'DATA')
READ(1, *) A, B, C
PRINT*, A, B, C
END PROGRAM Practice
So using text edit I saved a file (DATA) with the line 3 4 5.
When I try to run this, I get a runtime error: end of file
I would like to figure out how I'm actually supposed to do this since the rest of the book problems are reading in files like this.
I'm doing some self study from a book written by Brian Hahn (Fortran 90 for Scientists and Engineers).
There is a section that is particularly talking about reading data from text files.
I'm on a mac and compiling using gfortran filename.f90[/b] then running ./a.out on the following:
PROGRAM Practice
OPEN (1, FILE = 'DATA')
READ(1, *) A, B, C
PRINT*, A, B, C
END PROGRAM Practice
So using text edit I saved a file (DATA) with the line 3 4 5.
When I try to run this, I get a runtime error: end of file
I would like to figure out how I'm actually supposed to do this since the rest of the book problems are reading in files like this.