PISM, A Parallel Ice Sheet Model 2.3.0-79cae578d committed by Constantine Khrulev on 2026-03-22
Loading...
Searching...
No Matches
Runoff_SMB.cc
Go to the documentation of this file.
1// Copyright (C) 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 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>
20
21#include "pism/coupler/ocean/Runoff_SMB.hh"
22#include "pism/util/ScalarForcing.hh"
23#include "pism/util/Logger.hh"
24
25namespace pism {
26namespace ocean {
27
28Runoff_SMB::Runoff_SMB(std::shared_ptr<const Grid> g, std::shared_ptr<OceanModel> in)
29 : OceanModel(g, in) {
30
31 m_forcing.reset(new ScalarForcing(*g->ctx(),
32 "ocean.runoff_to_ocean_melt",
33 "delta_T",
34 "kelvin",
35 "kelvin",
36 "air temperature offsets"));
37
38 m_temp_to_runoff_a = m_config->get_number("surface.temp_to_runoff_a");
39 m_runoff_to_ocean_melt_b = m_config->get_number("ocean.runoff_to_ocean_melt.b");
40
41 m_runoff_to_ocean_melt_power_alpha = m_config->get_number("ocean.runoff_to_ocean_melt.power_alpha");
42 m_runoff_to_ocean_melt_power_beta = m_config->get_number("ocean.runoff_to_ocean_melt.power_beta");
43
45}
46
48 // empty
49}
50
51void Runoff_SMB::init_impl(const Geometry &geometry) {
52
53 m_input_model->init(geometry);
54
55 m_log->message(2,
56 "* Initializing ice shelf base mass flux forcing using scalar multiplier...\n"
57 "* derived from delta_T air temperature modifier\n");
58}
59
60void Runoff_SMB::update_impl(const Inputs &inputs, double t, double dt) {
61 m_input_model->update(inputs, t, dt);
62
63 mass_flux(m_forcing->value(t + 0.5 * dt), *m_shelf_base_mass_flux);
64}
65
66void Runoff_SMB::mass_flux(double delta_T, array::Scalar &result) const {
67
68 // short-cuts, just to make the formula below easier to read
69 double
74 scale_factor = 1.0;
75
76 /*
77 This parameterization only works if delta_T > 0 because
78 negative numbers cannot be raised to a fractional power
79 so we do not scale the forcing if delta_T < 0
80 */
81 if (delta_T > 0.0) {
82 scale_factor = 1 + B * pow(a * delta_T, alpha) * pow(delta_T, beta);
83 }
84 result.scale(scale_factor);
85}
86
87} // end of namespace ocean
88} // end of namespace pism
std::shared_ptr< const Config > m_config
configuration database used by this component
Definition Component.hh:160
std::shared_ptr< const Logger > m_log
logger (for easy access)
Definition Component.hh:164
void scale(double alpha)
Result: v <- v * alpha. Calls VecScale.
Definition Array.cc:227
std::shared_ptr< OceanModel > m_input_model
Definition OceanModel.hh:77
static std::shared_ptr< array::Scalar > allocate_shelf_base_mass_flux(std::shared_ptr< const Grid > g)
Definition OceanModel.cc:39
A very rudimentary PISM ocean model.
Definition OceanModel.hh:38
std::unique_ptr< ScalarForcing > m_forcing
Definition Runoff_SMB.hh:76
double m_runoff_to_ocean_melt_power_beta
Definition Runoff_SMB.hh:73
void update_impl(const Inputs &inputs, double t, double dt)
Definition Runoff_SMB.cc:60
void mass_flux(double delta_T, array::Scalar &result) const
Definition Runoff_SMB.cc:66
double m_runoff_to_ocean_melt_power_alpha
Definition Runoff_SMB.hh:72
std::shared_ptr< array::Scalar > m_shelf_base_mass_flux
Definition Runoff_SMB.hh:75
Runoff_SMB(std::shared_ptr< const Grid > g, std::shared_ptr< OceanModel > in)
Definition Runoff_SMB.cc:28
void init_impl(const Geometry &geometry)
Definition Runoff_SMB.cc:51
bool ocean(int M)
An ocean cell (floating ice or ice-free).
Definition Mask.hh:40
static const double g
Definition exactTestP.cc:36