PISM, A Parallel Ice Sheet Model 2.3.0-79cae578d committed by Constantine Khrulev on 2026-03-22
Loading...
Searching...
No Matches
HayhurstCalving.cc
Go to the documentation of this file.
1/* Copyright (C) 2016, 2017, 2018, 2019, 2021, 2022, 2023, 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
20#include "pism/frontretreat/calving/HayhurstCalving.hh"
21
22#include "pism/util/Grid.hh"
23#include "pism/util/error_handling.hh"
24#include "pism/util/array/CellType.hh"
25#include "pism/util/Logger.hh"
26
27namespace pism {
28namespace calving {
29
30HayhurstCalving::HayhurstCalving(std::shared_ptr<const Grid> grid)
31 : Component(grid),
32 m_calving_rate(grid, "hayhurst_calving_rate")
33{
35 .long_name("horizontal calving rate due to Hayhurst calving")
36 .units("m s^-1")
37 .output_units("m day^-1");
38}
39
41
42 m_log->message(2,
43 "* Initializing the 'Hayhurst calving' mechanism...\n");
44
45 m_B_tilde = m_config->get_number("calving.hayhurst_calving.B_tilde");
46 m_exponent_r = m_config->get_number("calving.hayhurst_calving.exponent_r");
47 m_sigma_threshold = m_config->get_number("calving.hayhurst_calving.sigma_threshold", "Pa");
48
49 m_log->message(2,
50 " B tilde parameter: %3.3f MPa-%3.3f yr-1.\n", m_B_tilde, m_exponent_r);
51 m_log->message(2,
52 " Hayhurst calving threshold: %3.3f MPa.\n",
53 convert(m_sys, m_sigma_threshold, "Pa", "MPa"));
54
55 if (fabs(m_grid->dx() - m_grid->dy()) / std::min(m_grid->dx(), m_grid->dy()) > 1e-2) {
57 "-calving hayhurst_calving using a non-square grid cell is not implemented (yet);\n"
58 "dx = %f, dy = %f, relative difference = %f",
59 m_grid->dx(), m_grid->dy(),
60 fabs(m_grid->dx() - m_grid->dy()) / std::max(m_grid->dx(), m_grid->dy()));
61 }
62
63}
64
66 const array::Scalar &ice_thickness,
67 const array::Scalar &sea_level,
68 const array::Scalar &bed_elevation) {
69
70 using std::min;
71
72 const double
73 ice_density = m_config->get_number("constants.ice.density"),
74 water_density = m_config->get_number("constants.sea_water.density"),
75 gravity = m_config->get_number("constants.standard_gravity"),
76 // convert "Pa" to "MPa" and "m yr-1" to "m s-1"
77 unit_scaling = pow(1e-6, m_exponent_r) * convert(m_sys, 1.0, "m year-1", "m second-1");
78
79 array::AccessScope list{&ice_thickness, &cell_type, &m_calving_rate, &sea_level,
80 &bed_elevation};
81
82 for (auto pt : m_grid->points()) {
83 const int i = pt.i(), j = pt.j();
84
85 double water_depth = sea_level(i, j) - bed_elevation(i, j);
86
87 if (cell_type.icy(i, j) and water_depth > 0.0) {
88 // note that ice_thickness > 0 at icy locations
89 assert(ice_thickness(i, j) > 0);
90
91 double H = ice_thickness(i, j);
92
93 // Note that for ice at floatation water_depth = H * (ice_density / water_density),
94 // so omega cannot exceed ice_density / water_density.
95 double omega = water_depth / H;
96
97 // Extend the calving parameterization to ice shelves. This tweak should (I hope)
98 // prevent a feedback in which the creation of an ice shelf reduces the calving
99 // rate, which leads to an advance of the front and an even lower calving rate, etc.
100 if (omega > ice_density / water_density) {
101 // ice at the front is floating
102 double freeboard = (1.0 - ice_density / water_density) * H;
103 H = water_depth + freeboard;
104 omega = water_depth / H;
105 }
106
107 // [\ref Mercenier2018] maximum tensile stress approximation
108 double sigma_0 = (0.4 - 0.45 * pow(omega - 0.065, 2.0)) * ice_density * gravity * H;
109
110 // ensure that sigma_0 - m_sigma_threshold >= 0
111 sigma_0 = std::max(sigma_0, m_sigma_threshold);
112
113 // [\ref Mercenier2018] equation 22
114 m_calving_rate(i, j) = (m_B_tilde * unit_scaling *
115 (1.0 - pow(omega, 2.8)) *
116 pow(sigma_0 - m_sigma_threshold, m_exponent_r) * H);
117 } else { // end of "if (ice_free_ocean and next_to_floating)"
118 m_calving_rate(i, j) = 0.0;
119 }
120 } // end of loop over grid points
121
122 // Set calving rate *near* grounded termini to the average of grounded icy
123 // neighbors: front retreat code uses values at these locations (the rest is for
124 // visualization).
125
127
128 for (auto p : m_grid->points()) {
129 const int i = p.i(), j = p.j();
130
131 if (cell_type.ice_free(i, j) and cell_type.next_to_ice(i, j) ) {
132
133 auto R = m_calving_rate.star(i, j);
134 auto M = cell_type.star(i, j);
135
136 int N = 0;
137 double R_sum = 0.0;
138 for (auto d : {North, East, South, West}) {
139 if (mask::icy(M[d])) {
140 R_sum += R[d];
141 N++;
142 }
143 }
144
145 if (N > 0) {
146 m_calving_rate(i, j) = R_sum / N;
147 }
148 }
149 }
150}
151
155
157 return {{"hayhurst_calving_rate", Diagnostic::wrap(m_calving_rate)}};
158}
159
160} // end of namespace calving
161} // end of namespace pism
const units::System::Ptr m_sys
unit system used by this component
Definition Component.hh:162
std::shared_ptr< const Config > m_config
configuration database used by this component
Definition Component.hh:160
const std::shared_ptr< const Grid > m_grid
grid used by this component
Definition Component.hh:158
std::shared_ptr< const Logger > m_log
logger (for easy access)
Definition Component.hh:164
A class defining a common interface for most PISM sub-models.
Definition Component.hh:118
static Ptr wrap(const T &input)
static RuntimeError formatted(const ErrorLocation &location, const char format[],...) __attribute__((format(printf
build a RuntimeError with a formatted message
VariableMetadata & long_name(const std::string &input)
VariableMetadata & units(const std::string &input)
VariableMetadata & output_units(const std::string &input)
Makes sure that we call begin_access() and end_access() for all accessed array::Arrays.
Definition Array.hh:66
stencils::Star< T > star(int i, int j) const
Definition Array2D.hh:107
void update_ghosts()
Updates ghost points.
Definition Array.cc:645
VariableMetadata & metadata(unsigned int N=0)
Returns a reference to the VariableMetadata object containing metadata for the compoment N.
Definition Array.cc:467
bool next_to_ice(int i, int j) const
Ice-free margin (at least one of four neighbors has ice).
Definition CellType.hh:87
bool ice_free(int i, int j) const
Definition CellType.hh:54
bool icy(int i, int j) const
Definition CellType.hh:42
const array::Scalar & calving_rate() const
DiagnosticList spatial_diagnostics_impl() const
HayhurstCalving(std::shared_ptr< const Grid > grid)
void update(const array::CellType1 &cell_type, const array::Scalar &ice_thickness, const array::Scalar &sea_level, const array::Scalar &bed_elevation)
#define PISM_ERROR_LOCATION
bool icy(int M)
Ice-filled cell (grounded or floating).
Definition Mask.hh:48
std::map< std::string, Diagnostic::Ptr > DiagnosticList
@ North
Definition stencils.hh:24
@ East
Definition stencils.hh:24
@ South
Definition stencils.hh:24
@ West
Definition stencils.hh:24