20 #include "pism/frontretreat/calving/CalvingAtThickness.hh"
22 #include "pism/util/Mask.hh"
23 #include "pism/util/Grid.hh"
24 #include "pism/util/pism_utilities.hh"
25 #include "pism/coupler/util/options.hh"
26 #include "pism/util/array/Forcing.hh"
27 #include "pism/util/io/File.hh"
36 m_old_mask(m_grid,
"old_mask") {
40 unsigned int buffer_size =
m_config->get_number(
"input.forcing.buffer_size");
46 "thickness_calving_threshold",
53 .long_name(
"threshold used by the 'calving at threshold' calving method")
61 m_log->message(2,
"* Initializing the 'calving at a threshold thickness' mechanism...\n");
67 if (variable_exists) {
69 " Reading thickness calving threshold from file '%s'...\n",
74 double calving_threshold =
m_config->get_number(
"calving.thickness_calving.threshold");
79 "thickness_calving_threshold",
85 " Thickness threshold: %3.3f meters.\n", calving_threshold);
115 for (
auto p =
m_grid->points(); p; p.next()) {
116 const int i = p.i(), j = p.j();
121 ice_thickness(i, j) = 0.0;
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
A class defining a common interface for most PISM sub-models.
static Ptr wrap(const T &input)
VariableLookupData find_variable(const std::string &short_name, const std::string &std_name) const
Find a variable using its standard name and/or short name.
High-level PISM I/O class.
Makes sure that we call begin_access() and end_access() for all accessed array::Arrays.
void copy_from(const Array2D< T > &source)
void update_ghosts()
Updates ghost points.
bool next_to_ice_free_ocean(int i, int j) const
bool floating_ice(int i, int j) const
static std::shared_ptr< Forcing > Constant(std::shared_ptr< const Grid > grid, const std::string &short_name, double value)
std::shared_ptr< array::Forcing > m_calving_threshold
void update(double t, double dt, array::Scalar &cell_type, array::Scalar &ice_thickness)
array::CellType1 m_old_mask
CalvingAtThickness(std::shared_ptr< const Grid > g)
DiagnosticList diagnostics_impl() const
const array::Scalar & threshold() const
@ PISM_READONLY
open an existing file for reading only
std::map< std::string, Diagnostic::Ptr > DiagnosticList