PISM, A Parallel Ice Sheet Model  stable v1.2 committed by Constantine Khrulev on 2020-02-11 20:24:05 -0900
BedDef.hh
Go to the documentation of this file.
1 // Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 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 __BedDef_hh
20 #define __BedDef_hh
21 
22 #include "pism/util/Component.hh"
23 #include "pism/util/iceModelVec.hh"
24 
25 namespace pism {
26 
27 //! @brief Bed-related models: bed deformation (provide bed elevation
28 //! and uplift) and (soon) bed erosion.
29 namespace bed {
30 
31 double compute_load(double bed, double ice_thickness, double sea_level,
32  double ice_density, double ocean_density);
33 
34 void compute_load(const IceModelVec2S &bed_elevation,
35  const IceModelVec2S &ice_thickness,
36  const IceModelVec2S &sea_level_elevation,
37  IceModelVec2S &result);
38 
39 //! PISM bed deformation model (base class).
40 class BedDef : public Component {
41 public:
43  virtual ~BedDef();
44 
45  void init(const InputOptions &opts, const IceModelVec2S &ice_thickness,
46  const IceModelVec2S &sea_level_elevation);
48  const IceModelVec2S &bed_uplift,
49  const IceModelVec2S &ice_thickness,
50  const IceModelVec2S &sea_level_elevation);
51 
52  void update(const IceModelVec2S &ice_thickness,
53  const IceModelVec2S &sea_level_elevation,
54  double t, double dt);
55 
56  const IceModelVec2S& bed_elevation() const;
57  const IceModelVec2S& uplift() const;
58 
59 protected:
60  virtual void define_model_state_impl(const File &output) const;
61  virtual void write_model_state_impl(const File &output) const;
62 
63  virtual DiagnosticList diagnostics_impl() const;
64 
65  virtual void update_impl(const IceModelVec2S &ice_thickness,
66  const IceModelVec2S &sea_level_elevation,
67  double t, double dt) = 0;
68  virtual void init_impl(const InputOptions &opts, const IceModelVec2S &ice_thickness,
69  const IceModelVec2S &sea_level_elevation);
70  virtual void bootstrap_impl(const IceModelVec2S &bed_elevation,
71  const IceModelVec2S &bed_uplift,
72  const IceModelVec2S &ice_thickness,
73  const IceModelVec2S &sea_level_elevation);
74  virtual void apply_topg_offset(const std::string &filename);
75 
76  void compute_uplift(const IceModelVec2S &bed, const IceModelVec2S &bed_last,
77  double dt, IceModelVec2S &result);
78 protected:
79  //! current bed elevation
81 
82  //! bed elevation at the time of the last update
84 
85  //! bed uplift rate
87 };
88 
89 /*!
90  * The do-nothing bed deformation model.
91  */
92 class Null : public BedDef {
93 public:
95 protected:
96  void update_impl(const IceModelVec2S &ice_thickness,
97  const IceModelVec2S &sea_level_elevation,
98  double t, double dt);
99  MaxTimestep max_timestep_impl(double t) const;
100  void init_impl(const InputOptions &opts, const IceModelVec2S &ice_thickness,
101  const IceModelVec2S &sea_level_elevation);
102 };
103 
104 //! Point-wise isostasy bed deformation model.
105 class PointwiseIsostasy : public BedDef {
106 public:
108  virtual ~PointwiseIsostasy();
109 protected:
110  MaxTimestep max_timestep_impl(double t) const;
111  void init_impl(const InputOptions &opts, const IceModelVec2S &ice_thickness,
112  const IceModelVec2S &sea_level_elevation);
114  const IceModelVec2S &bed_uplift,
115  const IceModelVec2S &ice_thickness,
116  const IceModelVec2S &sea_level_elevation);
117  void update_impl(const IceModelVec2S &ice_thickness,
118  const IceModelVec2S &sea_level_elevation,
119  double t, double dt);
120  IceModelVec2S m_load_last; //!< last ice load (ice-equivalent thickness)
121 };
122 
123 } // end of namespace bed
124 } // end of namespace pism
125 
126 #endif // __BedDef_hh
pism::bed::Null::init_impl
void init_impl(const InputOptions &opts, const IceModelVec2S &ice_thickness, const IceModelVec2S &sea_level_elevation)
Initialize from the context (input file and the "variables" database).
Definition: Null.cc:33
pism::bed::BedDef::m_topg
IceModelVec2S m_topg
current bed elevation
Definition: BedDef.hh:80
pism::bed::BedDef::update
void update(const IceModelVec2S &ice_thickness, const IceModelVec2S &sea_level_elevation, double t, double dt)
Definition: BedDef.cc:104
pism::MaxTimestep
Combines the max. time step with the flag indicating if a restriction is active. Makes is possible to...
Definition: MaxTimestep.hh:31
pism::File
High-level PISM I/O class.
Definition: File.hh:50
pism::IceGrid::ConstPtr
std::shared_ptr< const IceGrid > ConstPtr
Definition: IceGrid.hh:215
pism::InputOptions
Definition: Component.hh:41
pism
Definition: AgeColumnSystem.cc:24
pism::bed::PointwiseIsostasy::init_impl
void init_impl(const InputOptions &opts, const IceModelVec2S &ice_thickness, const IceModelVec2S &sea_level_elevation)
Initialize from the context (input file and the "variables" database).
Definition: PointwiseIsostasy.cc:38
pism::bed::BedDef::compute_uplift
void compute_uplift(const IceModelVec2S &bed, const IceModelVec2S &bed_last, double dt, IceModelVec2S &result)
Compute bed uplift (dt is in seconds).
Definition: BedDef.cc:181
pism::bed::Null
Definition: BedDef.hh:92
pism::bed::BedDef::m_topg_last
IceModelVec2S m_topg_last
bed elevation at the time of the last update
Definition: BedDef.hh:83
pism::bed::Null::max_timestep_impl
MaxTimestep max_timestep_impl(double t) const
Definition: Null.cc:43
pism::bed::PointwiseIsostasy::bootstrap_impl
void bootstrap_impl(const IceModelVec2S &bed_elevation, const IceModelVec2S &bed_uplift, const IceModelVec2S &ice_thickness, const IceModelVec2S &sea_level_elevation)
Definition: PointwiseIsostasy.cc:51
pism::bed::BedDef::init_impl
virtual void init_impl(const InputOptions &opts, const IceModelVec2S &ice_thickness, const IceModelVec2S &sea_level_elevation)
Initialize from the context (input file and the "variables" database).
Definition: BedDef.cc:111
pism::bed::BedDef::apply_topg_offset
virtual void apply_topg_offset(const std::string &filename)
Definition: BedDef.cc:166
pism::bed::BedDef::diagnostics_impl
virtual DiagnosticList diagnostics_impl() const
Definition: BedDef.cc:69
pism::bed::PointwiseIsostasy
Point-wise isostasy bed deformation model.
Definition: BedDef.hh:105
pism::bed::PointwiseIsostasy::PointwiseIsostasy
PointwiseIsostasy(IceGrid::ConstPtr g)
Definition: PointwiseIsostasy.cc:29
pism::bed::BedDef::init
void init(const InputOptions &opts, const IceModelVec2S &ice_thickness, const IceModelVec2S &sea_level_elevation)
Definition: BedDef.cc:79
pism::bed::BedDef::uplift
const IceModelVec2S & uplift() const
Definition: BedDef.cc:55
pism::bed::BedDef::update_impl
virtual void update_impl(const IceModelVec2S &ice_thickness, const IceModelVec2S &sea_level_elevation, double t, double dt)=0
pism::bed::BedDef::bootstrap
void bootstrap(const IceModelVec2S &bed_elevation, const IceModelVec2S &bed_uplift, const IceModelVec2S &ice_thickness, const IceModelVec2S &sea_level_elevation)
Initialize using provided bed elevation and uplift.
Definition: BedDef.cc:85
pism::bed::BedDef::~BedDef
virtual ~BedDef()
Definition: BedDef.cc:47
pism::IceModelVec2S
Definition: iceModelVec.hh:435
pism::bed::BedDef::write_model_state_impl
virtual void write_model_state_impl(const File &output) const
The default (empty implementation).
Definition: BedDef.cc:64
pism::bed::BedDef::define_model_state_impl
virtual void define_model_state_impl(const File &output) const
The default (empty implementation).
Definition: BedDef.cc:59
pism::bed::Null::Null
Null(IceGrid::ConstPtr g)
Definition: Null.cc:28
pism::bed::BedDef::bed_elevation
const IceModelVec2S & bed_elevation() const
Definition: BedDef.cc:51
pism::bed::BedDef
PISM bed deformation model (base class).
Definition: BedDef.hh:40
pism::bed::Null::update_impl
void update_impl(const IceModelVec2S &ice_thickness, const IceModelVec2S &sea_level_elevation, double t, double dt)
Definition: Null.cc:48
pism::bed::PointwiseIsostasy::update_impl
void update_impl(const IceModelVec2S &ice_thickness, const IceModelVec2S &sea_level_elevation, double t, double dt)
Updates the pointwise isostasy model.
Definition: PointwiseIsostasy.cc:68
pism::DiagnosticList
std::map< std::string, Diagnostic::Ptr > DiagnosticList
Definition: Diagnostic.hh:116
pism::bed::BedDef::BedDef
BedDef(IceGrid::ConstPtr g)
Definition: BedDef.cc:29
pism::bed::compute_load
double compute_load(double bed, double ice_thickness, double sea_level, double ice_density, double ocean_density)
Definition: BedDef.cc:188
pism::g
static const double g
Definition: exactTestP.cc:39
pism::bed::PointwiseIsostasy::m_load_last
IceModelVec2S m_load_last
last ice load (ice-equivalent thickness)
Definition: BedDef.hh:120
pism::bed::PointwiseIsostasy::~PointwiseIsostasy
virtual ~PointwiseIsostasy()
Definition: PointwiseIsostasy.cc:34
pism::bed::BedDef::bootstrap_impl
virtual void bootstrap_impl(const IceModelVec2S &bed_elevation, const IceModelVec2S &bed_uplift, const IceModelVec2S &ice_thickness, const IceModelVec2S &sea_level_elevation)
Definition: BedDef.cc:92
pism::bed::BedDef::m_uplift
IceModelVec2S m_uplift
bed uplift rate
Definition: BedDef.hh:86
pism::Component
A class defining a common interface for most PISM sub-models.
Definition: Component.hh:103
pism::bed::PointwiseIsostasy::max_timestep_impl
MaxTimestep max_timestep_impl(double t) const
Definition: PointwiseIsostasy.cc:62