[MITgcm-support] interpickups.m

samar khatiwala spk at ldeo.columbia.edu
Mon Oct 17 20:29:52 EDT 2005


Nicolas:

I haven't been following this thread, but in response to Baylor's posting,
masking of fields with NaN's is trivial. Use hFacC==0 (or S==0) for T/S,
hFacW==0 for U, and hFacS==0 for V. Once masked with NaN's, interpolate as
usual in matlab. (But don't use 'nearest'!)
Also, if you have issues near the boundaries, I highly recommend the
script 'inpaint_nans.m'. You can look it up on the mathworks support pages
or if you can't find it email me.

Samar

On Mon, 17 Oct 2005, Baylor Fox-Kemper wrote:

> Hi Nicolas,
>    I think Ed's advice to use nearest neighbors is sound near the
> boundaries (doing a one-sided extrapolation is a bit finicky.  However,
> using nearest neighbor in the interior will wreak havoc on the physics,
> since it effectively increases all of the gradients without cause.  You
> are also right that it would be nicer to have Nans where they should be
> in the different fields instead of zeros, since matlab will just use
> zeros in the interpolation.  My suggestion would be
>
> 1) Filter the incoming fields setting zeros to Nans.  This will be
> trivial for temperature, where you are unlikely to have zeros anywhere
> except in boundaries.  Use those zeros to determine mass points in
> boundaries (so salt, divergence, etc will be at the same points).  You
> will have to work a little harder to figure out where boundaries are
> for u and v and zeta.   You might just look for points that are zero
> not at any given timestep, but at every timestep analysed.
>
> 2) Use a linear or cubic interpolation.  This should do an OK job
> everywhere except within a stencil from the boundary.
>
> 3) Use nearest neighbor to fill all the points that are nans.  This
> will make your real points cozy up to the boundaries.  Whatever errors
> this introduces should be subsumed in the viscous/diffusive boundary
> layers near the boundaries anyway...
>
>    Hope that helps,
>      -Baylor
>
> On Oct 14, 2005, at 2:59 PM, Nicolas Wienders wrote:
>
> >
> >
> > Hello, is there anybody here?  ;-)
> >
> >
> > I am wondering if someone would have a version of the interpolation
> > script which would take care of the presence of boundaries (the values
> > set at zero, instead of NaN, have a tendency to stain/spread on the
> > interior fields).
> >
> > Thanks a lot and have good week-end !
> > _______________________________________________
> > MITgcm-support mailing list
> > MITgcm-support at mitgcm.org
> > http://mitgcm.org/mailman/listinfo/mitgcm-support
>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support
>



More information about the MITgcm-support mailing list