tTemperatureIndex.hh - pism - [fork] customized build of PISM, the parallel ice sheet model (tillflux branch)
HTML git clone git://src.adamsgaard.dk/pism
DIR Log
DIR Files
DIR Refs
DIR LICENSE
---
tTemperatureIndex.hh (3850B)
---
1 // Copyright (C) 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 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 */
40 class TemperatureIndex : public SurfaceModel {
41 public:
42 TemperatureIndex(IceGrid::ConstPtr g, std::shared_ptr<atmosphere::AtmosphereModel> input);
43 virtual ~TemperatureIndex();
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
79 LocalMassBalance::DegreeDayFactors m_base_ddf;
80
81 //! K; daily amount of randomness
82 double m_base_pddStdDev;
83
84 double m_next_balance_year_start;
85
86 //! cached surface mass balance rate
87 IceModelVec2S m_mass_flux;
88
89 IceModelVec2S::Ptr m_temperature;
90
91 //! firn depth
92 IceModelVec2S m_firn_depth;
93
94 //! snow depth (reset once a year)
95 IceModelVec2S m_snow_depth;
96
97 //! standard deviation of the daily variability of the air temperature
98 IceModelVec2T::Ptr m_air_temp_sd;
99
100 //! total accumulation during the last time step
101 IceModelVec2S::Ptr m_accumulation;
102
103 //! total melt during the last time step
104 IceModelVec2S::Ptr m_melt;
105
106 //! total runoff during the last time step
107 IceModelVec2S::Ptr m_runoff;
108
109 bool m_sd_use_param, m_sd_file_set;
110 int m_sd_period;
111 double m_sd_param_a, m_sd_param_b;
112 };
113
114 } // end of namespace surface
115 } // end of namespace pism
116
117 #endif /* _PSTEMPERATUREINDEX_H_ */