- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am porting code between linux and win7. The namelist related code below works fine in linux, but gives me this error in windows:
forrtl: severe (24): end-of-file during read, unit 5, file z:\\wna\\postproc\\linux\\ena_gfdl\\ena_gfdl.info, line 21, position 1
I know it should be simple and easy to debug, but it has me stumped. Any insight would be appreciated.
Steve
character (len=80) grid,
* proj,
* date_convention,source,
* version, runtitle, author,
* time_convention, domain, surface,
* srfprefix, atmprefix, radprefix, fname_prefix
logical first,leap,stopflag
namelist /info/ version, runtitle, author,source,
* date_convention,time_convention,
* proj, domain, grid,
* yr1,yr2,leap,drive,surface,
* srfprefix, atmprefix, radprefix, fname_prefix
open(5,file='z:/wna/postproc/linux/ena_gfdl/ena_gfdl.info')
read (5,nml=info)
The namelist file ena_gfdl.info conatins:
&info
version="1.0"
runtitle="GFDL intialized 01/2038"
author="Hostetler"
source="GFDL time-varying boundary conditions"
date_Convention="Calender is noleap"
time_Convention="Serial months beginning 01/2038"
proj="Lambert conformal TruLat N30 and N60 degrees"
domain="ENA domain 251X256 grid points 23 vertical levels"
grid="center lat = N38.00 center long = -77.0 dx = 15000 m"
yr1=2050
yr2=2070
leap=.false.
drive = "/head1/Regional/RegCM/ena_gfdl2x/output/"
surface = "./ena15.dat"
srfprefix = "SRFGF."
atmprefix = "ATMGF."
radprefix = "RADGF."
fname_prefix = "ena_gfdl"
/
forrtl: severe (24): end-of-file during read, unit 5, file z:\\wna\\postproc\\linux\\ena_gfdl\\ena_gfdl.info, line 21, position 1
I know it should be simple and easy to debug, but it has me stumped. Any insight would be appreciated.
Steve
character (len=80) grid,
* proj,
* date_convention,source,
* version, runtitle, author,
* time_convention, domain, surface,
* srfprefix, atmprefix, radprefix, fname_prefix
logical first,leap,stopflag
namelist /info/ version, runtitle, author,source,
* date_convention,time_convention,
* proj, domain, grid,
* yr1,yr2,leap,drive,surface,
* srfprefix, atmprefix, radprefix, fname_prefix
open(5,file='z:/wna/postproc/linux/ena_gfdl/ena_gfdl.info')
read (5,nml=info)
The namelist file ena_gfdl.info conatins:
&info
version="1.0"
runtitle="GFDL intialized 01/2038"
author="Hostetler"
source="GFDL time-varying boundary conditions"
date_Convention="Calender is noleap"
time_Convention="Serial months beginning 01/2038"
proj="Lambert conformal TruLat N30 and N60 degrees"
domain="ENA domain 251X256 grid points 23 vertical levels"
grid="center lat = N38.00 center long = -77.0 dx = 15000 m"
yr1=2050
yr2=2070
leap=.false.
drive = "/head1/Regional/RegCM/ena_gfdl2x/output/"
surface = "./ena15.dat"
srfprefix = "SRFGF."
atmprefix = "ATMGF."
radprefix = "RADGF."
fname_prefix = "ena_gfdl"
/
Link Copied
11 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Add "implicit none" to your program, and you will see what the error is (assuming that you have shown all the relevant declarations that you have). Because of the bug, the program that you gave above crashed on Linux, as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I use implicit none in all of my codes, sorry I forgot to include that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In that case, the compiler would have guided you into adding a declaration for drive as a character*80 variable and, perhaps, declaring yr1 and yr2 as integer. With that change made, the code runs fine in Linux and on WIndows 7-x64, after renaming the input file suitably.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Another oversight on my part, drive is declared many lines above the lines I included:
character yr_name(nyravg)*4, buffer*4, drive*80
As I mentioned in my first post, this code has been running fine on our linux machines. It also runs fine in win7 when I copy the namelist file into the code instead of trying to read it from the file. Thank you for help.
character yr_name(nyravg)*4, buffer*4, drive*80
As I mentioned in my first post, this code has been running fine on our linux machines. It also runs fine in win7 when I copy the namelist file into the code instead of trying to read it from the file. Thank you for help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you tried with the input character strings delimited by single-quotes. I seem to recall having issues with single and double quotes before.
David
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
David-- yes, single, double, commas/no commas at the end of the lines.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To make things simpler for us, would you please attach a short but complete source that shows the problem? Also attach a text file that contains the data you are reading. Pasting into the forum sometimes creates oddities.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can't reproduce a problem with these files (I edited the filename but made no other changes.)
My guess is that the data file does not reside at the location specified in the program and therefore the default STATUS='UNKNOWN' created an empty file there. When the empty file is read, you naturally get an EOF error. This happens to a lot of people.
My guess is that the data file does not reside at the location specified in the program and therefore the default STATUS='UNKNOWN' created an empty file there. When the empty file is read, you naturally get an EOF error. This happens to a lot of people.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your help, Steve. But alas, the file is in the expected location. I will return to this when I have some time-- I'm determined to figure out what simple error I am making. Thanks again.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Make sure that the file in "the expected location" is the one you want. It may be empty.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page