PISM, A Parallel Ice Sheet Model 2.3.0-79cae578d committed by Constantine Khrulev on 2026-03-22
Loading...
Searching...
No Matches
EISMINTII.cc
Go to the documentation of this file.
1/* Copyright (C) 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#include <cmath> // std::pow(), std::sqrt()
20#include <algorithm> // std::min
21
22#include "pism/coupler/surface/EISMINTII.hh"
23#include "pism/util/Config.hh"
24#include "pism/util/pism_options.hh"
25#include "pism/util/Grid.hh"
26#include "pism/util/MaxTimestep.hh"
27#include "pism/util/Logger.hh"
28
29namespace pism {
30namespace surface {
31
32EISMINTII::EISMINTII(std::shared_ptr<const Grid> g, int experiment)
33 : PSFormulas(g), m_experiment(experiment) {
34 // empty
35}
36
37void EISMINTII::init_impl(const Geometry &geometry) {
38 (void) geometry;
39
40 using units::convert;
41
42 m_log->message(2,
43 "setting parameters for surface mass balance"
44 " and temperature in EISMINT II experiment %c ... \n",
46
47 // EISMINT II specified values for parameters
48 m_S_b = convert(m_sys, 1.0e-2 * 1e-3, "year-1", "second-1"); // Grad of accum rate change
49 m_S_T = 1.67e-2 * 1e-3; // K/m Temp gradient
50
51 // these are for A,E,G,H,I,K:
52 m_M_max = convert(m_sys, 0.5, "m year-1", "m second-1"); // Max accumulation
53 m_R_el = 450.0e3; // Distance to equil line (SMB=0)
54 m_T_min = 238.15;
55
56 switch (m_experiment) {
57 case 'B': // supposed to start from end of experiment A and:
58 m_T_min = 243.15;
59 break;
60 case 'C':
61 case 'J':
62 case 'L': // supposed to start from end of experiment A (for C;
63 // resp I and K for J and L) and:
64 m_M_max = convert(m_sys, 0.25, "m year-1", "m second-1");
65 m_R_el = 425.0e3;
66 break;
67 case 'D': // supposed to start from end of experiment A and:
68 m_R_el = 425.0e3;
69 break;
70 case 'F': // start with zero ice and:
71 m_T_min = 223.15;
72 break;
73 }
74
75 // if user specifies Tmin, Tmax, Mmax, Sb, ST, Rel, then use that (override above)
76 m_T_min = options::Real(m_sys, "-Tmin", "T min, kelvin", "kelvin", m_T_min);
77
78 options::Real Mmax(m_sys, "-Mmax", "Maximum accumulation, m year-1",
79 "m year-1",
80 convert(m_sys, m_M_max, "m second-1", "m year-1"));
81 if (Mmax.is_set()) {
82 m_M_max = convert(m_sys, Mmax, "m year-1", "m second-1");
83 }
84
85 options::Real Sb(m_sys, "-Sb", "radial gradient of accumulation rate, (m year-1)/km",
86 "m year-1/km",
87 convert(m_sys, m_S_b, "m second-1/m", "m year-1/km"));
88 if (Sb.is_set()) {
89 m_S_b = convert(m_sys, Sb, "m year-1/km", "m second-1/m");
90 }
91
92 options::Real ST(m_sys, "-ST", "radial gradient of surface temperature, K/km",
93 "K/km",
94 convert(m_sys, m_S_T, "K/m", "K/km"));
95 if (ST.is_set()) {
96 m_S_T = convert(m_sys, ST, "K/km", "K/m");
97 }
98
99 options::Real Rel(m_sys, "-Rel", "radial distance to equilibrium line, km",
100 "km",
101 convert(m_sys, m_R_el, "m", "km"));
102 if (Rel.is_set()) {
103 m_R_el = convert(m_sys, Rel, "km", "m");
104 }
105
107}
108
110 (void) t;
111 return MaxTimestep("surface EISMINT-II");
112}
113
115 using std::pow;
116 using std::sqrt;
117
118 // center of the accumulation and surface temperature patterns
119 double cx = 0.0, cy = 0.0;
120 if (m_experiment == 'E') {
121 cx += 100.0e3;
122 cy += 100.0e3;
123 }
124
126
127 for (auto p : m_grid->points()) {
128 const int i = p.i(), j = p.j();
129
130 const double r = sqrt(pow(m_grid->x(i) - cx, 2) + pow(m_grid->y(j) - cy, 2));
131
132 // accumulation (formula (7) in [Payne et al 2000])
133 (*m_mass_flux)(i,j) = std::min(m_M_max, m_S_b * (m_R_el-r));
134
135 // surface temperature (formula (8) in [Payne et al 2000])
136 (*m_temperature)(i,j) = m_T_min + m_S_T * r;
137 }
138
139 // convert from "m second-1" to "kg m-2 s-1"
140 m_mass_flux->scale(m_config->get_number("constants.ice.density"));
141}
142
143void EISMINTII::update_impl(const Geometry &geometry, double t, double dt) {
144 (void) t;
145 (void) dt;
146 (void) geometry;
147
151
152}
153
154} // end of namespace surface
155} // 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
Combines the max. time step with the flag indicating if a restriction is active. Makes is possible to...
Makes sure that we call begin_access() and end_access() for all accessed array::Arrays.
Definition Array.hh:66
bool is_set() const
Definition options.hh:35
EISMINTII(std::shared_ptr< const Grid > g, int experiment)
Definition EISMINTII.cc:32
void update_impl(const Geometry &geometry, double t, double dt)
Definition EISMINTII.cc:143
virtual MaxTimestep max_timestep_impl(double t) const
Definition EISMINTII.cc:109
void init_impl(const Geometry &geometry)
Definition EISMINTII.cc:37
std::shared_ptr< array::Scalar > m_temperature
Definition Formulas.hh:50
std::shared_ptr< array::Scalar > m_mass_flux
Definition Formulas.hh:49
void dummy_accumulation(const array::Scalar &smb, array::Scalar &result)
std::shared_ptr< array::Scalar > m_melt
std::shared_ptr< array::Scalar > m_runoff
void dummy_melt(const array::Scalar &smb, array::Scalar &result)
std::shared_ptr< array::Scalar > m_accumulation
void dummy_runoff(const array::Scalar &smb, array::Scalar &result)
double convert(System::Ptr system, double input, const std::string &spec1, const std::string &spec2)
Convert a quantity from unit1 to unit2.
Definition Units.cc:70
static const double g
Definition exactTestP.cc:36