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
PointwiseIsostasy.cc
Go to the documentation of this file.
1// Copyright (C) 2010, 2011, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2022, 2023, 2024 Constantine Khroulev
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#include "pism/earth/BedDef.hh"
20#include "pism/util/Grid.hh"
21#include "pism/util/ConfigInterface.hh"
22
23namespace pism {
24namespace bed {
25
26PointwiseIsostasy::PointwiseIsostasy(std::shared_ptr<const Grid> grid)
27 : BedDef(grid, "pointwise isostasy"), m_load_last(m_grid, "load_last") {
28 // empty
29}
30
31void PointwiseIsostasy::init_impl(const InputOptions &/*opts*/, const array::Scalar &ice_thickness,
32 const array::Scalar &sea_level_elevation) {
33 // store the initial load
34 m_load_last.set(0.0);
35 accumulate_load(m_topg, ice_thickness, sea_level_elevation, 1.0, m_load_last);
36}
37
38
40 const array::Scalar &/*bed_uplift*/,
41 const array::Scalar &ice_thickness,
42 const array::Scalar &sea_level_elevation) {
43 // store initial load and bed elevation
44 m_load_last.set(0.0);
45 accumulate_load(bed_elevation, ice_thickness, sea_level_elevation, 1.0, m_load_last);
47}
48
49//! Updates the pointwise isostasy model.
50/*!
51 * Inputs:
52 *
53 * - ice thickness
54 * - sea level
55 * - old bed elevation
56 * - old load
57 *
58 * Outputs:
59 *
60 * - new bed elevation
61 * - updated "old" load
62 */
64 double /*t*/, double /*dt*/) {
65 const double
66 mantle_density = m_config->get_number("bed_deformation.mantle_density"),
67 load_density = m_config->get_number("constants.ice.density"),
68 f = load_density / mantle_density;
69
70 // Our goal: topg_{n+1} = topg_{n} - f*(load(topg_{n}) - load_{n-1})
71
73
74 ParallelSection loop(m_grid->com);
75 try {
76 for (auto p = m_grid->points(); p; p.next()) {
77 const int i = p.i(), j = p.j();
78
79 m_topg(i, j) = m_topg_last(i, j) - f * (load(i, j) - m_load_last(i, j));
80 m_load_last(i, j) = load(i, j);
81 }
82 } catch (...) {
83 loop.failed();
84 }
85 loop.check();
86
87 // mark m_topg as "modified"
89}
90
91} // end of namespace bed
92} // end of namespace pism
const Config::ConstPtr m_config
configuration database used by this component
Definition Component.hh:158
const std::shared_ptr< const Grid > m_grid
grid used by this component
Definition Component.hh:156
void failed()
Indicates a failure of a parallel section.
Makes sure that we call begin_access() and end_access() for all accessed array::Arrays.
Definition Array.hh:64
void copy_from(const Array2D< T > &source)
Definition Array2D.hh:73
void set(double c)
Result: v[j] <- c for all j.
Definition Array.cc:629
void inc_state_counter()
Increment the object state counter.
Definition Array.cc:150
array::Scalar m_topg_last
bed elevation at the time of the last update
Definition BedDef.hh:81
array::Scalar2 m_topg
current bed elevation
Definition BedDef.hh:78
const array::Scalar & bed_elevation() const
Definition BedDef.cc:71
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)
array::Scalar m_load_last
last ice load (ice-equivalent thickness)
Definition BedDef.hh:138
PointwiseIsostasy(std::shared_ptr< const Grid > g)
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.
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