PISM, A Parallel Ice Sheet Model  stable v2.0.4 committed by Constantine Khrulev on 2022-05-25 12:02:27 -0800
TemperatureIndex.hh
Go to the documentation of this file.
1 // Copyright (C) 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2021 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 _PSTEMPERATUREINDEX_H_
20 #define _PSTEMPERATUREINDEX_H_
21 
22 #include <memory>
23 
24 #include "pism/util/iceModelVec2T.hh"
25 #include "pism/coupler/SurfaceModel.hh"
26 #include "localMassBalance.hh"
27 
28 namespace pism {
29 namespace surface {
30 
31 //! @brief A class implementing a temperature-index (positive degree-day) scheme
32 //! to compute melt and runoff, and thus surface mass balance, from
33 //! precipitation and air temperature.
34 /*!
35  Temperature-index schemes are far from perfect as a way of modeling surface mass
36  balance on ice sheets which experience surface melt, but they are known to have
37  reasonable data requirements and to do a good job when tuned appropriately
38  [@ref Hock05].
39 */
41 public:
42  TemperatureIndex(IceGrid::ConstPtr g, std::shared_ptr<atmosphere::AtmosphereModel> input);
43  virtual ~TemperatureIndex() = default;
44 
45  // diagnostics (for the last time step)
46  const IceModelVec2S& firn_depth() const;
47  const IceModelVec2S& snow_depth() const;
48  // these represent totals (not rates) over the time step
49  const IceModelVec2S& air_temp_sd() const;
50 
51 protected:
52  virtual void init_impl(const Geometry &geometry);
53  virtual void update_impl(const Geometry &geometry, double t, double dt);
54  virtual MaxTimestep max_timestep_impl(double t) const;
55 
56  virtual void define_model_state_impl(const File &output) const;
57  virtual void write_model_state_impl(const File &output) const;
58 
59  virtual DiagnosticList diagnostics_impl() const;
60  virtual TSDiagnosticList ts_diagnostics_impl() const;
61 
62  virtual const IceModelVec2S& mass_flux_impl() const;
63  virtual const IceModelVec2S& temperature_impl() const;
64 
65  virtual const IceModelVec2S& accumulation_impl() const;
66  virtual const IceModelVec2S& melt_impl() const;
67  virtual const IceModelVec2S& runoff_impl() const;
68 
69  double compute_next_balance_year_start(double time);
70 protected:
71  //! mass balance scheme to use
72 
73  std::unique_ptr<LocalMassBalance> m_mbscheme;
74 
75  //! if not NULL then user wanted fausto PDD stuff
76  std::unique_ptr<FaustoGrevePDDObject> m_faustogreve;
77 
78  //! holds degree-day factors in location-independent case
80 
81  //! K; daily amount of randomness
83 
85 
86  //! cached surface mass balance rate
88 
90 
91  //! firn depth
93 
94  //! snow depth (reset once a year)
96 
97  //! standard deviation of the daily variability of the air temperature
98  std::shared_ptr<IceModelVec2T> m_air_temp_sd;
99 
100  //! total accumulation during the last time step
102 
103  //! total melt during the last time step
105 
106  //! total runoff during the last time step
108 
111 };
112 
113 } // end of namespace surface
114 } // end of namespace pism
115 
116 #endif /* _PSTEMPERATUREINDEX_H_ */
High-level PISM I/O class.
Definition: File.hh:51
std::shared_ptr< const IceGrid > ConstPtr
Definition: IceGrid.hh:233
std::shared_ptr< IceModelVec2S > Ptr
Definition: iceModelVec.hh:341
Combines the max. time step with the flag indicating if a restriction is active. Makes is possible to...
Definition: MaxTimestep.hh:31
The interface of PISM's surface models.
Definition: SurfaceModel.hh:45
virtual const IceModelVec2S & runoff_impl() const
virtual const IceModelVec2S & accumulation_impl() const
IceModelVec2S m_firn_depth
firn depth
virtual TSDiagnosticList ts_diagnostics_impl() const
virtual void init_impl(const Geometry &geometry)
IceModelVec2S m_mass_flux
cached surface mass balance rate
virtual void update_impl(const Geometry &geometry, double t, double dt)
virtual const IceModelVec2S & mass_flux_impl() const
virtual const IceModelVec2S & melt_impl() const
TemperatureIndex(IceGrid::ConstPtr g, std::shared_ptr< atmosphere::AtmosphereModel > input)
std::shared_ptr< IceModelVec2T > m_air_temp_sd
standard deviation of the daily variability of the air temperature
std::unique_ptr< FaustoGrevePDDObject > m_faustogreve
if not NULL then user wanted fausto PDD stuff
virtual const IceModelVec2S & temperature_impl() const
double compute_next_balance_year_start(double time)
virtual MaxTimestep max_timestep_impl(double t) const
virtual ~TemperatureIndex()=default
IceModelVec2S m_snow_depth
snow depth (reset once a year)
double m_base_pddStdDev
K; daily amount of randomness.
const IceModelVec2S & firn_depth() const
virtual void define_model_state_impl(const File &output) const
The default (empty implementation).
IceModelVec2S::Ptr m_runoff
total runoff during the last time step
const IceModelVec2S & air_temp_sd() const
const IceModelVec2S & snow_depth() const
IceModelVec2S::Ptr m_accumulation
total accumulation during the last time step
virtual void write_model_state_impl(const File &output) const
The default (empty implementation).
virtual DiagnosticList diagnostics_impl() const
std::unique_ptr< LocalMassBalance > m_mbscheme
mass balance scheme to use
IceModelVec2S::Ptr m_melt
total melt during the last time step
LocalMassBalance::DegreeDayFactors m_base_ddf
holds degree-day factors in location-independent case
A class implementing a temperature-index (positive degree-day) scheme to compute melt and runoff,...
static const double g
Definition: exactTestP.cc:39
std::map< std::string, TSDiagnostic::Ptr > TSDiagnosticList
Definition: Diagnostic.hh:346
std::map< std::string, Diagnostic::Ptr > DiagnosticList
Definition: Diagnostic.hh:117
A struct which holds degree day factors.