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:**

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