PISM, A Parallel Ice Sheet Model 2.2.1-cd005eec8 committed by Constantine Khrulev on 2025-03-07
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DEBMSimple.hh
Go to the documentation of this file.
1// Copyright (C) 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2022, 2023 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 PISM_DEBM_SIMPLE_H
20#define PISM_DEBM_SIMPLE_H
21
22#include <memory>
23
24#include "pism/coupler/surface/DEBMSimplePointwise.hh"
25#include "pism/coupler/SurfaceModel.hh"
26
27namespace pism {
28namespace surface {
29
30//! @brief A class implementing a temperature-index (positive degree-day) scheme
31//! to compute melt and runoff, and thus surface mass balance, from
32//! precipitation and air temperature.
33/*!
34 Temperature-index schemes are far from perfect as a way of modeling surface mass
35 balance on ice sheets which experience surface melt, but they are known to have
36 reasonable data requirements and to do a good job when tuned appropriately
37 [@ref Hock05].
38*/
39class DEBMSimple : public SurfaceModel {
40public:
41 DEBMSimple(std::shared_ptr<const Grid> g,
42 std::shared_ptr<atmosphere::AtmosphereModel> input);
43 virtual ~DEBMSimple() = default;
44
45 // diagnostics (for the last time step)
46 const array::Scalar &snow_depth() const;
47 // these represent totals (not rates) over the time step
48 const array::Scalar &air_temp_sd() const;
49 const array::Scalar &accumulation_impl() const;
50 const array::Scalar &melt_impl() const;
51 const array::Scalar &runoff_impl() const;
52
53 // Contributions to melt from insolation, temperature, and the offset melt:
56 const array::Scalar &offset_melt() const;
57
58 // diagnostics
59 const array::Scalar &surface_albedo() const;
61
63private:
64 virtual void init_impl(const Geometry &geometry);
65 virtual void update_impl(const Geometry &geometry, double t, double dt);
66 virtual MaxTimestep max_timestep_impl(double t) const;
67
68 virtual void define_model_state_impl(const File &output) const;
69 virtual void write_model_state_impl(const File &output) const;
70
71 virtual DiagnosticList diagnostics_impl() const;
72
73 virtual const array::Scalar &mass_flux_impl() const;
74 virtual const array::Scalar &temperature_impl() const;
75
77
78 double snow_accumulation(double T, double P) const;
79
80 unsigned int timeseries_length(double dt) const;
81
83
85
86 //! cached surface mass balance rate
88
89 std::shared_ptr<array::Scalar> m_temperature;
90
91 //! snow depth (reset once a year)
93
94 //! standard deviation of the daily variability of the air temperature
95 std::shared_ptr<array::Forcing> m_air_temp_sd;
96
97 //! total accumulation during the last time step
98 std::shared_ptr<array::Scalar> m_accumulation;
99
100 //! total melt during the last time step
101 std::shared_ptr<array::Scalar> m_melt;
102
103 //! total runoff during the last time step
104 std::shared_ptr<array::Scalar> m_runoff;
105
106 //! total temperature melt during the last time step
108
109 //! total insolation melt during the last time step
111
112 //! total offset_melt during the last timestep
114
115 //! albedo field
117
118 //! if albedo is given as input field
119 std::shared_ptr<array::Forcing> m_input_albedo;
120
121 //! transmissivity field
123
124 //! year length used to compute the time series length required to get m_n_per_year
125 //! evaluations
127
128 //! number of small time steps per year
129 unsigned int m_n_per_year;
130
134
135 //! interpret all the precipitation as snow (no rain)
137 //! the temperature below which all precipitation is snow
138 double m_Tmin;
139 //! the temperature above which all precipitation is rain
140 double m_Tmax;
141};
142
143} // end of namespace surface
144} // end of namespace pism
145
146#endif /* PISM_DEBM_SIMPLE_H */
const Time & time() const
Definition Component.cc:109
High-level PISM I/O class.
Definition File.hh:55
Combines the max. time step with the flag indicating if a restriction is active. Makes is possible to...
A dEBM-simple implementation.
array::Scalar m_insolation_driven_melt
total insolation melt during the last time step
const array::Scalar & atmosphere_transmissivity() const
virtual const array::Scalar & mass_flux_impl() const
std::shared_ptr< array::Scalar > m_melt
total melt during the last time step
virtual void update_impl(const Geometry &geometry, double t, double dt)
double snow_accumulation(double T, double P) const
Extracts snow accumulation from mixed (snow and rain) precipitation using a temperature threshold wit...
const array::Scalar & insolation_driven_melt() const
const array::Scalar & surface_albedo() const
array::Scalar m_surface_albedo
albedo field
array::Scalar m_mass_flux
cached surface mass balance rate
Definition DEBMSimple.hh:87
std::shared_ptr< array::Scalar > m_runoff
total runoff during the last time step
array::Scalar m_temperature_driven_melt
total temperature melt during the last time step
const array::Scalar & air_temp_sd() const
array::Scalar m_snow_depth
snow depth (reset once a year)
Definition DEBMSimple.hh:92
virtual void define_model_state_impl(const File &output) const
The default (empty implementation).
std::shared_ptr< array::Forcing > m_air_temp_sd
standard deviation of the daily variability of the air temperature
Definition DEBMSimple.hh:95
virtual void write_model_state_impl(const File &output) const
The default (empty implementation).
double m_Tmax
the temperature above which all precipitation is rain
const array::Scalar & runoff_impl() const
unsigned int m_n_per_year
number of small time steps per year
array::Scalar m_transmissivity
transmissivity field
double compute_next_balance_year_start(double time)
virtual ~DEBMSimple()=default
std::shared_ptr< array::Scalar > m_accumulation
total accumulation during the last time step
Definition DEBMSimple.hh:98
unsigned int timeseries_length(double dt) const
The number of points for temperature and precipitation time-series.
DEBMSimplePointwise m_model
Definition DEBMSimple.hh:82
virtual DiagnosticList diagnostics_impl() const
const array::Scalar & offset_melt() const
const array::Scalar & accumulation_impl() const
const array::Scalar & snow_depth() const
const array::Scalar & temperature_driven_melt() const
virtual MaxTimestep max_timestep_impl(double t) const
const array::Scalar & melt_impl() const
array::Scalar m_offset_melt
total offset_melt during the last timestep
virtual void init_impl(const Geometry &geometry)
double m_Tmin
the temperature below which all precipitation is snow
std::shared_ptr< array::Scalar > m_temperature
Definition DEBMSimple.hh:89
const DEBMSimplePointwise & pointwise_model() const
std::shared_ptr< array::Forcing > m_input_albedo
if albedo is given as input field
virtual const array::Scalar & temperature_impl() const
bool m_precip_as_snow
interpret all the precipitation as snow (no rain)
A class implementing a temperature-index (positive degree-day) scheme to compute melt and runoff,...
Definition DEBMSimple.hh:39
The interface of PISM's surface models.
static const double g
Definition exactTestP.cc:36
std::map< std::string, Diagnostic::Ptr > DiagnosticList