[MITgcm-support] interpickups.m

Baylor Fox-Kemper baylor at MIT.EDU
Mon Oct 17 16:35:00 EDT 2005


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




More information about the MITgcm-support mailing list