SNOWPACK 20260217.97ebebde
Physically based, energy balance snow cover model
Loading...
Searching...
No Matches
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
50
51 Meteo(const SnowpackConfig& i_cfg);
52 Meteo(const Meteo& mt);
53 Meteo& operator=(const Meteo& mt);
54 virtual ~Meteo();
55
56 void editMeteoData(mio::MeteoData& md) const;
57 bool validMeteoData(const mio::MeteoData& md, const std::string& StationName, const unsigned int& nslopes) const;
58 void copyMeteoData(const mio::MeteoData& md, CurrentMeteo& Mdata,
59 const double& prevailing_wind_dir, bool &iswr_is_net) const;
60 static double getHS_last3hours(mio::IOManager &io, const mio::Date& current_date);
61
62 static void setShortWave(CurrentMeteo& Mdata, const SnowStation& Xdata, const bool& iswr_is_net);
63 void dataForCurrentTimeStep(CurrentMeteo& Mdata, SurfaceFluxes& surfFluxes, std::vector<SnowStation>& vecXdata,
64 const Slope& slope, SnowpackConfig& cfg,
65 mio::SunObject &sun,
66 double& precip, const double& lw_in, const double hs_a3hl6,
67 double& tot_mass_in,
68 const bool& iswr_is_net);
69
70 static void projectPrecipitations(const double& SlopeAngle, double& precips, double& hs);
71 static bool compHSrate(CurrentMeteo& Mdata, const SnowStation& vecXdata, const double& hs_a3hl6);
72 void compMeteo(CurrentMeteo &Mdata, SnowStation &Xdata, const bool runCanopyModel,
73 const bool adjust_height_of_wind_value);
74 void compRadiation(const SnowStation &station, mio::SunObject &sun, SnowpackConfig &cfg, CurrentMeteo &Mdata);
75 static void radiationOnSlope(const SnowStation &sector, const mio::SunObject &sun, CurrentMeteo &Mdata, SurfaceFluxes &surfFluxes);
76 void setStability(const ATM_STABILITY& i_stability);
77 static ATM_STABILITY getStability(const std::string& stability_model);
79
80 private:
81 void MicroMet(const SnowStation& Xdata, CurrentMeteo& Mdata, const bool& adjust_VW_height=true) const;
82 static double getParameterAverage(mio::IOManager& io, const mio::MeteoData::Parameters& param,
83 const mio::Date& current_date, const int& time_span, const int& increment);
84 static void RichardsonStability(const double& ta_v, const double& t_surf_v, const double& zref,
85 const double& vw, const double& z_ratio, double &ustar, double &psi_s);
86 static void MOStability(const ATM_STABILITY& use_stability, const double& ta_v, const double& t_surf_v, const double& t_surf,
87 const double& zref, const double& vw, const double& z_ratio, double &ustar, double &psi_s, double &psi_m);
88
89 Canopy canopy;
90 mio::DataGenerator *dataGenerator;
91 double roughness_length;
92 double height_of_wind_value;
93 double thresh_rain;
94 double wind_scaling_factor;
95 std::string variant;
96 std::string sw_mode;
97 ATM_STABILITY stability;
98 bool research_mode;
99 bool useCanopyModel;
100 bool enforce_snow_height;
101 bool advective_heat;
102 bool soil_flux;
103 bool force_sw_mode;
104};
105
106#endif //END of Meteo.h
Computes interception of precipitation and radiation, and reduction of windspeed in a canopy layer ab...
Definition Canopy.h:79
CurrentMeteo is the class of interpolated meteo data for the current calculation time step.
Definition DataClasses.h:86
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:170
virtual ~Meteo()
Definition Meteo.cc:108
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:386
void compMeteo(CurrentMeteo &Mdata, SnowStation &Xdata, const bool runCanopyModel, const bool adjust_height_of_wind_value)
Definition Meteo.cc:431
void setStability(const ATM_STABILITY &i_stability)
Set the atmospheric stability to a given value.
Definition Meteo.cc:150
void compRadiation(const SnowStation &station, mio::SunObject &sun, SnowpackConfig &cfg, CurrentMeteo &Mdata)
Compute radiation components (direct, diff, emissivity, sun position)
Definition Meteo.cc:454
void editMeteoData(mio::MeteoData &md) const
Definition Meteo.cc:558
static void radiationOnSlope(const SnowStation &sector, const mio::SunObject &sun, CurrentMeteo &Mdata, SurfaceFluxes &surfFluxes)
Projects radiation on slope.
Definition Meteo.cc:535
void copyMeteoData(const mio::MeteoData &md, CurrentMeteo &Mdata, const double &prevailing_wind_dir, bool &iswr_is_net) const
Definition Meteo.cc:634
static void setShortWave(CurrentMeteo &Mdata, const SnowStation &Xdata, const bool &iswr_is_net)
Make sure that both short wave fluxes get at least a "realistic" value.
Definition Meteo.cc:741
Meteo & operator=(const Meteo &mt)
Assignement operator.
Definition Meteo.cc:85
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 atmospheric stability.
Definition Meteo.cc:159
void dataForCurrentTimeStep(CurrentMeteo &Mdata, SurfaceFluxes &surfFluxes, std::vector< SnowStation > &vecXdata, const Slope &slope, SnowpackConfig &cfg, mio::SunObject &sun, double &precip, const double &lw_in, const double hs_a3hl6, double &tot_mass_in, const bool &iswr_is_net)
Definition Meteo.cc:769
static double getHS_last3hours(mio::IOManager &io, const mio::Date &current_date)
Definition Meteo.cc:713
bool validMeteoData(const mio::MeteoData &md, const std::string &StationName, const unsigned int &nslopes) const
Definition Meteo.cc:581
Slope a C. Fierz class ;-) to handle the multiple expositions in Snowpack standalone.
Definition DataClasses.h:884
Station data including all information on snowpack layers (elements and nodes) and on canopy.
Definition DataClasses.h:609
Definition SnowpackConfig.h:28
The surface fluxes data as computed by Snowpack.
Definition DataClasses.h:743