Error using Matlab tools provided by ROMS

Discussion about analysis, visualization, and collaboration tools and techniques

Moderators: arango, robertson

Post Reply
Message
Author
aearamos
Posts: 11
Joined: Fri Nov 12, 2010 7:22 pm
Location: Texas A&M University

Error using Matlab tools provided by ROMS

#1 Unread post by aearamos »

Hi,

I've just updated my roms/src/matlab/ folder and I've been trying to use the matlab tools to generate my initial and climatology forcing files.

As I've looked in the /matlab/initial folder I found the c_climatology, d_climatology, c_initial and d_initial routines and I've been trying to use them without any success so far.

First of all I've changed the paths, the files and the parameters at the d_initial file but whenever I run it I get an error message when it calls the c_initial routine:

??? Undefined function or variable 'ncunlim'.

Error in ==> c_initial at 102
Dname.time = 'ocean_time'; Dsize.time = ncunlim;

Error in ==> d_initial_teste at 96
[status]=c_initial(S);


I wasn't able to find where it calls the ncunlim or find a function that could help me solving this.

And second, whenever I run the d_climatology.m I get the following error:

??? Error using ==> times
Matrix dimensions must agree.

Error in ==> set_depth at 210
z(:,:,k)=z0 + zetar.*(1.0 + z0./hr);

Error in ==> d_climatology_teste at 289
[z_r]=set_depth(S.Vtransform, S.Vstretching, ...


I know it is an error with the dimensions of zetar, z0 or some other parameter but I can't figure out why it is generating matrix with different dimensions and giving an error using plus. My grid is a 580x529 grid with 1/24 resolution of the Southwest Atlantic Ocean.

Please if anyone has used those routines and had the same problem I'd appreciate any help! Let me knew know if any new information has to be provided.

Thank you,

Arthur

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

Re: Error using Matlab tools provided by ROMS

#2 Unread post by arango »

Yes, good catch about parameter ncunlim. We need to use nc_constant('nc_unlimited'). Thank you for reporting this problem.

I checked out both matlab/initial/d_climatology.m and matlab/initial/d_initial.m templates and they seem fine to me. However, I did clean them and retested them. They are working correctly. Notice that I am now using S.zeta = zeros(size(S.h)) because it is safer before calling set_depths in d_climatology.m.

It is possible that the problem that you are having is due to a transposed S.zeta or incorrect dimension for Lr or Mr. The function set_depths is correct as it is. We have been using it for several years. The problem is in your customized script.

I updated the :arrow: repository. Good luck...

aearamos
Posts: 11
Joined: Fri Nov 12, 2010 7:22 pm
Location: Texas A&M University

Re: Error using Matlab tools provided by ROMS

#3 Unread post by aearamos »

Hi Arango,

First of all thank you for responding my question so quickly. I've just noticed that the same mistake with zeta ocurring at /src/matlab/d_climatology is also happening at d_initial, so I had to add the S.zeta = zeros(size(S.h)) part to the d_initial as well.

After running both d_initial and d_climatology I had a problem with interp1 as follows:

??? Error using ==> interp1 at 123
X must be a vector.

Error in ==> d_initial_teste at 258
S.temp(i,j,:) = interp1(Zoa, Toa, Zroms, method);


I'm not sure if its a problem with the code or with or with my data so I'd like to know if you can help me with this one. I'll keep checking it to see if I can make it work.

Thanks for your help,

Arthur

Post Reply