22#include "pism/frontretreat/PrescribedRetreat.hh"
23#include "pism/coupler/util/options.hh"
24#include "pism/util/array/Forcing.hh"
25#include "pism/util/Logger.hh"
26#include "pism/util/io/IO_Flags.hh"
34 unsigned int buffer_size =
m_config->get_number(
"input.forcing.buffer_size");
39 std::make_shared<array::Forcing>(
m_grid, file,
"land_ice_area_fraction_retreat",
43 .long_name(
"maximum ice extent mask")
53 "* Initializing the prescribed front retreat mechanism\n"
54 " using a time-dependent ice extent mask '%s' in '%s'...\n",
70 for (
auto p :
m_grid->points()) {
71 const int i = p.i(), j = p.j();
73 double f = (*m_retreat_mask)(i, j);
76 f = std::round(A * f) / A;
79 ice_area_specific_volume(i, j) = 0.0;
80 ice_thickness(i, j) = 0.0;
82 ice_area_specific_volume(i, j) = ice_thickness(i, j) * f;
83 ice_thickness(i, j) = 0.0;
94 return MaxTimestep(dt.value(),
"prescribed ice retreat");
std::shared_ptr< const Config > m_config
configuration database used by this component
const std::shared_ptr< const Grid > m_grid
grid used by this component
std::shared_ptr< const Logger > m_log
logger (for easy access)
A class defining a common interface for most PISM sub-models.
High-level PISM I/O class.
Combines the max. time step with the flag indicating if a restriction is active. Makes is possible to...
std::shared_ptr< array::Forcing > m_retreat_mask
PrescribedRetreat(std::shared_ptr< const Grid > grid)
void update(double t, double dt, array::Scalar &ice_thickness, array::Scalar &ice_area_specific_volume)
MaxTimestep max_timestep_impl(double t) const
Makes sure that we call begin_access() and end_access() for all accessed array::Arrays.
@ PISM_READONLY
open an existing file for reading only