PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
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 
27 namespace pism {
28 namespace 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 */
39 class DEBMSimple : public SurfaceModel {
40 public:
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 
62  const DEBMSimplePointwise& pointwise_model() const;
63 private:
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 
132  double m_sd_param_a;
133  double m_sd_param_b;
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:56
Combines the max. time step with the flag indicating if a restriction is active. Makes is possible to...
Definition: MaxTimestep.hh:31
A dEBM-simple implementation.
array::Scalar m_insolation_driven_melt
total insolation melt during the last time step
Definition: DEBMSimple.hh:110
const array::Scalar & atmosphere_transmissivity() const
Definition: DEBMSimple.cc:545
virtual const array::Scalar & mass_flux_impl() const
Definition: DEBMSimple.cc:501
std::shared_ptr< array::Scalar > m_melt
total melt during the last time step
Definition: DEBMSimple.hh:101
virtual void update_impl(const Geometry &geometry, double t, double dt)
Definition: DEBMSimple.cc:266
double snow_accumulation(double T, double P) const
Extracts snow accumulation from mixed (snow and rain) precipitation using a temperature threshold wit...
Definition: DEBMSimple.cc:245
const array::Scalar & insolation_driven_melt() const
Definition: DEBMSimple.cc:529
const array::Scalar & surface_albedo() const
Definition: DEBMSimple.cc:541
array::Scalar m_surface_albedo
albedo field
Definition: DEBMSimple.hh:116
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
Definition: DEBMSimple.hh:104
array::Scalar m_temperature_driven_melt
total temperature melt during the last time step
Definition: DEBMSimple.hh:107
const array::Scalar & air_temp_sd() const
Definition: DEBMSimple.cc:525
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).
Definition: DEBMSimple.cc:549
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).
Definition: DEBMSimple.cc:555
double m_Tmax
the temperature above which all precipitation is rain
Definition: DEBMSimple.hh:140
const array::Scalar & runoff_impl() const
Definition: DEBMSimple.cc:517
unsigned int m_n_per_year
number of small time steps per year
Definition: DEBMSimple.hh:129
array::Scalar m_transmissivity
transmissivity field
Definition: DEBMSimple.hh:122
double compute_next_balance_year_start(double time)
Definition: DEBMSimple.cc:218
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.
Definition: DEBMSimple.cc:776
DEBMSimplePointwise m_model
Definition: DEBMSimple.hh:82
virtual DiagnosticList diagnostics_impl() const
Definition: DEBMSimple.cc:782
const array::Scalar & offset_melt() const
Definition: DEBMSimple.cc:537
const array::Scalar & accumulation_impl() const
Definition: DEBMSimple.cc:509
const array::Scalar & snow_depth() const
Definition: DEBMSimple.cc:521
const array::Scalar & temperature_driven_melt() const
Definition: DEBMSimple.cc:533
virtual MaxTimestep max_timestep_impl(double t) const
Definition: DEBMSimple.cc:214
const array::Scalar & melt_impl() const
Definition: DEBMSimple.cc:513
array::Scalar m_offset_melt
total offset_melt during the last timestep
Definition: DEBMSimple.hh:113
DEBMSimple(std::shared_ptr< const Grid > g, std::shared_ptr< atmosphere::AtmosphereModel > input)
Definition: DEBMSimple.cc:42
virtual void init_impl(const Geometry &geometry)
Definition: DEBMSimple.cc:166
double m_Tmin
the temperature below which all precipitation is snow
Definition: DEBMSimple.hh:138
std::shared_ptr< array::Scalar > m_temperature
Definition: DEBMSimple.hh:89
const DEBMSimplePointwise & pointwise_model() const
Definition: DEBMSimple.cc:561
std::shared_ptr< array::Forcing > m_input_albedo
if albedo is given as input field
Definition: DEBMSimple.hh:119
virtual const array::Scalar & temperature_impl() const
Definition: DEBMSimple.cc:505
bool m_precip_as_snow
interpret all the precipitation as snow (no rain)
Definition: DEBMSimple.hh:136
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.
Definition: SurfaceModel.hh:42
static const double g
Definition: exactTestP.cc:36
std::map< std::string, Diagnostic::Ptr > DiagnosticList
Definition: Diagnostic.hh:125