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
-
file | input file |
flag | regridding mode, see above |
default_value | default value, meaning depends on the regridding mode flag |
- Returns
- 0 on success
Definition at line 844 of file Array.cc.
References pism::RuntimeError::add_context(), pism::end_time(), pism::File::filename(), get_name(), pism::get_time(), pism::array::Array::Impl::grid, inc_state_counter(), m_impl, pism::array::Array::Impl::name, regrid_impl(), pism::start_time(), and pism::timestamp().