Loading [MathJax]/extensions/tex2jax.js
PISM, A Parallel Ice Sheet Model 2.2.2-d6b3a29ca committed by Constantine Khrulev on 2025-03-28
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BedDef.hh
Go to the documentation of this file.
1// Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 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
24namespace pism {
25
26//! @brief Bed-related models: bed deformation (provide bed elevation
27//! and uplift) and (soon) bed erosion.
28namespace bed {
29
30double compute_load(double bed, double ice_thickness, double sea_level,
31 double ice_density, double ocean_density);
32
33void accumulate_load(const array::Scalar &bed_elevation, const array::Scalar &ice_thickness,
34 const array::Scalar &sea_level_elevation, double C, array::Scalar &result);
35
36//! PISM bed deformation model (base class).
37class BedDef : public Component {
38public:
39 BedDef(std::shared_ptr<const Grid> g, const std::string &model_name);
40 virtual ~BedDef() = default;
41
42 void init(const InputOptions &opts, const array::Scalar &ice_thickness,
43 const array::Scalar &sea_level_elevation);
45 const array::Scalar &bed_uplift,
46 const array::Scalar &ice_thickness,
47 const array::Scalar &sea_level_elevation);
48
49 void update(const array::Scalar &ice_thickness,
50 const array::Scalar &sea_level_elevation,
51 double t, double dt);
52
53 const array::Scalar& bed_elevation() const;
54 const array::Scalar& uplift() const;
55
56protected:
57 virtual MaxTimestep max_timestep_impl(double t) const;
58
59 virtual void define_model_state_impl(const File &output) const;
60 virtual void write_model_state_impl(const File &output) const;
61
62 virtual DiagnosticList diagnostics_impl() const;
63
64 virtual void update_impl(const array::Scalar &load,
65 double t, double dt) = 0;
66
67 virtual void init_impl(const InputOptions &opts, const array::Scalar &ice_thickness,
68 const array::Scalar &sea_level_elevation) = 0;
69
70 virtual void bootstrap_impl(const array::Scalar &bed_elevation,
71 const array::Scalar &bed_uplift,
72 const array::Scalar &ice_thickness,
73 const array::Scalar &sea_level_elevation) = 0;
74
75 static void apply_topg_offset(const std::string &filename, array::Scalar &bed_topography);
76
77 //! current bed elevation
79
80 //! bed elevation at the time of the last update
82
85
86 //! bed uplift rate
88
89 //! time of the last bed deformation update
90 double m_t_last;
91 //! Update interval in seconds
93 //! Temporal resolution to use when checking whether it's time to update
94 double m_t_eps;
95 //! Name of the variable used to store the last update time.
96 std::string m_time_name;
97
98 std::string m_model_name;
99};
100
101/*!
102 * The do-nothing bed deformation model.
103 */
104class Null : public BedDef {
105public:
106 Null(std::shared_ptr<const Grid> g);
107protected:
108 void update_impl(const array::Scalar &load, double t, double dt);
109
110 void init_impl(const InputOptions &opts, const array::Scalar &ice_thickness,
111 const array::Scalar &sea_level_elevation);
112
114 const array::Scalar &bed_uplift,
115 const array::Scalar &ice_thickness,
116 const array::Scalar &sea_level_elevation);
117
118 MaxTimestep max_timestep_impl(double t) const;
119};
120
121//! Point-wise isostasy bed deformation model.
122class PointwiseIsostasy : public BedDef {
123public:
124 PointwiseIsostasy(std::shared_ptr<const Grid> g);
125 virtual ~PointwiseIsostasy() = default;
126protected:
127 void init_impl(const InputOptions &opts, const array::Scalar &ice_thickness,
128 const array::Scalar &sea_level_elevation);
129
131 const array::Scalar &bed_uplift,
132 const array::Scalar &ice_thickness,
133 const array::Scalar &sea_level_elevation);
134
135 void update_impl(const array::Scalar &load, double t, double dt);
136
137 //! last ice load (ice-equivalent thickness)
139};
140
141} // end of namespace bed
142} // end of namespace pism
143
144#endif // __BedDef_hh
A class defining a common interface for most PISM sub-models.
Definition Component.hh:118
High-level PISM I/O class.
Definition File.hh:55
Combines the max. time step with the flag indicating if a restriction is active. Makes is possible to...
std::string m_time_name
Name of the variable used to store the last update time.
Definition BedDef.hh:96
array::Scalar m_load_accumulator
Definition BedDef.hh:84
virtual void write_model_state_impl(const File &output) const
The default (empty implementation).
Definition BedDef.cc:95
virtual DiagnosticList diagnostics_impl() const
Definition BedDef.cc:103
array::Scalar m_topg_last
bed elevation at the time of the last update
Definition BedDef.hh:81
virtual void define_model_state_impl(const File &output) const
The default (empty implementation).
Definition BedDef.cc:79
virtual void update_impl(const array::Scalar &load, double t, double dt)=0
void init(const InputOptions &opts, const array::Scalar &ice_thickness, const array::Scalar &sea_level_elevation)
Definition BedDef.cc:112
virtual MaxTimestep max_timestep_impl(double t) const
Definition BedDef.cc:238
void update(const array::Scalar &ice_thickness, const array::Scalar &sea_level_elevation, double t, double dt)
Definition BedDef.cc:198
double m_update_interval
Update interval in seconds.
Definition BedDef.hh:92
void bootstrap(const array::Scalar &bed_elevation, const array::Scalar &bed_uplift, const array::Scalar &ice_thickness, const array::Scalar &sea_level_elevation)
Initialize using provided bed elevation and uplift.
Definition BedDef.cc:179
virtual ~BedDef()=default
array::Scalar2 m_topg
current bed elevation
Definition BedDef.hh:78
virtual void bootstrap_impl(const array::Scalar &bed_elevation, const array::Scalar &bed_uplift, const array::Scalar &ice_thickness, const array::Scalar &sea_level_elevation)=0
Definition BedDef.cc:191
std::string m_model_name
Definition BedDef.hh:98
array::Scalar m_uplift
bed uplift rate
Definition BedDef.hh:87
const array::Scalar & uplift() const
Definition BedDef.cc:75
const array::Scalar & bed_elevation() const
Definition BedDef.cc:71
virtual void init_impl(const InputOptions &opts, const array::Scalar &ice_thickness, const array::Scalar &sea_level_elevation)=0
double m_t_last
time of the last bed deformation update
Definition BedDef.hh:90
static void apply_topg_offset(const std::string &filename, array::Scalar &bed_topography)
Definition BedDef.cc:271
array::Scalar m_load
Definition BedDef.hh:83
double m_t_eps
Temporal resolution to use when checking whether it's time to update.
Definition BedDef.hh:94
PISM bed deformation model (base class).
Definition BedDef.hh:37
void bootstrap_impl(const array::Scalar &bed_elevation, const array::Scalar &bed_uplift, const array::Scalar &ice_thickness, const array::Scalar &sea_level_elevation)
Definition Null.cc:37
MaxTimestep max_timestep_impl(double t) const
Definition Null.cc:49
void init_impl(const InputOptions &opts, const array::Scalar &ice_thickness, const array::Scalar &sea_level_elevation)
Definition Null.cc:32
void update_impl(const array::Scalar &load, double t, double dt)
Definition Null.cc:44
void bootstrap_impl(const array::Scalar &bed_elevation, const array::Scalar &bed_uplift, const array::Scalar &ice_thickness, const array::Scalar &sea_level_elevation)
array::Scalar m_load_last
last ice load (ice-equivalent thickness)
Definition BedDef.hh:138
virtual ~PointwiseIsostasy()=default
void init_impl(const InputOptions &opts, const array::Scalar &ice_thickness, const array::Scalar &sea_level_elevation)
void update_impl(const array::Scalar &load, double t, double dt)
Updates the pointwise isostasy model.
Point-wise isostasy bed deformation model.
Definition BedDef.hh:122
void accumulate_load(const array::Scalar &bed_elevation, const array::Scalar &ice_thickness, const array::Scalar &sea_level_elevation, double C, array::Scalar &result)
Definition BedDef.cc:301
double compute_load(double bed, double ice_thickness, double sea_level, double ice_density, double ocean_density)
Definition BedDef.cc:283
static const double g
Definition exactTestP.cc:36
std::map< std::string, Diagnostic::Ptr > DiagnosticList