netcdf output file cannot be open

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
seashellingolds
Posts: 39
Joined: Wed Jun 25, 2008 2:49 am
Location: Georgia Institute of Technology

netcdf output file cannot be open

#1 Unread post by seashellingolds »

Hi All

I ve recently got two problems with ROMS output.

1. I have a climatology forcing run which saves the record every 15 days. After starting from the 15th day, it blows up immediately after saving the first record. Then I restart the model, it blows up exactly just after saving the next record. Something like this:

8641 45 00:05:00 NaN NaN NaN NaN

All output fields look reasonable.

2. Another thing is related to the latest version of ROMS. I had an old run to test it. It turned out that the output ncfile cannot be opened (snctool, it complained this is not a netcdf file), but I can see there are data in by ncdump. I still use a very old netcdf 3.6.0.

Has anybody happened to meet such kinds of problems? or tell me how to debug this kind of problem?

Thanks a bunch
Last edited by seashellingolds on Wed Mar 14, 2012 7:00 pm, edited 1 time in total.

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: blow up everytime after writing the record

#2 Unread post by kate »

1. I would ask it to write a restart file after 1 or 2 steps. If that blows up, run in a debugger to see what is going on with your ocean fields. You don't want to run in a debugger for 8000 steps. I've never had that happen, though.

2. You admit to having an old version of netcdf - what versions of snctools and ROMS do you have? Old versions of netcdf should still have created files that the new tools can read - tools generally get more accepting in that they should read old and new formats. Could snctools read the old files at the time you wrote them? Or is it that it isn't reading the new files?

seashellingolds
Posts: 39
Joined: Wed Jun 25, 2008 2:49 am
Location: Georgia Institute of Technology

Re: blow up everytime after writing the record

#3 Unread post by seashellingolds »

Thank you for your reply Kate.
Things are getting more complicated.
Q1: It turned out to be some MPI problem I think. My grid size is 464*194. If I set NtileI=8 and NtileJ=1, it blows up with NaN. If NtileI=4 and NtileJ=2, it doesnt......

seashellingolds
Posts: 39
Joined: Wed Jun 25, 2008 2:49 am
Location: Georgia Institute of Technology

Re: blow up everytime after writing the record

#4 Unread post by seashellingolds »

kate wrote:2. You admit to having an old version of netcdf - what versions of snctools and ROMS do you have? Old versions of netcdf should still have created files that the new tools can read - tools generally get more accepting in that they should read old and new formats. Could snctools read the old files at the time you wrote them? Or is it that it isn't reading the new files?
The Changelog in the snctools shows "January 12 2012 John Evans <john.g.evans.ne@gmail.com> -r3958". I think it is very new. I just install the latest version of netcdf (4.1.3) but the problem is still there.

??? Error using ==> snctools/private/nc_varget_mexnc
Not a netCDF file

Error in ==> nc_vargetr at 42
[data,info] = nc_varget_mexnc(ncfile,varname,varargin{:});

Error in ==> nc_varget at 35
[data,info] = nc_vargetr(ncfile,varname,varargin{:});

And old netcdf toolbox gives similar error
## NetCDF file not opened: aaa-his.nc

I ve been using the old netcdf toolbox and this version of snctools for a while. No problem with old files (generated by ROMS revision 57x). It just kick in with this new ROMS output (svn: $LastChangedRevision: 606 $)

Is there anybody else using this new revision?

seashellingolds
Posts: 39
Joined: Wed Jun 25, 2008 2:49 am
Location: Georgia Institute of Technology

Re: blow up everytime after writing the record

#5 Unread post by seashellingolds »

tried serial and the same problem...

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: netcdf output file cannot be open

#6 Unread post by kate »

So it's the output from the new ROMS that you can't read? I guess you didn't accidentally get netcdf4 files if you were using the netcdf3 library.

When you say "saves the record every 15 days", what kind of output file are you talking about? Could you maybe download new copies of WRT_AVG.F and friends? If these are averages, do history files work? Restart files? Station files?

seashellingolds
Posts: 39
Joined: Wed Jun 25, 2008 2:49 am
Location: Georgia Institute of Technology

Re: netcdf output file cannot be open

#7 Unread post by seashellingolds »

kate wrote:So it's the output from the new ROMS that you can't read? I guess you didn't accidentally get netcdf4 files if you were using the netcdf3 library.

When you say "saves the record every 15 days", what kind of output file are you talking about? Could you maybe download new copies of WRT_AVG.F and friends? If these are averages, do history files work? Restart files? Station files?
Thanks Kate. The first problem posted in my first thread turned out to be a MPI issue. I changed the tile number and it was fixed.

The second problem is related to the latest ROMS I just checked out maybe a week ago. Everything is brandnew but the output cannot be opened by snctool or netcdf-toolbox (at least 4 type of output, his, avg, rst, dia) Do I need to check station files? I ve never used this before. I ll look what the station means....
And, NETCDF4 is off

User avatar
arango
Site Admin
Posts: 1347
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: netcdf output file cannot be open

#8 Unread post by arango »

I think that your problem is with the SNCTOOLS package for your version of Matlab. Perhaps, you need to update the SNCTOOLS interface from the SVN repository at SourceForge: https://mexcdf.svn.sourceforge.net/svnroot/mexcdf.

If you can do an ncdump in the file created by ROMS and see the variables, the NetCDF file is correct. Now are you creating a classic NetCDF file or a HDF5 file? That's your choice. The HDF5 file is created via parallel I/O.

seashellingolds
Posts: 39
Joined: Wed Jun 25, 2008 2:49 am
Location: Georgia Institute of Technology

Re: netcdf output file cannot be open

#9 Unread post by seashellingolds »

Thanks Hernan. Finally got it right... and yes it is the version issue.
I was using MATLAB 7.0 (old enough) which cannot open the netcdf output files no matter what version of snctool I use (tried the original old one and the newest one).
I just switched to 7.13 and it is working! So do we have changes in the new ROMS code about netcdf?

Thanks you all very much.

User avatar
arango
Site Admin
Posts: 1347
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: netcdf output file cannot be open

#10 Unread post by arango »

All the information that you seek is painfully and clearly discussed previously in this forum. I would never make a radical change to ROMS without explaining carefully and in detail in my release postings or the svn repository trac system. None of us have much time to answer everybody questions. Usually the information is here in the forum or in WikiROMS. For example, you can read the following :arrow: posting.

Notice that there are threads in this forum for my exclusive use. The reason for it is that users can find the important information right away and do not have to filter thousands of postings in this forum.

Post Reply