Opened 4 years ago

Closed 3 years ago

#859 closed bug (Fixed)

Possible typo in coarse2fine.m?

Reported by: tviti3 Owned by:
Priority: minor Milestone: Matlab Processing Scripts
Component: Matlab Version:
Keywords: nesting Cc:

Description

Was trying to use coarse2fine in MATLAB R2020a to nest in a synthetic model, and encountered the following error:

Error using griddedInterpolant/parenReference
The number of input coordinate arrays must match the dimensions of the sample values.

Error in coarse2fine (line 372)
      RCu.Values = C.y_u(:);   F.y_u = RCu(XuF, YuF);

Wound up making the following modification to get it working:

  diff --git a/grid/coarse2fine.m b/grid/coarse2fine.m
  index af3c1db..9c5ad5b 100644
  --- a/grid/coarse2fine.m
  +++ b/grid/coarse2fine.m
  @@ -369,7 +369,7 @@ if (got.x_u && got.y_u) || (got.lon_u && got.lat_u)
         RCu = griddedInterpolant(XuC, YuC, C.x_u, method);

                                  F.x_u = RCu(XuF, YuF);
  -      RCu.Values = C.y_u(:);   F.y_u = RCu(XuF, YuF);
  +      RCu.Values = C.y_u;   F.y_u = RCu(XuF, YuF);
       else
         F.x_u = interp2(XuC', YuC', C.x_u', XuF, YuF, method);
         F.y_u = interp2(XuC', YuC', C.y_u', XuF, YuF, method);

What's weird though is that I've used this before on this same model, and don't remember having to make this change. This may have been on an older version on MATLAB though, and I'm not sure if the behaviour of griddedInterpolant has changed in 2020a.

Change History (1)

comment:1 by arango, 3 years ago

Resolution: Fixed
Status: newclosed

Yes, indeed. Thank you for bringing this issue to our attention. I missed this trac ticket.

Note: See TracTickets for help on using tickets.