PISM, A Parallel Ice Sheet Model 2.3.0-79cae578d committed by Constantine Khrulev on 2026-03-22
Loading...
Searching...
No Matches
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, 2025 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 std::set<VariableMetadata> state_impl() const;
60 virtual void write_state_impl(const OutputFile &output) const;
61
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
96 //! Name of the variable used to store the last update time.
97 std::string m_time_name;
98
99
100 std::string m_model_name;
101};
102
103/*!
104 * The do-nothing bed deformation model.
105 */
106class Null : public BedDef {
107public:
108 Null(std::shared_ptr<const Grid> g);
109protected:
110 void update_impl(const array::Scalar &load, double t, double dt);
111
112 void init_impl(const InputOptions &opts, const array::Scalar &ice_thickness,
113 const array::Scalar &sea_level_elevation);
114
116 const array::Scalar &bed_uplift,
117 const array::Scalar &ice_thickness,
118 const array::Scalar &sea_level_elevation);
119
120 MaxTimestep max_timestep_impl(double t) const;
121};
122
123//! Point-wise isostasy bed deformation model.
124class PointwiseIsostasy : public BedDef {
125public:
126 PointwiseIsostasy(std::shared_ptr<const Grid> g);
127 virtual ~PointwiseIsostasy() = default;
128protected:
129 void init_impl(const InputOptions &opts, const array::Scalar &ice_thickness,
130 const array::Scalar &sea_level_elevation);
131
133 const array::Scalar &bed_uplift,
134 const array::Scalar &ice_thickness,
135 const array::Scalar &sea_level_elevation);
136
137 void update_impl(const array::Scalar &load, double t, double dt);
138
139 //! last ice load (ice-equivalent thickness)
141};
142
143} // end of namespace bed
144} // end of namespace pism
145
146#endif // __BedDef_hh
A class defining a common interface for most PISM sub-models.
Definition Component.hh:118
Combines the max. time step with the flag indicating if a restriction is active. Makes is possible to...
virtual DiagnosticList spatial_diagnostics_impl() const
Definition BedDef.cc:107
std::string m_time_name
Name of the variable used to store the last update time.
Definition BedDef.hh:97
array::Scalar m_load_accumulator
Definition BedDef.hh:84
virtual void write_state_impl(const OutputFile &output) const
The default (empty implementation).
Definition BedDef.cc:96
array::Scalar m_topg_last
bed elevation at the time of the last update
Definition BedDef.hh:81
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:116
virtual MaxTimestep max_timestep_impl(double t) const
Definition BedDef.cc:247
void update(const array::Scalar &ice_thickness, const array::Scalar &sea_level_elevation, double t, double dt)
Definition BedDef.cc:207
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:188
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:200
std::string m_model_name
Definition BedDef.hh:100
array::Scalar m_uplift
bed uplift rate
Definition BedDef.hh:87
const array::Scalar & uplift() const
Definition BedDef.cc:78
const array::Scalar & bed_elevation() const
Definition BedDef.cc:74
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:280
array::Scalar m_load
Definition BedDef.hh:83
virtual std::set< VariableMetadata > state_impl() const
Definition BedDef.cc:82
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:140
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:124
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:310
double compute_load(double bed, double ice_thickness, double sea_level, double ice_density, double ocean_density)
Definition BedDef.cc:292
static const double g
Definition exactTestP.cc:36
std::map< std::string, Diagnostic::Ptr > DiagnosticList