| New Reply |
Gfortran/f90 (MinGW) namelist eof? |
Share Thread |
| Apr28-12, 04:42 PM | #1 |
|
|
Gfortran/f90 (MinGW) namelist eof?
I've written a small f90 program to read and write a file using namelists in Windows, MinGW. I've never tried this before.
I entered the name list using notepad. The name input namelist file looks like: &WW_ANML aname="John Doe", age=44 Whenever I try to read it I get an eof indication. Do I need some special eof marker at the end of line? |
| Apr28-12, 05:33 PM | #2 |
|
Recognitions:
|
eof means end-of-file.
When you read the number 44, your program tries to read another digit, but finds the end of the file, which it indicates. Try to put a new line at the end of the line. That will explain to your program that there is no other digit coming, without triggering the end-of-file indicator. |
| Apr28-12, 06:27 PM | #3 |
|
|
Thanks for your response.
I tried a CR. I'm using Win7. It didn't work. I just happened to realize that I had used a 8 character string in the program, but in reality used a much longer name than John Doe. I boosted the 8 to 25. That fixed it. Well, my next namelist challenge will be to read 2-dim arrays. I think the numerical data comes in a column at a time from a namelist to get into a (n,2) array. |
| New Reply |
Similar discussions for: Gfortran/f90 (MinGW) namelist eof?
|
||||
| Thread | Forum | Replies | ||
| cuda for gfortran ? | Programming & Comp Sci | 4 | ||
| using a batch file to create NAMELIST input file for FORTRAN | Programming & Comp Sci | 0 | ||
| Adding an icon in mingw? | Programming & Comp Sci | 5 | ||
| MinGW/MSYS problem with search path | Programming & Comp Sci | 2 | ||
| Unusual Compiler Error (using Dev-C++ Mingw) | Programming & Comp Sci | 3 | ||