19 #include "pism/hydrology/NullTransport.hh"
20 #include "pism/geometry/Geometry.hh"
21 #include "pism/util/MaxTimestep.hh"
22 #include "pism/util/array/CellType.hh"
23 #include "pism/util/error_handling.hh"
24 #include "pism/util/pism_utilities.hh"
30 :
Hydrology(
g), m_Wtill_old(m_grid,
"Wtill_old") {
40 "hydrology::NullTransport: hydrology.tillwat_max is negative.\n"
41 "This is not allowed.");
47 "* Initializing the null-transport (till only) subglacial hydrology model ...\n");
51 2,
" [using lateral diffusion of stored till water as in Bueler and Brown, 2009]\n");
102 bool add_surface_input =
m_config->get_flag(
"hydrology.add_water_input_to_till_storage");
108 if (add_surface_input) {
113 water_density =
m_config->get_number(
"constants.fresh_water.density"),
114 kg_per_m =
m_grid->cell_area() * water_density;
121 if (add_surface_input) {
125 for (
auto p =
m_grid->points(); p; p.next()) {
126 const int i = p.i(), j = p.j();
132 if (add_surface_input) {
138 "negative subglacial water thickness of %f m at (%d, %d)",
145 if (not cell_type.grounded_ice(i, j)) {
149 m_Wtill(i, j) = (W_old + dW_input) + dW_decay;
180 K =
L *
L / (2.0 * T),
181 Rx =
K * dt / (dx * dx),
182 Ry =
K * dt / (dy * dy);
185 for (
auto p =
m_grid->points(); p; p.next()) {
186 const int i = p.i(), j = p.j();
190 double dWtill = (Rx * (W.w - 2.0 * W.c + W.e) + Ry * (W.s - 2.0 * W.c + W.n));
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...
static RuntimeError formatted(const ErrorLocation &location, const char format[],...) __attribute__((format(printf
build a RuntimeError with a formatted message
Makes sure that we call begin_access() and end_access() for all accessed array::Arrays.
void copy_from(const Array2D< T > &source)
stencils::Star< T > star(int i, int j) const
void add(double alpha, const Array2D< T > &x)
void set(double c)
Result: v[j] <- c for all j.
array::Scalar m_flow_change
virtual void bootstrap_impl(const File &input_file, const array::Scalar &ice_thickness)
array::Scalar m_surface_input_rate
array::Scalar m_grounding_line_change
void enforce_bounds(const array::CellType &cell_type, const array::Scalar *no_model_mask, double max_thickness, double ocean_water_thickness, array::Scalar &water_thickness, array::Scalar &grounded_margin_change, array::Scalar &grounding_line_change, array::Scalar &conservation_error_change, array::Scalar &no_model_mask_change)
Correct the new water thickness based on boundary requirements.
array::Scalar m_basal_melt_rate
virtual void init_impl(const array::Scalar &W_till, const array::Scalar &W, const array::Scalar &P)
array::Scalar1 m_W
effective thickness of transportable basal water
virtual void restart_impl(const File &input_file, int record)
array::Scalar m_input_change
array::Scalar m_Wtill
effective thickness of basal water stored in till
array::Scalar m_grounded_margin_change
array::Scalar m_no_model_mask_change
array::Scalar m_conservation_error_change
The PISM subglacial hydrology model interface.
virtual void restart_impl(const File &input_file, int record)
virtual void init_impl(const array::Scalar &W_till, const array::Scalar &W, const array::Scalar &P)
double m_tillwat_decay_rate
array::Scalar1 m_Wtill_old
virtual void bootstrap_impl(const File &input_file, const array::Scalar &ice_thickness)
virtual void update_impl(double t, double dt, const Inputs &inputs)
Solves an implicit step of a highly-simplified ODE.
void diffuse_till_water(double dt)
double m_diffusion_distance
virtual MaxTimestep max_timestep_impl(double t) const
void initialization_message() const
NullTransport(std::shared_ptr< const Grid > g)
#define PISM_ERROR_LOCATION
static double K(double psi_x, double psi_y, double speed, double epsilon)