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

◆ regrid()

static void pism::io::regrid ( const Grid grid,
const LocalInterpCtx lic,
double const *  input_array,
double *  output_array 
)
static

Bi-(or tri-)linear interpolation.

This is the interpolation code itself.

Note that its inputs are (essentially)

  • the definition of the input grid
  • the definition of the output grid
  • input array (lic->buffer)
  • output array (double *output_array)

The output_array is expected to be big enough to contain grid.xm()*grid.ym()*length(zlevels_out)` numbers.

We should be able to switch to using an external interpolation library fairly easily...

Definition at line 62 of file io_helpers.cc.

References pism::LocalInterpCtx::count, pism::k, pism::PointsWithGhosts::next(), pism::Grid::points(), pism::LocalInterpCtx::x, pism::X_AXIS, pism::Grid::xm(), pism::Grid::xs(), pism::LocalInterpCtx::y, pism::Grid::ys(), pism::LocalInterpCtx::z, and pism::Z_AXIS.

Referenced by regrid_spatial_variable().