atlas::grid::ComputeVerticalStencil class

Compute lower vertical level index for given coordinate zcoord:

///   0----1----2----3--...--(n-1)----(n)----(n+1)
///   --->|<---|<---|<--...-|<--------------------
/// 

If coordinate falls on vertical level (+- epsilon), that level is returned If coordinate falls in range [0,1) or [n,n+1], the index is snapped to 1 and (n-1) respectively. This allows reliably that the returned index can be used for stencil operations.

IFS full levels don't have a level at the boundaries (0.,1.) It is the "half" levels that contain (0.,1.). For reasons of boundary conditions however, the full levels also have 0. prepended and 1. appended.

Example IFS full levels for regular distribution dz ( level 0 and n+1 are added for boundary conditions ) 0 : 0.0 jlev : jlev*dz - 0.5*dz nlev : nlev*dz - 0.5*dz nlev+1 : 1.0

Constructors, destructors, conversion operators

ComputeVerticalStencil() defaulted
ComputeVerticalStencil(const Vertical& vertical, idx_t stencil_width)

Public functions

template<typename stencil_t>
void operator()(const double& z, stencil_t& stencil) const