bug message reminder

When adressing a model crash or bug, please remember to include an entire model setup in your post that reproduces the crash or exposes the bug. Also add the XBlog.txt file. This is necessary information for people that are trying to help you. Including your model setup can be achieved by adding the zipped run directory (excluding output) as an attachment to the post.

Forum

Problem running model setup tutorial 2d case

AM
Arjan Mol, modified 3 Years ago.

Problem running model setup tutorial 2d case

Capillary Posts: 1 Join Date: 11/17/11 Recent Posts
I am trying to set up an XBeach simulation using the Matlab toolbox, but as I am quite new to this, I first decided to run the tutorials. Well, I am already running into problems with the 2d case tutorial ('going 2d with your model'):


% obtain Vaklodingen data from OpenDAP server
url = 'http://opendap.deltares.nl/thredds/dodsC/opendap/rijkswaterstaat/vaklodingen/vaklodingenKB121_2524.nc';
x = nc_varget(url, 'x');
y = nc_varget(url, 'y');
z = nc_varget(url, 'z');
z = squeeze(z(end-1,:,:));

% plot bathymetry obtained from Vaklodingen datasource
pcolor(x, y, z); shading flat; axis equal; colorbar;

% generate model setup using Vaklodingen bathymetry
xbm = xb_generate_model( ...
    'bathy', {'x', x, 'y', y, 'z', z ...
        'crop', [100110 530440 7333 5817], ...
        'finalise', {'lateral_sandwalls' 'lateral_extend' 'seaward_flatten'} ...
    } ...
);


When running this code I get the following error:
Warning: INTERP2 cannot be used, interpolation can take a little longer:
Data is in MESHGRID format, NDGRID format is required.
Convert your data as follows:
X = X'; Y = Y'; V = V'; F = griddedInterpolant(X,Y,V)

> In xb_grid_optimize at 273
In xb_generate_bathy at 156
In xb_generate_model at 134

Undefined function 'scatteredInterpolant' for input arguments of type 'double'.

Error in xb_grid_optimize (line 274)
interpolant = scatteredInterpolant(x_r(emoticon, y_r(emoticon, z_w(emoticon);

Error in xb_generate_bathy (line 156)
[x y z ne alpha xori yori] = xb_grid_optimize( ...

Error in xb_generate_model (line 134)
bathy = xb_generate_bathy(OPT.bathy{:});


I am running Matlab 2012b, and apparently it does not know the function 'scatteredInterpolant'. I was wondering why it just cannot use interp2, so I checked the code and on line 270 of xb_grid_optimize.m, there is the following code:
z_d = interp2(x_w', y_w', z_w', x_d_w, y_d_w);

I am wondering why the matrices x_w, y_w and z_w are being transposed, because when I change it into the following it runs without problems:
z_d = interp2(x_w, y_w, z_w, x_d_w, y_d_w);
RL
rakesh livobase, modified 5 Months ago.

RE: Problem running model setup tutorial 2d case

Capillary Posts: 3 Join Date: 8/23/19 Recent Posts
SI
share it, modified 4 Months ago.

RE: Problem running model setup tutorial 2d case

Capillary Posts: 2 Join Date: 8/21/19 Recent Posts
GM
gotta max, modified 6 Days ago.

RE: Problem running model setup tutorial 2d case

Capillary Posts: 1 Join Date: 1/20/20 Recent Posts
Nice to see this post here and you explained in a detailed way. Thanks for sharing this to us. Get the details about Best Gas Grills which are playing the most competitive role in the current market.