SNOWPACK 20240329.2d1c245
Meteo.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*/
27#ifndef METEO_H
28#define METEO_H
29
30#include <meteoio/MeteoIO.h>
31
35
36class Meteo {
37 public:
38 //except Richardson and Neutral, all are standard MO iterations with the specified stability correction. In unstable conditions, they use Paulson and Stearns & Weidner, 1993, for scalars
39 typedef enum {
50
51 Meteo(const SnowpackConfig& i_cfg);
52 Meteo(const Meteo& mt);
53 Meteo& operator=(const Meteo& mt);
54 virtual ~Meteo();
55
56 static void projectPrecipitations(const double& SlopeAngle, double& precips, double& hs);
57 static bool compHSrate(CurrentMeteo& Mdata, const SnowStation& vecXdata, const double& hs_a3hl6);
58 void compMeteo(CurrentMeteo &Mdata, SnowStation &Xdata, const bool runCanopyModel,
59 const bool adjust_height_of_wind_value);
60 void compRadiation(const SnowStation &station, mio::SunObject &sun, SnowpackConfig &cfg, CurrentMeteo &Mdata);
61 static void radiationOnSlope(const SnowStation &sector, const mio::SunObject &sun, CurrentMeteo &Mdata, SurfaceFluxes &surfFluxes);
62 void setStability(const ATM_STABILITY& i_stability);
63 static ATM_STABILITY getStability(const std::string& stability_model);
65
66 private:
67 void MicroMet(const SnowStation& Xdata, CurrentMeteo& Mdata, const bool& adjust_VW_height=true) const;
68 static double getParameterAverage(mio::IOManager& io, const mio::MeteoData::Parameters& param,
69 const mio::Date& current_date, const int& time_span, const int& increment);
70 static void RichardsonStability(const double& ta_v, const double& t_surf_v, const double& zref,
71 const double& vw, const double& z_ratio, double &ustar, double &psi_s);
72 static void MOStability(const ATM_STABILITY& use_stability, const double& ta_v, const double& t_surf_v, const double& t_surf,
73 const double& zref, const double& vw, const double& z_ratio, double &ustar, double &psi_s, double &psi_m);
74
75 Canopy canopy;
76 mio::DataGenerator *dataGenerator; //as pointer so we don't have to construct an expensive object if not needed
77 double roughness_length, height_of_wind_value;
78 std::string variant;
79 ATM_STABILITY stability;
80 bool research_mode, useCanopyModel;
81};
82
83#endif //END of Meteo.h
Computes interception of precipitation and radiation, and reduction of windspeed in a canopy layer ab...
Definition: Canopy.h:78
CurrentMeteo is the class of interpolated meteo data for the current calculation time step It contai...
Definition: DataClasses.h:83
Definition: Meteo.h:36
static void projectPrecipitations(const double &SlopeAngle, double &precips, double &hs)
Projects precipitations and snow height perpendicular to slope.
Definition: Meteo.cc:141
virtual ~Meteo()
Definition: Meteo.cc:79
static bool compHSrate(CurrentMeteo &Mdata, const SnowStation &vecXdata, const double &hs_a3hl6)
Compute measured snow depth change rate to detect growing grass (canopy) vs. snowfall on bare ground.
Definition: Meteo.cc:334
void compMeteo(CurrentMeteo &Mdata, SnowStation &Xdata, const bool runCanopyModel, const bool adjust_height_of_wind_value)
Definition: Meteo.cc:379
void setStability(const ATM_STABILITY &i_stability)
set the atmosphere stability to a given value
Definition: Meteo.cc:121
void compRadiation(const SnowStation &station, mio::SunObject &sun, SnowpackConfig &cfg, CurrentMeteo &Mdata)
Definition: Meteo.cc:395
static void radiationOnSlope(const SnowStation &sector, const mio::SunObject &sun, CurrentMeteo &Mdata, SurfaceFluxes &surfFluxes)
Definition: Meteo.cc:471
Meteo & operator=(const Meteo &mt)
Assignement operator.
Definition: Meteo.cc:65
Meteo(const SnowpackConfig &i_cfg)
Definition: Meteo.cc:40
ATM_STABILITY
Definition: Meteo.h:39
@ RICHARDSON
Simplified Richardson number stability correction.
Definition: Meteo.h:40
@ MO_HOLTSLAG
Holtslag and DeBruin (1988) prepared from Ed Andreas.
Definition: Meteo.h:43
@ MO_SCHLOEGL_MULTI
Schloegl multivariate without offset.
Definition: Meteo.h:47
@ MO_STEARNS
Stearns C. and Weidner G., "sensible and latent heat flux estimates in antarctica",...
Definition: Meteo.h:44
@ MO_MICHLMAYR
Stearns & Weidner, 1993 modified by Michlmayr, 2008.
Definition: Meteo.h:45
@ MO_SCHLOEGL_MULTI_OFFSET
Schloegl multivariate with offset.
Definition: Meteo.h:48
@ MO_LOG_LINEAR
Simple log-linear model.
Definition: Meteo.h:42
@ MO_SCHLOEGL_UNI
Schloegl univariate, see Schlögl et al. "How do stability corrections perfom over snow in the stable ...
Definition: Meteo.h:46
@ NEUTRAL
Assume neutral stratification.
Definition: Meteo.h:41
ATM_STABILITY getStability() const
get the atmosphere stability
Definition: Meteo.cc:130
Definition: DataClasses.h:604
Definition: SnowpackConfig.h:28
Definition: DataClasses.h:733