19 #include "pism/coupler/frontalmelt/Given.hh"
21 #include "pism/util/Grid.hh"
23 #include "pism/coupler/util/options.hh"
24 #include "pism/geometry/Geometry.hh"
25 #include "pism/util/array/Forcing.hh"
28 namespace frontalmelt {
40 "* Initializing the frontal melt model reading melt rates\n"
46 unsigned int buffer_size =
m_config->get_number(
"input.forcing.buffer_size");
56 .long_name(
"frontal melt rate")
58 .output_units(
"m year-1");
76 for (
auto p =
m_grid->points(); p; p.next()) {
77 const int i = p.i(), j = p.j();
79 auto R = (*m_frontal_melt_rate)(i, j);
81 if (
apply(cell_type, i, j)) {
82 (*m_frontal_melt_rate)(i, j) = R;
84 (*m_frontal_melt_rate)(i, j) = 0.0;
94 return {dt.value(),
"frontal_melt given"};
96 return {
"frontal_melt given"};
std::shared_ptr< const Grid > grid() const
const Config::ConstPtr m_config
configuration database used by this component
const Logger::ConstPtr m_log
logger (for easy access)
const std::shared_ptr< const Grid > m_grid
grid used by this component
High-level PISM I/O class.
array::CellType2 cell_type
Combines the max. time step with the flag indicating if a restriction is active. Makes is possible to...
Makes sure that we call begin_access() and end_access() for all accessed array::Arrays.
static std::shared_ptr< Forcing > Constant(std::shared_ptr< const Grid > grid, const std::string &short_name, double value)
bool apply(const array::CellType1 &M, int i, int j) const
A very rudimentary PISM frontal melt model.
std::shared_ptr< array::Forcing > m_frontal_melt_rate
void init_impl(const Geometry &geometry)
MaxTimestep max_timestep_impl(double t) const
const array::Scalar & frontal_melt_rate_impl() const
Given(std::shared_ptr< const Grid > g)
void update_impl(const FrontalMeltInputs &inputs, double t, double dt)
@ PISM_READONLY
open an existing file for reading only