PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
Distributed.hh
Go to the documentation of this file.
1 // Copyright (C) 2012-2019, 2021, 2022 PISM Authors
2 //
3 // This file is part of PISM.
4 //
5 // PISM is free software; you can redistribute it and/or modify it under the
6 // terms of the GNU General Public License as published by the Free Software
7 // Foundation; either version 3 of the License, or (at your option) any later
8 // version.
9 //
10 // PISM is distributed in the hope that it will be useful, but WITHOUT ANY
11 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with PISM; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 
19 #ifndef _DISTRIBUTED_H_
20 #define _DISTRIBUTED_H_
21 
22 #include "pism/hydrology/Routing.hh"
23 
24 namespace pism {
25 
26 namespace hydrology {
27 
28 //! \brief The PISM subglacial hydrology model for a distributed linked-cavity system.
29 /*!
30  This class implements the model documented in [\ref BuelervanPeltDRAFT].
31 
32  Unlike hydrology::Routing, the water pressure \f$P\f$ is a state variable, and there
33  are modeled mechanisms for cavity geometry evolution, including creep closure
34  and opening through sliding ("cavitation"). Because of cavitation, this model
35  needs access to a StressBalance object. Background references for this kind of
36  model includes especially [\ref Kamb1987, \ref Schoofetal2012], but see also
37  [\ref Hewitt2011, \ref Hewittetal2012, \ref Hewitt2013].
38 
39  In addition to the actions within the null strip taken by hydrology::Routing,
40  this model also sets the staggered grid values of the gradient of the hydraulic
41  potential to zero if either regular grid neighbor is in the null strip.
42 */
43 class Distributed : public Routing {
44 public:
45  Distributed(std::shared_ptr<const Grid> g);
46  virtual ~Distributed() = default;
47 
49 
50 protected:
51  virtual void restart_impl(const File &input_file, int record);
52 
53  virtual void bootstrap_impl(const File &input_file,
54  const array::Scalar &ice_thickness);
55 
56  virtual void init_impl(const array::Scalar &W_till,
57  const array::Scalar &W,
58  const array::Scalar &P);
59 
60  virtual double max_timestep_P_diff(double phi0, double dt_diff_w) const;
61 
62  void update_impl(double t, double dt, const Inputs& inputs);
63 
64  std::map<std::string, TSDiagnostic::Ptr> ts_diagnostics_impl() const;
65 
66  void define_model_state_impl(const File &output) const;
67  void write_model_state_impl(const File &output) const;
68 
70  const array::Scalar &P_o,
71  bool enforce_upper);
72 
73  void P_from_W_steady(const array::Scalar &W,
74  const array::Scalar &P_overburden,
75  const array::Scalar &sliding_speed,
76  array::Scalar &result);
77 
78  void update_P(double dt,
79  const array::CellType &cell_type,
80  const array::Scalar &sliding_speed,
82  const array::Scalar &basal_melt_rate,
83  const array::Scalar &P_overburden,
84  const array::Scalar &Wtill,
85  const array::Scalar &Wtill_new,
86  const array::Scalar &P,
87  const array::Scalar1 &W,
88  const array::Staggered1 &Ws,
89  const array::Staggered1 &K,
90  const array::Staggered1 &Q,
91  array::Scalar &P_new) const;
92 protected:
95 private:
96  void initialization_message() const;
97 };
98 
99 } // end of namespace hydrology
100 } // end of namespace pism
101 
102 #endif /* _DISTRIBUTED_H_ */
High-level PISM I/O class.
Definition: File.hh:56
"Cell type" mask. Adds convenience methods to array::Scalar.
Definition: CellType.hh:30
void write_model_state_impl(const File &output) const
The default (empty implementation).
Definition: Distributed.cc:104
virtual void bootstrap_impl(const File &input_file, const array::Scalar &ice_thickness)
Definition: Distributed.cc:59
void define_model_state_impl(const File &output) const
The default (empty implementation).
Definition: Distributed.cc:99
void update_P(double dt, const array::CellType &cell_type, const array::Scalar &sliding_speed, const array::Scalar &surface_input_rate, const array::Scalar &basal_melt_rate, const array::Scalar &P_overburden, const array::Scalar &Wtill, const array::Scalar &Wtill_new, const array::Scalar &P, const array::Scalar1 &W, const array::Staggered1 &Ws, const array::Staggered1 &K, const array::Staggered1 &Q, array::Scalar &P_new) const
Definition: Distributed.cc:213
virtual void init_impl(const array::Scalar &W_till, const array::Scalar &W, const array::Scalar &P)
Definition: Distributed.cc:91
std::map< std::string, TSDiagnostic::Ptr > ts_diagnostics_impl() const
Definition: Distributed.cc:109
void P_from_W_steady(const array::Scalar &W, const array::Scalar &P_overburden, const array::Scalar &sliding_speed, array::Scalar &result)
Compute functional relationship P(W) which applies only in steady state.
Definition: Distributed.cc:170
const array::Scalar & subglacial_water_pressure() const
Copies the P state variable which is the modeled water pressure.
Definition: Distributed.cc:117
void initialization_message() const
Definition: Distributed.cc:46
virtual ~Distributed()=default
Distributed(std::shared_ptr< const Grid > g)
Definition: Distributed.cc:31
void update_impl(double t, double dt, const Inputs &inputs)
Update the model state variables W,P by running the subglacial hydrology model.
Definition: Distributed.cc:300
virtual double max_timestep_P_diff(double phi0, double dt_diff_w) const
Definition: Distributed.cc:209
void check_P_bounds(array::Scalar &P, const array::Scalar &P_o, bool enforce_upper)
Definition: Distributed.cc:126
virtual void restart_impl(const File &input_file, int record)
Definition: Distributed.cc:51
The PISM subglacial hydrology model for a distributed linked-cavity system.
Definition: Distributed.hh:43
const array::Scalar & surface_input_rate() const
Definition: Hydrology.cc:518
A subglacial hydrology model which assumes water pressure equals overburden pressure.
Definition: Routing.hh:81
static double K(double psi_x, double psi_y, double speed, double epsilon)
static const double g
Definition: exactTestP.cc:36