Problem plotting with Rslice

Discussion about analysis, visualization, and collaboration tools and techniques

Moderators: arango, robertson

Post Reply
Message
Author
michele
Posts: 13
Joined: Fri Apr 27, 2007 9:40 pm
Location: Università di Bologna

Problem plotting with Rslice

#1 Unread post by michele »

Hi,
I want to plot my Roms output with matlab tool Rslice.
In Rslice the default start variable is bathymetry h; but in my Roms application my bathymetry can change with time and so it is a 3D variable calls 'bath'. If I want to use as the startup variable 'bath' rather than h, I type:

f = /home/michele/Desktop/ocean_his.nc
rslice ( 'file', f, 'variable', 'bath' )

WARNING: Classified as XY
??? Undefined function or variable "h".

Error in ==> rslice/private/snc_roms_get_grid at 140
hmin=min(min(h));

Error in ==> rslice/private/rslice_initialize>rslice_init_grid at 660
roms_grid = snc_roms_get_grid ( gdata.ncfile_list{1} );

Error in ==> rslice/private/rslice_initialize at 187
gdata.rslice_grid = rslice_init_grid ( hObject, gdata );

Error in ==> rslice>rslice_OpeningFcn at 480
rslice_initialize ( hObject, options );

Error in ==> gui_mainfcn at 166
feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});

Error in ==> rslice at 324
gui_mainfcn(gui_State, varargin{:});

It doesn't work as above if I use any variables of my netcdf file as startup variable.

I use ncview to view quickly my Netcdf output file.But It doesn't plot in vertical coordinate. Is there a software like ncview or any tool for Matlab for beginners?
:oops:

I'm novice in modelling.I'm student and I need to plot my Roms output for my graduate thesis.
I need your help!
Thank so much for advice!
Michele
:D

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

#2 Unread post by kate »

I hear tell that IDV can display ROMS output in the proper geometry, reading the theta_s, etc., and knowing what to do with them.

Your depth changes with time? Is this a sediment transport thing or something you've added?

michele
Posts: 13
Joined: Fri Apr 27, 2007 9:40 pm
Location: Università di Bologna

#3 Unread post by michele »

Thanks Kate for your advices (here and in my question about wave_time)!!

Well, in my application (for my graduate thesis on december) I want to study sediment trasport in a bathymetry with a trench dredged perpendicular to the shoreline. Because I'm a very beginner in modelling and so in Roms, I started to look some Roms 'canned application' and I thinked that Shoreface was a good application for my case.
So I created my Netcdf files: a rectangular grid (xlen=300 and ylen=2000, with tile partition 59x202x20) and a forcing file with waves informations as in Shoreface.But in shoreface there is only one value of wave_time; I create my forcing file with wave data from a previous Swan run; as I write in my post about wave_time, I have a lot of values of Hwave,Dwave,Ubot,ecc and every Netcdf variables change along wave_time dimension.

Then in my header file I add
#ifdef SEDIMENT
# define SED_MORPH
so I can study how bathymetry changes with sediments trasport; when I add SED_MORPH in header file, in my netcdf output there isn't h (that is a 2D variable) but there is 'bath' (that is a 3D variable,with dimension ocean_time).
Some suggestions or advices?
:D

IDV is 'UNAVCO GEON IDV'?

Thanks so much Kate!

Michele.

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

#4 Unread post by kate »

That's cool that SED_MORPH does that - I'll have to try it someday.

IDV is http://www.unidata.ucar.edu/software/idv/

But now that I think of it, telling it we have ROMS s-coordinates will probably make it too go looking for h instead of bath. Maybe the USGS gang will pipe up about what to use - or advise you to hack the Matlab code.

jcwarner
Posts: 1172
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

#5 Unread post by jcwarner »

sed_morph activates the time dependent bathymetry, so that the changes in "h" feed back to the momentum, etc. When activated, the netcdf file contains the variable "bath" instead of h, as you found out.
So I just wanted to say that you are experiencing a correct behavior from the model.
Let us know how it goes.
-j

nganju
Posts: 82
Joined: Mon Aug 16, 2004 8:47 pm
Location: U.S. Geological Survey, Woods Hole
Contact:

#6 Unread post by nganju »

it looks like you need to edit snc_roms_get_grid to set hmin=0 instead of hmin=min(min(h)), since h does not exist when SED_MORPH is on

michele
Posts: 13
Joined: Fri Apr 27, 2007 9:40 pm
Location: Università di Bologna

#7 Unread post by michele »

Thanks!
Indeed I solved the problem by modifying snc_roms_getgrid.m
a) line 33; <I>
b) line 140; h=x_rho*0; h(1,1)=20; h(2,2)=-20;
%these command are placed before before hmin=min(min(h));
%20 and -20 are the upper and lower limits of our bathymetry
c) line 172; <comment>; <replece>;
It is possible that some steps are useless or redundant but rslice.m worked.

I actually needed also to produce movies and other kind of fancy plots.
Therefore I ended up with doing some files from scratch that load the ROMS output with MEXCDF routines.

ciao. michele.

Post Reply