PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800

◆ LocalInterpCtx() [2/2]

pism::LocalInterpCtx::LocalInterpCtx ( const grid::InputGridInfo input_grid,
const Grid internal_grid,
const std::vector< double > &  z_internal,
InterpolationType  type 
)

Construct a local interpolation context.

The essential quantities to compute are where each processor should start within the NetCDF file grid (start[]) and how many grid points, from the starting place, the processor has. The resulting portion of the grid is stored in array a (a field of the LocalInterpCtx).

We make conservative choices about start[] and count[]. In particular, the portions owned by processors must overlap at one point in the NetCDF file grid, but they may overlap more than that (as computed here).

Note this constructor doesn't extract new information from the NetCDF file or do communication. The information from the NetCDF file must already be extracted, validly stored in a grid_info structure input.

The Grid is used to determine what ranges of the target arrays (i.e. Vecs into which NetCDF information will be interpolated) are owned by each processor.

Definition at line 83 of file LocalInterpCtx.cc.

References count, pism::LINEAR, pism::array::max(), pism::NEAREST, PISM_ERROR_LOCATION, start, pism::grid::InputGridInfo::z, z, and pism::Z_AXIS.