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

◆ regrid() [1/2]

void pism::array::Array::regrid ( const File file,
io::Default  default_value 
)

Read a field from a file, interpolating onto the current grid.

When flag is set to CRITICAL, stop if could not find the variable in the provided input file; default_value is ignored.

When flag is set to OPTIONAL, fill this Array with default_value if could not find the variable in the provided input file.

When flag is set to CRITICAL_FILL_MISSING, replace missing values matching the _FillValue attribute with default_value, stop if could not find the variable.

When flag is set to OPTIONAL_FILL_MISSING, replace missing values matching the _FillValue attribute with default_value; fill the whole Array with default_value if could not find the variable.

Parameters
fileinput file
flagregridding mode, see above
default_valuedefault value, meaning depends on the regridding mode flag
Returns
0 on success

Definition at line 789 of file Array.cc.

References pism::RuntimeError::add_context(), pism::array::check_range(), dm(), pism::end_time(), get_dof(), get_name(), pism::get_time(), grid(), pism::array::Array::Impl::grid, inc_state_counter(), pism::k, m_impl, metadata(), pism::array::Array::Impl::name, pism::File::name(), ndims(), ndof(), regrid_impl(), pism::array::Array::Impl::report_range, pism::start_time(), pism::timestamp(), and vec().