Problem refining with coarse2fine on a complex-shaped grid

Discussion about analysis, visualization, and collaboration tools and techniques

Moderators: arango, robertson

Post Reply
Message
Author
User avatar
petalas
Posts: 12
Joined: Mon Jul 04, 2016 1:31 pm
Location: Democritus University of Thrace

Problem refining with coarse2fine on a complex-shaped grid

#1 Unread post by petalas »

Hello,
as part of my ROMS learning procedure, I set-up a very simple realistic application in the Mediterranean, with atmospheric forcing, rivers, boundaries and a simple square grid with a refined two-way nesting.
It ran flawlessly and after some tweaking of parameters (basically hor.diffusion and lateral bry cond.types), reproduced expected patterns, so I decided to move-on to the next step.

I decided to construct a more complex-shaped grid using the same tools-procedure as before (pyroms-pygridgen for the grid generation and matlab-coarse2fine for the refinement).
But when I used the coarse2fine function to refine the grid, it gave me the following error:

Code: Select all

Interpolating from coarse to fine ...
Warning: Duplicate data points have been detected and removed - corresponding values have been averaged. 
> In coarse2fine (line 286)
  In coarse2fine (line 289)
  In coarse2fine (line 289) 
Error using TriScatteredInterp/subsref
The interpolant is in an invalid state.
The number of data point locations should equal the number of data point values.

Error in coarse2fine (line 289)
    RSr.V = C.lat_rho(:);   F.lat_rho = RSr(F.x_rho, F.y_rho);
 
289     RSr.V = C.lat_rho(:);   F.lat_rho = RSr(F.x_rho, F.y_rho);
One clue is that this time I used positive as well as negative turns to construct the grid, and I had to fill in the nan values that occurred (ones for the bathymetry, and the mean value for the rest, as proposed in another post by Kate).
I'm guessing that the problem has to do with that value allocation in the grid, but I cannot test whether this is the case, as pyroms won't construct the grid if I don't fill the nan values.
Any hint-help would be much appreciated.
Stam

User avatar
wilkin
Posts: 922
Joined: Mon Apr 28, 2003 5:44 pm
Location: Rutgers University
Contact:

Re: Problem refining with coarse2fine on a complex-shaped gr

#2 Unread post by wilkin »

If the coordinates you used for lon_rho and lat_rho have duplicates - even if they are NaN - TriScatteredInterp will throw an error.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

Post Reply