SNOWPACK  SNOWPACK-3.6.0
Metamorphism.h
Go to the documentation of this file.
1 /*
2  * SNOWPACK stand-alone
3  *
4  * Copyright WSL Institute for Snow and Avalanche Research SLF, DAVOS, SWITZERLAND
5 */
6 /* This file is part of Snowpack.
7  Snowpack is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  Snowpack is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with Snowpack. If not, see <http://www.gnu.org/licenses/>.
19 */
24 #ifndef METAMORPHISM_H
25 #define METAMORPHISM_H
26 
27 #include <snowpack/DataClasses.h>
28 
29 #include <meteoio/MeteoIO.h>
30 #include <map>
31 #include <string>
32 
33 #define CALL_MEMBER_FN(object,ptrToMember) ((object).*(ptrToMember))
34 
35 class SnowStation;
36 class Metamorphism;
37 typedef void (Metamorphism::*MetaModelFn)(const CurrentMeteo&, SnowStation&) const;
38 typedef double (Metamorphism::*MetaSpRateFn)(const ElementData&) const;
39 
40 class Metamorphism {
41  public:
42  Metamorphism(const SnowpackConfig& i_cfg);
43 
44  void runMetamorphismModel(const CurrentMeteo& Mdata, SnowStation& Xdata) const throw();
45 
46  static double csPoreArea(const ElementData& Edata);
47 
48  static double getCoordinationNumberN3(const double& Rho);
49 
50  static double ddRate(const ElementData& Edata);
51 
54 
55  private:
56  static double TGBondRate(const ElementData& Edata);
57 
58  double LatticeConstant0(const double& th_ice) const;
59 
60  double TGGrainRate(const ElementData& Edata, const double& Tbot, const double& Ttop,
61  const double& gradTSub, const double& gradTSup) const;
62 
63  static double ETBondRate(ElementData& Edata);
64  static double ETGrainRate(const ElementData& Edata);
65 
66  static double PressureSintering(ElementData& Edata);
67 
68  void metamorphismDEFAULT(const CurrentMeteo& Mdata, SnowStation& Xdata) const;
69  void metamorphismNIED(const CurrentMeteo& Mdata, SnowStation& Xdata) const;
70 
71 
72  double spRateDEFAULT(const ElementData& Edata) const;
73  double spRateNIED(const ElementData& Edata) const;
74 
75  static const bool __init;
76  static bool initStaticData();
77  static std::map<std::string, MetaModelFn> mapMetamorphismModel;
78  static std::map<std::string, MetaSpRateFn> mapSpRate;
79 
80  const std::string metamorphism_model;
81  const double sn_dt, new_snow_grain_size;
82 };
83 
84 #endif //End of Metamorphism.h
static const double ba_g_fudge
brief Defines Thorsten&#39;s Geometry FUDGE
Definition: Metamorphism.h:52
Definition: SnowpackConfig.h:28
static const double max_grain_bond_ratio
Absolute limit of grain to bond ratio (SH, initialisation)
Definition: Metamorphism.h:53
static const double wind_slab_enhance
For no action, set strength factor for wind slab formation to 0.0.
Definition: Metamorphism.h:53
static double getCoordinationNumberN3(const double &Rho)
This routine estimates the coordination number as a function of the snow density, used for both the F...
Definition: Metamorphism.cc:180
Metamorphism(const SnowpackConfig &i_cfg)
Definition: Metamorphism.cc:247
ELEMENT DATA used as a pointer in the SnowStation structure NOTE on M below: this is the mass of an e...
Definition: DataClasses.h:251
static const double sa_g_fudge
Defines Satyawali&#39;s Geometry FUDGE.
Definition: Metamorphism.h:52
static double csPoreArea(const ElementData &Edata)
This routine estimates the cross sectional pore area.
Definition: Metamorphism.cc:141
static const double wind_slab_depth
Wind slab formation down to Metamorphism::wind_slab_depth (m)
Definition: Metamorphism.h:53
void runMetamorphismModel(const CurrentMeteo &Mdata, SnowStation &Xdata) const
Definition: Metamorphism.cc:987
CurrentMeteo is the class of interpolated meteo data for the current calculation time step It contai...
Definition: DataClasses.h:81
static const double bond_size_stop
Bond radius usually will not grow larger than Metamorphism::bond_size_stop * grain radius...
Definition: Metamorphism.h:52
Definition: Metamorphism.h:40
static const double wind_slab_vw
Wind slab forms for winds stronger than Metamorphism::wind_slab_vw (m s-1)
Definition: Metamorphism.h:53
static double ddRate(const ElementData &Edata)
Compute the rate of change of dendricity according to the Crocus model. .
Definition: Metamorphism.cc:210
double(Metamorphism::* MetaSpRateFn)(const ElementData &) const
Definition: Metamorphism.h:38
static const double max_grain_growth
A grain cannot grow more than 5.0 mm d-1.
Definition: Metamorphism.h:52
void(Metamorphism::* MetaModelFn)(const CurrentMeteo &, SnowStation &) const
Definition: Metamorphism.h:37
static const double mm_tg_dpdz
Defines the vapor pressure gradient at which TG metamorphism begins (hPa m-1)
Definition: Metamorphism.h:52
Station data including all information on snowpack layers (elements and nodes) and on canopy This is...
Definition: DataClasses.h:468