Loading [MathJax]/extensions/tex2jax.js
PISM, A Parallel Ice Sheet Model 2.2.2-d6b3a29ca committed by Constantine Khrulev on 2025-03-28
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages

◆ regrid_spatial_variable()

void pism::io::regrid_spatial_variable ( const SpatialVariableMetadata variable,
const Grid target_grid,
const LocalInterpCtx interp_context,
const File file,
double output 
)

Regrid from a NetCDF file into a distributed array output.

  • if flag is CRITICAL or CRITICAL_FILL_MISSING, stops if the variable was not found in the input file
  • if flag is one of CRITICAL_FILL_MISSING and OPTIONAL_FILL_MISSING, replace _FillValue with default_value.
  • sets v to default_value if flag is OPTIONAL and the variable was not found in the input file
  • uses the last record in the file

Definition at line 810 of file io_helpers.cc.

References pism::Profiling::begin(), pism::LocalInterpCtx::buffer_size(), check_units(), pism::units::Converter::convert_doubles(), pism::LocalInterpCtx::count, pism::Grid::ctx(), pism::Profiling::end(), pism::File::find_variable(), pism::VariableMetadata::get_name(), interpolate(), pism::File::name(), read_distributed_array(), pism::File::read_text_attribute(), pism::LocalInterpCtx::start, pism::VariableMetadata::unit_system(), pism::Grid::xm(), pism::Grid::ym(), and pism::LocalInterpCtx::z.

Referenced by pism::InputInterpolation3D::regrid_impl(), and pism::details::regrid_layer_thickness().