tBedDef.hh - pism - [fork] customized build of PISM, the parallel ice sheet model (tillflux branch)
HTML git clone git://src.adamsgaard.dk/pism
DIR Log
DIR Files
DIR Refs
DIR LICENSE
---
tBedDef.hh (4741B)
---
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:
42 BedDef(IceGrid::ConstPtr g);
43 virtual ~BedDef();
44
45 void init(const InputOptions &opts, const IceModelVec2S &ice_thickness,
46 const IceModelVec2S &sea_level_elevation);
47 void bootstrap(const IceModelVec2S &bed_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
80 IceModelVec2S m_topg;
81
82 //! bed elevation at the time of the last update
83 IceModelVec2S m_topg_last;
84
85 //! bed uplift rate
86 IceModelVec2S m_uplift;
87 };
88
89 /*!
90 * The do-nothing bed deformation model.
91 */
92 class Null : public BedDef {
93 public:
94 Null(IceGrid::ConstPtr g);
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:
107 PointwiseIsostasy(IceGrid::ConstPtr g);
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);
113 void bootstrap_impl(const IceModelVec2S &bed_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