seagrid2roms and matlab 2010b native matlab netcdf

Report or discuss software problems and other woes

Moderators: arango, robertson

Post Reply
Message
Author
asujrpv

seagrid2roms and matlab 2010b native matlab netcdf

#1 Unread post by asujrpv »

I need your help in solving the following error using seagrid2roms. I think it has to do with netcdf, and looks like matlab 2010b uses its own netcdf tools. I would be grateful if someone can tell me how to solve the following error that I get when running seagrid2roms
>> seagrid2roms('cdw_gridR','cdw_ROMS','ROMS Grid')
## SeaGrid Source File : cdw_gridR
## ROMS Destination File: cdw_ROMS
??? Undefined function or method 'netcdf' for input arguments of type 'char'.

Error in ==> seagrid2roms at 152
nc = netcdf(theRomsFile, 'clobber');

lolhsson
Posts: 23
Joined: Wed Jun 02, 2010 9:07 pm
Location: UC Berkeley

Re: seagrid2roms and matlab 2010b native matlab netcdf

#2 Unread post by lolhsson »

I had to solve this problem recently (admittedly with 2009b, not 2010, but the error is the same). As far as I could find, there seem to be two schools of thought in these forums for how to deal with this particular seagrid2roms issue:

1. Recognize that MATLAB has their own netcdf commands and rewrite seagrid2roms with these new commands; probably the 'better' option in terms of taking advantage of the latest MATLAB code that comes with official support.

2. Recreate the 'old' command environment in which seagrid2roms actually functions:

Download, directly into your MATLAB directory (or one that you can 'Set Path...' to conveniently), the most recent mexnc, snctools and netcdf_toolbox -- bearing in mind that these tools are both outdated and a clunkier solution than just using MATLAB's native commands. On the other hand, these forums have some history of support for errors they generate (enough that I could piece together how to make seagrid2roms work), and seagrid2roms can work with these commands without any internal code alteration required.

rsignell's svn links worked fine for me (thanks, risgnell, especially for the svn for the netcdf_toolbox, since it's no longer directly supported by the mexcdf site):

Code: Select all

svn co http://mexcdf.svn.sourceforge.net/svnroot/mexcdf/mexnc/trunk mexnc
svn co http://mexcdf.svn.sourceforge.net/svnroot/mexcdf/snctools/trunk snctools
svn co http://mexcdf.svn.sourceforge.net/svnroot/mexcdf/netcdf_toolbox/trunk netcdf_toolbox
One additional tip: do a "which mexnc" and make sure it points to the version in the mexnc directory you just downloaded, and not an old one.
I went with option 2 for now, but I hope to rewrite seagrid2roms (or find someone else who has) when I have 'more time'. Ah, time. My old foe.

Hope this helps!

mlicer
Posts: 5
Joined: Tue Jan 26, 2010 4:24 pm
Location: EARS

Re: seagrid2roms and matlab 2010b native matlab netcdf

#3 Unread post by mlicer »

hi,

i've just stumbled upon this post. some time ago i have re-written seagrid2roms for native Matlab 2010 netcdf. i'm attaching the file below. it worked for me (over a year ago) but please check for yourself that it produces ok results.

be good,
m.
Attachments
seagrid2romsM2010a.m
(21.96 KiB) Downloaded 607 times

jkansong
Posts: 5
Joined: Thu May 15, 2014 4:08 pm
Location: University of Michigan

Re: seagrid2roms and matlab 2010b native matlab netcdf

#4 Unread post by jkansong »

I get the following error message when I try to use seagrid2romsM2010a. Any idea what the problem might be?

??? Error using ==> netcdflib
Contiguous data write failed, library error message "NetCDF:
Start+count exceeds dimension bound"

Error in ==> putVar at 75
netcdflib(funcstr,ncid,varid,varargin{:});

Error in ==> seagrid2romsM2010a at 574
netcdf.putVar(ncid,hraw_var_ID,start,count,hraw_data');

User avatar
ngarg
Posts: 19
Joined: Fri Jul 12, 2013 5:46 pm
Location: NTU

Re: seagrid2roms and matlab 2010b native matlab netcdf

#5 Unread post by ngarg »

Hi,

I installed seagrid package to and when i used the seagrid2rom2010a.m, i recieved same error that you got earlier. I was wondering whether you have been able to solve.

appreciate all the help

cheers
nikhil

bingzhang_chen
Posts: 7
Joined: Mon Mar 16, 2015 3:42 pm
Location: Japan Agency for Marine-Earth Science & Tech.

Re: seagrid2roms and matlab 2010b native matlab netcdf

#6 Unread post by bingzhang_chen »

I run into the same problem too. Any suggestions to make it working?

bingzhang_chen
Posts: 7
Joined: Mon Mar 16, 2015 3:42 pm
Location: Japan Agency for Marine-Earth Science & Tech.

Re: seagrid2roms and matlab 2010b native matlab netcdf

#7 Unread post by bingzhang_chen »

I find that it is possibly caused by an error in:

count = [1 Lp Mp];

If changed to:
count = [1 Mp Lp];

Then it works.

Is it true?

machaielder
Posts: 43
Joined: Wed Mar 18, 2015 3:40 pm
Location: Universidade Federal Fluminense

Re: seagrid2roms and matlab 2010b native matlab netcdf

#8 Unread post by machaielder »

dear
not bring any solution to the problem but more of a problem .

I am new to the forum and I have just download the main Roms packages , but not yet started running the model simply because I'm having problems in matlab6 installation.

the error that appears is as follows:
dell@dell-Inspiron-N5110:~$ matlab
dell@dell-Inspiron-N5110:~$ matlab6
/home/dell/Documents/fialho/Matlab6/bin/glnx86/matlab: error while loading shared libraries: /lib/libut.so: cannot read file data: Error 21
dell@dell-Inspiron-N5110:~$
I do not know if anyone of you have had an identical problem or have any TIP another version and how to obtain it .

thank you very much

Post Reply