SNOWPACK 20230601.f8ec41a
Go to the documentation of this file.
2 * SNOWPACK stand-alone
3 *
4 * Copyright WSL Institute for Snow and Avalanche Research SLF, DAVOS, SWITZERLAND
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.
12 Snowpack is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with Snowpack. If not, see <>.
33#include <snowpack/Constants.h>
34#include <meteoio/MeteoIO.h>
36#include <string>
37#include <vector>
40enum {
48struct SNOW_OPTIC {
49 double ggg;
50 double exteff;
51 double ssa;
55struct WL_STRUCT {
56 double nm;
57 double perc;
66 public:
67 ZwischenData(): hoar24(48, 0.0), drift24(48, 0.0), hn3(144, 0.0), hn24(144, 0.0) {}
68 void reset();
70 friend std::ostream& operator<<(std::ostream& os, const ZwischenData& data);
71 friend std::istream& operator>>(std::istream& is, ZwischenData& data);
73 std::vector<double> hoar24;
74 std::vector<double> drift24;
75 std::vector<double> hn3;
76 std::vector<double> hn24;
84 public:
86 CurrentMeteo(const SnowpackConfig& i_cfg);
88 void reset(const SnowpackConfig& i_cfg);
89 void setMeasTempParameters(const mio::MeteoData& md);
90 size_t getNumberMeasTemperatures() const;
91 size_t getNumberFixedRates() const;
92 size_t getMaxNumberMeasTemperatures() const;
93 void getFixedPositions(std::vector<double>& positions) const;
94 size_t getNumberFixedPositions() const;
95 void copySnowTemperatures(const mio::MeteoData& md, const unsigned int& current_slope);
96 void copySolutes(const mio::MeteoData& md, const size_t& i_number_of_solutes);
98 const std::string toString() const;
99 friend std::ostream& operator<<(std::ostream& os, const CurrentMeteo& data);
100 friend std::istream& operator>>(std::istream& is, CurrentMeteo& data);
102 mio::Date date;
103 double ta;
104 double rh;
105 double rh_avg;
106 double vw;
107 double vw_avg;
108 double vw_max;
109 double dw;
110 double vw_drift;
111 double dw_drift;
112 double ustar;
113 double z0;
114 double psi_s;
115 double iswr;
116 double rswr;
117 double mAlbedo;
118 double diff;
119 double dir_h;
120 double elev;
121 double ea;
122 double lw_net;
123 double tss;
124 double tss_a12h;
125 double tss_a24h;
126 double ts0;
127 double psum;
128 double psum_ph;
129 double psum_tech;
130 double hs;
131 double hs_a3h;
132 double hs_rate;
133 double geo_heat;
134 double adv_heat;
136 std::vector<double> ts;
137 std::vector<double> zv_ts;
138 std::vector<double> conc;
139 double rho_hn;
140 double rime_hn;
141 double lwc_hn;
143 bool poor_ea;
145 private:
146 size_t getNumberMeasTemperatures(const mio::MeteoData& md);
148 std::vector<double> fixedPositions;
149 double minDepthSubsurf;
150 size_t maxNumberMeasTemperatures;
151 size_t numberMeasTemperatures;
152 size_t numberFixedRates;
164enum {
187 public:
188 LayerData();
190 const std::string toString() const;
191 friend std::ostream& operator<<(std::ostream& os, const LayerData& data);
192 friend std::istream& operator>>(std::istream& is, LayerData& data);
194 mio::Date depositionDate;
195 double hl;
196 size_t ne;
197 double tl;
198 double phiSoil;
199 double phiIce;
202 double phiWater;
204 double phiVoids;
205 std::vector<double> cSoil;
206 std::vector<double> cIce;
207 std::vector<double> cWater;
208 std::vector<double> cVoids;
209 double SoilRho;
210 double SoilK;
211 double SoilC;
212 double rg;
213 double sp;
214 double dd;
215 double rb;
216 unsigned short int mk;
217 double hr;
218 double CDot;
219 double metamo;
220 double salinity;
221 double h;
222 double dsm;
231 public:
233 nLayers(0), Ldata(), HS_last(0.), Albedo(mio::IOUtils::nodata),
234 SoilAlb(mio::IOUtils::nodata), BareSoil_z0(mio::IOUtils::nodata),
235 Canopy_Height(mio::IOUtils::nodata), Canopy_LAI(mio::IOUtils::nodata),
236 Canopy_Direct_Throughfall(mio::IOUtils::nodata), WindScalingFactor(1.),
237 ErosionLevel(static_cast<int>(mio::IOUtils::nodata)), TimeCountDeltaHS(mio::IOUtils::nodata),
238 Canopy_BasalArea(mio::IOUtils::nodata), Canopy_diameter(mio::IOUtils::nodata),
239 Canopy_lai_frac_top_default(mio::IOUtils::nodata),Canopy_int_cap_snow(mio::IOUtils::nodata),
240 Canopy_alb_dry(mio::IOUtils::nodata),Canopy_alb_wet(mio::IOUtils::nodata),
241 Canopy_alb_snow(mio::IOUtils::nodata),Emissivity_soil(mio::IOUtils::nodata)
242 {}
244 const std::string toString() const;
245 friend std::ostream& operator<<(std::ostream& os, const SN_SNOWSOIL_DATA& data);
246 friend std::istream& operator>>(std::istream& is, SN_SNOWSOIL_DATA& data);
248 mio::StationData meta;
249 mio::Date profileDate;
250 size_t nN;
251 double Height;
252 size_t nLayers;
253 std::vector<LayerData> Ldata;
254 double HS_last;
256 double Albedo;
257 double SoilAlb;
258 double BareSoil_z0;
260 double Canopy_LAI;
270 double Canopy_alb_dry; // Albedo of dry canopy (calibr: 0.09, Alptal)
271 double Canopy_alb_wet; // Albedo of wet canopy (calibr: 0.09, Alptal)
272 double Canopy_alb_snow; // Albedo of snow covered albedo (calibr: 0.35, Alptal)
286 public:
288 typedef enum YOUNG_MODULUS {
291 Exp
294 ElementData(const unsigned short int& in_ID);
295 ElementData(const ElementData& cc); //required to get the correct back-reference in vanGenuchten object
296 ElementData& operator=(const ElementData&) = default;
298 bool checkVolContent();
299 void heatCapacity();
300 double coldContent() const;
301 void updDensity();
302 double extinction() const;
305 static double snowResidualWaterContent(const double& theta_i);
306 double soilFieldCapacity() const;
307 double RelativeHumidity() const;
309 double snowElasticity() const;
310 double neckStressEnhancement() const;
311 double concaveNeckRadius() const;
312 double neckLength() const;
313 double neck2VolumetricStrain() const;
315 void snowType();
316 unsigned short int getSnowType() const;
317 static unsigned short int snowType(const double& dendricity, const double& sphericity, const double& grain_dia, const unsigned short int& marker,
318 const double& theta_w, const double& res_wat_cont_loc);
319 static double getYoungModule(const double& rho_slab, const Young_Modulus& model);
321 const std::string toString() const;
322 friend std::ostream& operator<<(std::ostream& os, const ElementData& data);
323 friend std::istream& operator>>(std::istream& is, ElementData& data);
325 mio::Date depositionDate;
326 double L0, L;
327 double Te;
328 double gradT;
330 std::vector<double> theta;
331 double h;
332 mio::Array2D<double> conc;
333 std::vector<double> k;
334 // Stored in order to visualize constitutive laws
335 // Will be used for creep field hydraulic conductivity in m3 s kg-1
336 std::vector<double> c;
337 // Will also be used for creep specific snow water capacity in m3 J-1
338 std::vector<double> soil;
339 double Rho;
340 double M;
341 double sw_abs;
342 // Snow Metamorphism Data
343 double rg;
344 double dd;
345 double sp;
346 double ogs;
347 double rb;
348 double N3;
349 size_t mk;
350 unsigned short int type;
351 double metamo;
352 double salinity;
353 double dth_w;
355 double Qmf;
356 double QIntmf;
357 double dEps, Eps, Eps_e, Eps_v;
359 double E;
360 double S;
361 double C;
362 double CDot;
363 double ps2rb;
364 double s_strength;
365 double hard;
366 double S_dr;
369 double lwc_source;
375 double Qph_up;
376 double Qph_down;
377 //NIED (H. Hirashima)
378 double dsm;
379 double rime;
381 unsigned short int ID;
382 static const unsigned short int noID;
384 double rhov;
385 double Qmm;
392class NodeData {
393 public:
394 NodeData() : z(0.), u(0.), f(0.), udot(0.), T(0.), S_n(0.), S_s(0.), ssi(6.), hoar(0.),
395 dsm(0.), S_dsm(0.), Sigdsm(0.), rime(0.), soil_lysimeter(0.), rhov(0.) {} //HACK: set ssi to max_stability!
397 const std::string toString() const;
398 friend std::ostream& operator<<(std::ostream& os, const NodeData& data);
399 friend std::istream& operator>>(std::istream& is, NodeData& data);
401 double z;
402 double u;
403 double f;
404 double udot;
405 double T;
406 double S_n;
407 double S_s;
408 double ssi;
409 double hoar;
411 //NIED (H. Hirashima)
412 double dsm;
413 double S_dsm;
414 double Sigdsm;
415 double rime;
419 double rhov;
438 public:
444 can_ch0(0.), can_rs_mult(0.), rsmin(0.), f3_gd(0.), rootdepth(0.), wp_fraction(0.),
445 h_wilt(0.), storage(0.), temp(0.), sigf(0.), ec(0.), lai(0.), z0m(0.), z0h(0.), zdispl(0.),
446 height(0.), direct_throughfall(0.), ra(0.), rc(0.), rs(0.), rstransp(0.), canopyalb(0.),
447 totalalb(0.), wetfraction(0.), intcapacity(0.), rswrac(0.), iswrac(0.), rswrbc(0.), iswrbc(0.),
448 ilwrac(0.), rlwrac(0.), ilwrbc(0.), rlwrbc(0.), rsnet(0.), rlnet(0.), sensible(0.), latent(0.),
449 latentcorr(0.), transp(0.), intevap(0.), interception(0.), throughfall(0.), snowunload(0.),
450 snowfac(0.), rainfac(0.), liquidfraction(0.), sigftrunk(0.), Ttrunk(0.), CondFluxCanop(0.),
452 BasalArea(0.), HMLeaves(0.), HMTrunks(0.) {}
454 void initialize(const SN_SNOWSOIL_DATA& SSdata, const bool useCanopyModel, const bool isAlpine3D);
455 void reset(const bool& cumsum_mass);
457 void multiplyFluxes(const double& factor);
459 const std::string toString() const;
460 friend std::ostream& operator<<(std::ostream& os, const CanopyData& data);
461 friend std::istream& operator>>(std::istream& is, CanopyData& data);
472 double int_cap_snow; //iMax in Gouttevin,2015
482 double can_alb_dry; // Albedo of dry canopy (calibr: 0.09, Alptal)
483 double can_alb_wet; // Albedo of wet canopy (calibr: 0.09, Alptal)
484 double can_alb_snow; // Albedo of snow covered albedo (calibr: 0.35, Alptal)
485 double krnt_lai; // Radiation transmissivity parameter, in the range 0.4-0.8 if the true LAI is used; higher if optical LAI is used.
486 // (calibrated on Alptal)
487 double can_diameter; // average canopy (tree) diameter [m], parameter in the new radiation transfer model
490 double biomass_heat_capacity; // from Linroth et al., 2013 (J Kg-1 K-1)
491 double biomass_density; // from Linroth et al., 2013 (Kg m-3)
492 double lai_frac_top_default; // fraction of total LAI that is attributed to the uppermost layer. Here calibrated for Alptal.
493 double trunk_frac_height; // (optional) fraction of total tree height occupied by trunks,
494 // used to calculate direct solar insolation of trunks.
495 double trunkalb; // trunk albedo
496 double et; // trunk emissivity
516 double can_ch0;
521 double rsmin;
527 double f3_gd;
529 double rootdepth;
533 double h_wilt;
536 // State variable
537 double storage;
538 double temp;
539 double sigf;
540 double ec;
541 // parameters
542 double lai;
543 double z0m;
544 double z0h;
545 double zdispl;
546 double height;
548 // aerodynamic resistances
549 double ra;
550 double rc;
551 double rs;
552 double rstransp;
553 // Averaged variables
554 double canopyalb;
555 double totalalb;
556 double wetfraction;
557 double intcapacity;
558 // Radiations
559 double rswrac;
560 double iswrac;
561 double rswrbc;
562 double iswrbc;
563 double ilwrac;
564 double rlwrac;
565 double ilwrbc;
566 double rlwrbc;
567 double rsnet;
568 double rlnet;
569 // Turbulent fluxes
570 double sensible;
571 double latent;
573 // Evap fluxes
574 double transp;
575 double intevap;
576 // Mass fluxes
581 double snowfac;
582 double rainfac;
584 double sigftrunk;
585 double Ttrunk;
590 double QStrunks;
592 double BasalArea;
593 double HMLeaves;
594 double HMTrunks;
603class SeaIce; // Foreward-declare sea ice class
605 public:
606 explicit SnowStation(const bool i_useCanopyModel=true, const bool i_useSoilLayers=true,
607 const bool i_isAlpine3D=false, const bool i_useSeaIceModule=false);
608 SnowStation(const SnowStation& c);
610 ~SnowStation();
613 void initialize(const SN_SNOWSOIL_DATA& SSdata, const size_t& i_sector);
614 void resize(const size_t& number_of_elements);
616 void reduceNumberOfElements(const size_t& rnE);
617 void combineElements(const size_t& number_top_elements, const bool& reduce_n_elements, const size_t& cond, const double& comb_thresh_l);
618 static bool combineCondition(const ElementData& Edata0, const ElementData& Edata1, const double& depth, const bool& reduce_n_elements, const double& comb_thresh_l);
619 static void mergeElements(ElementData& Edata0, const ElementData& Edata1, const bool& merge, const bool& topElement);
620 void splitElement(const size_t& e); //Split an element
621 void splitElements(const double& max_element_length, const double& comb_thresh_l); //Check for splitting, calls splitElement(...) for actual splitting
623 void compSnowpackMasses();
624 void compSnowpackInternalEnergyChange(const double& sn_dt);
625 void compSoilInternalEnergyChange(const double& sn_dt);
626 double getLiquidWaterIndex() const;
627 double getModelledTemperature(const double& z) const;
629 size_t getNumberOfElements() const;
630 size_t getNumberOfNodes() const;
631 bool isGlacier(const bool& hydro=false) const;
632 bool hasSoilLayers() const;
633 double findMarkedReferenceLayer() const;
635 size_t find_tag(const size_t& tag) const;
637 void reset_lysimeters();
639 const std::string toString() const;
640 friend std::ostream& operator<<(std::ostream& os, const SnowStation& data);
641 friend std::istream& operator>>(std::istream& is, SnowStation& data);
643 mio::StationData meta;
644 double cos_sl;
645 size_t sector;
649 double pAlbedo;
650 double Albedo;
651 double SoilAlb;
653 double BareSoil_z0;
654 size_t SoilNode;
655 double Ground;
656 double cH;
657 double mH;
658 double mass_sum;
659 double swe;
660 double lwc_sum;
663 double hn;
664 double rho_hn;
665 double rime_hn;
667 double ErosionMass;
668 char S_class1;
669 char S_class2;
670 double S_d;
671 double z_S_d;
672 double S_n;
673 double z_S_n;
674 double S_s;
675 double z_S_s;
676 double S_4;
677 double z_S_4;
678 double S_5;
679 double z_S_5;
680 std::vector<NodeData> Ndata;
681 std::vector<ElementData> Edata;
682 void *Kt;
683 void *Kt_vapor;
684 double ColdContent;
686 double dIntEnergy;
690 double ReSolver_dt;
691 bool windward;
698 static const size_t number_top_elements;
699 static unsigned short number_of_solutes;
701 private:
702 size_t nNodes;
703 size_t nElems;
704 unsigned short int maxElementID;
705 bool useCanopyModel, useSoilLayers, isAlpine3D;
706 static double flexibleMaxElemLength(const double& depth, const double& comb_thresh_l);
714 public:
715 BoundCond() : lw_out(0.), lw_net(0.), qs(0.), ql(0.), qr(0.), qg(Constants::undefined) {}
716 const std::string toString() const;
717 void reset();
719 double lw_out;
720 double lw_net;
721 double qs;
722 double ql;
723 double qr;
724 double qg;
733 public:
755 };
757 const std::string toString() const;
758 friend std::ostream& operator<<(std::ostream& os, const SurfaceFluxes& data);
759 friend std::istream& operator>>(std::istream& is, SurfaceFluxes& data);
763 void reset(const bool& cumsum_mass);
764 void compSnowSoilHeatFlux(const SnowStation& Xdata);
765 void collectSurfaceFluxes(const BoundCond& Bdata, SnowStation& Xdata, const CurrentMeteo& Mdata);
766 void multiplyFluxes(const double& factor);
773 double lw_in;
774 double lw_out;
775 double lw_net;
776 double qs;
777 double ql;
778 double hoar;
779 double qr;
780 double qg;
781 double qg0;
782 double sw_hor;
783 double sw_in;
784 double sw_out;
785 double qw;
786 double sw_dir;
787 double sw_diff;
788 double pAlbedo;
789 double mAlbedo;
790 double dIntEnergy;
796 double drift;
797 std::vector<double> mass;
798 std::vector<double> load;
799 double dhs_corr;
800 double cRho_hn;
801 double mRho_hn;
807//HACK: could it be moved to plugins? (as well as Aggregate)
809 public:
812 void average(const double& w1, const double& w2, const SnowProfileLayer& Pdata);
813 static std::vector<SnowProfileLayer> generateProfile(const mio::Date& dateOfProfile, const SnowStation& Xdata, const double hoar_density_surf, const double hoar_min_size_surf);
815 // Profile meta data
816 mio::Date profileDate;
817 std::string stationname;
818 unsigned char loc_for_snow;
819 unsigned char loc_for_wind;
821 mio::Date depositionDate;
822 double height;
823 double rho;
824 double T;
825 double gradT;
827 double theta_i;
828 double theta_w;
829 double theta_a;
830 double grain_size;
831 double bond_size;
832 double dendricity;
833 double sphericity;
834 double ogs;
835 double coordin_num;
836 unsigned short int marker;
837 short unsigned int type;
838 double hard;
840 private:
841 void generateLayer(const ElementData& Edata, const NodeData& Ndata);
842 void generateLayer(const ElementData& Edata, const NodeData& Ndata,
843 const mio::Date& dateOfProfile, const double hoar_density_surf);
847class RunInfo {
848 public:
849 RunInfo();
850 RunInfo(const RunInfo& orig);
851 RunInfo& operator=(const RunInfo&) {return *this;} //everything is static, so we can not change anything
853 const std::string version;
854 const double version_num;
855 const mio::Date computation_date;
856 const std::string compilation_date;
857 const std::string user;
858 const std::string hostname;
860 private:
861 static double getNumericVersion(std::string version_str);
862 static mio::Date getRunDate();
863 static std::string getCompilationDate();
Definition: DataClasses.h:41
Definition: DataClasses.h:43
Definition: DataClasses.h:42
Definition: DataClasses.h:44
The different soil fields (PERMAFROST)
Definition: DataClasses.h:174
Bulk density of dry soil component (without accounting for porosity)
Definition: DataClasses.h:175
Specific heat of dry soil component.
Definition: DataClasses.h:177
Bulk conductivity of dry soil component.
Definition: DataClasses.h:176
Definition: DataClasses.h:178
The 3 mathematical fields that can be solved.
Definition: DataClasses.h:156
Water transport.
Definition: DataClasses.h:158
Definition: DataClasses.h:160
Temperature (phase change and metamorphism)
Definition: DataClasses.h:157
Creep displacements.
Definition: DataClasses.h:159
Definition: DataClasses.h:169
Water in preferential flow.
Definition: DataClasses.h:168
Definition: DataClasses.h:165
Definition: DataClasses.h:166
Definition: DataClasses.h:170
Definition: DataClasses.h:167
BoundCond is used to set Neumann boundary conditions.
Definition: DataClasses.h:712
double qs
sensible heat
Definition: DataClasses.h:721
double qg
geothermal heat flux or heat flux at lower boundary
Definition: DataClasses.h:724
double ql
latent heat
Definition: DataClasses.h:722
Definition: DataClasses.h:715
double lw_out
outgoing longwave radiation
Definition: DataClasses.h:719
const std::string toString() const
double qr
rain energy
Definition: DataClasses.h:723
double lw_net
net longwave radiation
Definition: DataClasses.h:720
void reset()
Canopy data used as a pointer in the SnowStation structure.
Definition: DataClasses.h:437
double wp_fraction
Wilting point, defined as a fraction of water content at field capacity (-)
Definition: DataClasses.h:531
Definition: DataClasses.h:439
double wetfraction
fraction of canopy covered by interception [-]
Definition: DataClasses.h:556
double intcapacity
maximum interception storage [mm]
Definition: DataClasses.h:557
double rc
from canopy to canopy air
Definition: DataClasses.h:550
double f3_gd
gd (Pa-1) parameter for canopy surface resistance response to vapour pressure:
Definition: DataClasses.h:527
double sigftrunk
radiation interception cross section for trunk layer ()
Definition: DataClasses.h:584
double latentcorr
Definition: DataClasses.h:572
double LWnet_Trunks
net LW to trunks (>0 towards trunks)
Definition: DataClasses.h:588
double rswrac
upward shortwave above canopy
Definition: DataClasses.h:559
double rlnet
net longwave radiation
Definition: DataClasses.h:568
double snowfac
snowfall above canopy
Definition: DataClasses.h:581
double CondFluxTrunks
biomass heat storage flux towards Trunks (if 2L)
Definition: DataClasses.h:587
friend std::istream & operator>>(std::istream &is, CanopyData &data)
double height
Definition: DataClasses.h:546
double CondFluxCanop
biomass heat storage flux towards Canopy (if 1L) towards Leaves (if 2L). (>0 towards canopy)
Definition: DataClasses.h:586
double can_alb_snow
Definition: DataClasses.h:484
bool canopy_stabilitycorrection
Definition: DataClasses.h:499
double krnt_lai
Definition: DataClasses.h:485
double zdispl
Definition: DataClasses.h:545
double totalalb
total albedo above canopy and snow/soil surface [-]
Definition: DataClasses.h:555
double iswrbc
downward shortwave radiation below canopy
Definition: DataClasses.h:562
double transp
Definition: DataClasses.h:574
double can_rs_mult
1+CAN_RS_MULT = maximum factor to increase Cdata->rs below canopy
Definition: DataClasses.h:518
double rswrbc
upward shortwave below canopy
Definition: DataClasses.h:561
const std::string toString() const
double rs
from subsurface to canpopy air
Definition: DataClasses.h:551
double rlwrbc
upward longwave radiation BELOW canopy
Definition: DataClasses.h:566
void multiplyFluxes(const double &factor)
If multiple fluxes have been summed over multiple time steps, the fluxes then need to be averaged by ...
double trunkalb
Definition: DataClasses.h:495
double rsmin
Definition: DataClasses.h:521
double ra
from canopy air to reference height
Definition: DataClasses.h:549
double SWnet_Trunks
net SW to trunks (>0 towards trunks)
Definition: DataClasses.h:589
double rstransp
stomatal surface resistance for transpiration
Definition: DataClasses.h:552
void reset(const bool &cumsum_mass)
double biomass_heat_capacity
Definition: DataClasses.h:490
double HMTrunks
Trunks heat mass (J K-1 /m2 ground surface)
Definition: DataClasses.h:594
double interception_timecoef
Definition: DataClasses.h:479
double z0m
Definition: DataClasses.h:543
double rsnet
net shortwave radiation
Definition: DataClasses.h:567
double interception
Definition: DataClasses.h:577
double lai
Definition: DataClasses.h:542
double can_alb_dry
Definition: DataClasses.h:482
double can_ch0
minimum heat exchange (Wm-2K-1) at zero wind
Definition: DataClasses.h:516
double ilwrbc
downward longwave radiation BELOW canopy
Definition: DataClasses.h:565
double BasalArea
basal area of trees on the stand
Definition: DataClasses.h:592
double direct_throughfall
Definition: DataClasses.h:547
double lai_frac_top_default
Definition: DataClasses.h:492
double biomass_density
Definition: DataClasses.h:491
double latent
Definition: DataClasses.h:571
void initializeSurfaceExchangeData()
Function called to initialize the canopy "Surface" exchange data (to enable accumulated mass and ener...
double HMLeaves
Leaves heat mass (J K-1 /m2 ground surface)
Definition: DataClasses.h:593
double can_alb_wet
Definition: DataClasses.h:483
void initialize(const SN_SNOWSOIL_DATA &SSdata, const bool useCanopyModel, const bool isAlpine3D)
Initialize all the CData elements value with values by default or with values read from the SNO file....
double int_cap_rain
Specific interception capacity for rain (I_LAI) (mm/LAI)
Definition: DataClasses.h:474
double intevap
Definition: DataClasses.h:575
double iswrac
downward shortwave radiation above canopy
Definition: DataClasses.h:560
double roughmom_to_canopyheight_ratio
Ratio between canopy height and roughness length.
Definition: DataClasses.h:501
double rainfac
rainfall above canopy
Definition: DataClasses.h:582
double int_cap_snow
Definition: DataClasses.h:472
double temp
temperature (K)
Definition: DataClasses.h:538
double displ_to_canopyheight_ratio
As above for displacement height.
Definition: DataClasses.h:503
double storage
intercepted water (mm or kg m-2)
Definition: DataClasses.h:537
double h_wilt
Wilting point pressure head, when using Richards equation for soil.
Definition: DataClasses.h:533
double rootdepth
Root depth, determining the soil layers influenced by root water uptake.
Definition: DataClasses.h:529
double sigf
radiation transmissivity (1)
Definition: DataClasses.h:539
double rlwrac
upward longwave radiation ABOVE canopy
Definition: DataClasses.h:564
double liquidfraction
Definition: DataClasses.h:583
double snowunload
Definition: DataClasses.h:579
double roughheat_to_roughmom_ratio
(~=1, but Not allowed to be exactly 1)
Definition: DataClasses.h:514
double sensible
Definition: DataClasses.h:570
friend std::ostream & operator<<(std::ostream &os, const CanopyData &data)
double trunk_frac_height
Definition: DataClasses.h:493
double ilwrac
downward longwave radiation ABOVE canopy
Definition: DataClasses.h:563
double Ttrunk
trunk temperature (K)
Definition: DataClasses.h:585
double forestfloor_alb
albedo of the forest floor
Definition: DataClasses.h:591
double QStrunks
sensible heat flux from trunks (>0 if heat lost from trunk)
Definition: DataClasses.h:590
double z0h
Definition: DataClasses.h:544
double canopytemp_maxchange_perhour
Maximum allowed canopy temperature change (K hr-1)
Definition: DataClasses.h:512
double ec
longwave emissivity (1)
Definition: DataClasses.h:540
double raincrease_snow
Definition: DataClasses.h:509
double can_diameter
Definition: DataClasses.h:487
double canopyalb
canopy albedo [-]
Definition: DataClasses.h:554
double throughfall
Definition: DataClasses.h:578
double et
Definition: DataClasses.h:496
CurrentMeteo is the class of interpolated meteo data for the current calculation time step It contai...
Definition: DataClasses.h:83
std::vector< double > conc
Solute concentrations in precipitation.
Definition: DataClasses.h:138
mio::Date date
Date of current meteo data.
Definition: DataClasses.h:102
double adv_heat
Advective heat to inject in the soil (if ADVECTIVE_HEAT and related parameters set to true)
Definition: DataClasses.h:134
void getFixedPositions(std::vector< double > &positions) const
void reset(const SnowpackConfig &i_cfg)
double vw
Wind velocity at snow station (m s-1)
Definition: DataClasses.h:106
size_t getNumberMeasTemperatures() const
Returns the number of measured snow/soil temperatures stored in MeteoData.
double rime_hn
riming index of new snow
Definition: DataClasses.h:140
const std::string toString() const
double lwc_hn
liquid water content of new snow
Definition: DataClasses.h:141
bool poor_ea
when ilwr has not been measured nor parametrized in good conditions, it could be redone later on
Definition: DataClasses.h:143
double z0
The roughness length computed in SnowDrift and also used later for the MeteoHeat fluxes (m)
Definition: DataClasses.h:113
double psum_ph
precipitation phase for the current timestep (between 0 and 1, 0 is fully solid while 1 is fully liqu...
Definition: DataClasses.h:128
double hs_rate
The rate of change in snow depth (m h-1)
Definition: DataClasses.h:132
double vw_max
Maximum wind velocity at snow station (m s-1)
Definition: DataClasses.h:108
double iswr
Incoming SHORTWAVE radiation (W m-2)
Definition: DataClasses.h:115
size_t getNumberFixedPositions() const
void setMeasTempParameters(const mio::MeteoData &md)
double rho_hn
Measured new snow density (kg m-3)
Definition: DataClasses.h:139
friend std::ostream & operator<<(std::ostream &os, const CurrentMeteo &data)
double ta
Air temperature (K)
Definition: DataClasses.h:103
double vw_avg
Running mean of wind velocity at snow station (m s-1)
Definition: DataClasses.h:107
double lw_net
Net longwave radiation (W m-2)
Definition: DataClasses.h:122
double dw
Wind direction at snow station (deg)
Definition: DataClasses.h:109
double tss_a24h
Snow surface temperature averaged over past 24 hours (K)
Definition: DataClasses.h:125
friend std::istream & operator>>(std::istream &is, CurrentMeteo &data)
double dw_drift
Wind direction of blowing and drifting snow (operational: wind ridge station)
Definition: DataClasses.h:111
double vw_drift
Wind velocity for blowing and drifting snow (operational: wind ridge station)
Definition: DataClasses.h:110
double psum
precipitation sum over the current timestep (mm)
Definition: DataClasses.h:127
double rswr
Reflected SHORTWAVE radiation (W m-2) divide this value by the ALBEDO to get iswr.
Definition: DataClasses.h:116
double diff
Diffuse radiation from the sky (W m-2)
Definition: DataClasses.h:118
double ustar
The friction velocity (m s-1) computed in mt_MicroMet() and also used later for the MeteoHeat fluxes.
Definition: DataClasses.h:112
std::vector< double > zv_ts
Positions of all measured snow or/and soil temperatures (m)
Definition: DataClasses.h:137
void copySnowTemperatures(const mio::MeteoData &md, const unsigned int &current_slope)
double psi_s
Stability correction for scalar heat fluxes.
Definition: DataClasses.h:114
double psum_tech
Equivalent precipitation water sum for technical snow over the current timestep (mm)
Definition: DataClasses.h:129
double hs_a3h
Snow depth averaged over 3 past hours.
Definition: DataClasses.h:131
double rh_avg
Running mean of relative humidity (1)
Definition: DataClasses.h:105
double tss_a12h
Snow surface temperature averaged over past 12 hours (K)
Definition: DataClasses.h:124
size_t getMaxNumberMeasTemperatures() const
double tss
Snow surface temperature (K)
Definition: DataClasses.h:123
double ea
Atmospheric emissivity (1)
Definition: DataClasses.h:121
double hs
The measured height of snow (m)
Definition: DataClasses.h:130
void copySolutes(const mio::MeteoData &md, const size_t &i_number_of_solutes)
double ts0
Bottom temperatures of snow/soil pack (K)
Definition: DataClasses.h:126
std::vector< double > ts
Measured snow or/and soil temperatures (K)
Definition: DataClasses.h:136
double rh
Relative humidity (% or 1)
Definition: DataClasses.h:104
double geo_heat
Geo heat flux (W/m^2), for the neumann lower boundary condition in the heat equation.
Definition: DataClasses.h:133
size_t getNumberFixedRates() const
double elev
Solar elevation to be used in Canopy.c (rad) => see also.
Definition: DataClasses.h:120
double mAlbedo
Measured snow albedo.
Definition: DataClasses.h:117
double dir_h
Horizontal direct radiation from the sky (W m-2)
Definition: DataClasses.h:119
ELEMENT DATA used as a pointer in the SnowStation structure NOTE on M below: this is the mass of an e...
Definition: DataClasses.h:285
double L
Original and present element thickness (m)
Definition: DataClasses.h:326
std::vector< double > c
For example, specific heat of TEMPERATURE field (J kg-1 K-1)
Definition: DataClasses.h:336
double salinity
salinity (PSU, which is g/kg)
Definition: DataClasses.h:352
double Qph_down
Heat source/sink due to phase changes for the heat equation (W/m^3), at the lower node of the element...
Definition: DataClasses.h:376
double QIntmf
Apparent change in internal energy due to phase change (caused by difference in heat capacity of wate...
Definition: DataClasses.h:356
double neck2VolumetricStrain() const
Relates the neck strain to the global volumetric strain.
vanGenuchten VG
Van Genuchten Model for water retention.
Definition: DataClasses.h:368
double soilFieldCapacity() const
Field Capacity Soil is dependent on grain properties. This nice formulation is based on some tedious ...
double Te
mean element temperature (K)
Definition: DataClasses.h:327
double Qmf
Subsurface Melting & Freezing Data: change of energy due to phase changes (melt-freeze)
Definition: DataClasses.h:355
double CDot
Stress rate (Pa s-1), that is the overload change rate.
Definition: DataClasses.h:362
double Eps_e
Definition: DataClasses.h:357
unsigned short int getSnowType() const
Determine the type of snow First revisited by Fierz and Bellaire 2006 and 2007 TODO needs to be adap...
double S_dr
Stability Index based on deformation rate (Direct Action Avalanching)
Definition: DataClasses.h:366
double coldContent() const
Computes cold content of an element, taking meltfreeze_tk as reference.
ElementData & operator=(const ElementData &)=default
Assignement operator.
double PrefFlowArea
Preferential flow path relative area (-)
Definition: DataClasses.h:370
double Eps_v
Total element strain (GREEN'S strains – TOTAL LAGRANGIAN FORMULATION): Eps_e is elastic and Eps_v is ...
Definition: DataClasses.h:357
double res_wat_cont
Residual water content.
Definition: DataClasses.h:354
double extinction() const
Density dependent extinction coefficient -> Michi's magic trick... out of his magic hat.
unsigned short int type
grain class
Definition: DataClasses.h:350
This enum provides names for possible Young's modulus calculations.
Definition: DataClasses.h:288
@ Pow
another power law
Definition: DataClasses.h:290
@ Exp
exponential law
Definition: DataClasses.h:291
@ Sigrist
Sigrist, 2006.
Definition: DataClasses.h:289
ElementData(const unsigned short int &in_ID)
double sw_abs
total absorbed shortwave radiation by the element (W m-2)
Definition: DataClasses.h:341
double theta_i_reservoir_cumul
Volumetric ice content in cumulated ice reservoir (1)
Definition: DataClasses.h:373
double M
the total mass of the element (kg m-2)
Definition: DataClasses.h:340
double vapTrans_fluxDiff
vapor dissusion flux in the case of vapor transport (W/m^2/s)
Definition: DataClasses.h:386
double E
Young's modulus of elasticity (Pa)
Definition: DataClasses.h:359
double vapTrans_snowDenChangeRate
snow density change rate in the case of vapor transport (kg/m^3/s)
Definition: DataClasses.h:387
double metamo
keep track of metamorphism
Definition: DataClasses.h:351
double lwc_source
Source/sink term for Richards equation (m^3/m^3 / timestep)
Definition: DataClasses.h:369
double rb
grain bond radius (mm)
Definition: DataClasses.h:347
friend std::ostream & operator<<(std::ostream &os, const ElementData &data)
size_t mk
grain marker (history dependent)
Definition: DataClasses.h:349
unsigned short int ID
Element ID used to track elements.
Definition: DataClasses.h:381
double h
capillary pressure head (m)
Definition: DataClasses.h:331
std::vector< double > k
For example, heat conductivity of TEMPERATURE field (W m-1 K-1)
Definition: DataClasses.h:333
void snowType()
double rg
grain radius (mm)
Definition: DataClasses.h:343
double rhov
vapor density...(kg/m^3)
Definition: DataClasses.h:384
mio::Array2D< double > conc
Concentration for chemical constituents in (kg m-3)
Definition: DataClasses.h:332
double dsm
Dry snow metamorphism factor.
Definition: DataClasses.h:378
void heatCapacity()
Computes heat capacity of an element based on volumetric contents.
double hard
Parameterized hand hardness (1)
Definition: DataClasses.h:365
double gradT
temperature gradient over element (K m-1)
Definition: DataClasses.h:328
double meltfreeze_tk
melt/freeze temperature of layer (principally initialized as 0 degC, but enables possibility for free...
Definition: DataClasses.h:329
static double getYoungModule(const double &rho_slab, const Young_Modulus &model)
double RelativeHumidity() const
double theta_w_transfer
Volumetric content of water transferred from preferential flow to matrix domain (1)
Definition: DataClasses.h:371
double theta_i_reservoir
Volumetric ice content in ice reservoir (1)
Definition: DataClasses.h:372
std::vector< double > theta
volumetric contents: SOIL, ICE, WATER, WATER_PREF, AIR (1)
Definition: DataClasses.h:330
mio::Date depositionDate
Date of deposition.
Definition: DataClasses.h:325
friend std::istream & operator>>(std::istream &is, ElementData &data)
double s_strength
Parameterized snow shear strength (kPa)
Definition: DataClasses.h:364
double Qph_up
Heat source/sink due to phase changes for the heat equation (W/m^3), at the upper node of the element...
Definition: DataClasses.h:375
double S
Total Element Stress (Pa), S being the energy conjugate stress.
Definition: DataClasses.h:360
double ps2rb
proportion of grain bond growth due to pressure sintering (1)
Definition: DataClasses.h:363
double C
Total Element Stress (Pa), C being the real or the Cauchy stress, which is output.
Definition: DataClasses.h:361
double Eps_vDot
Total Strain Rate, elastic and viscous, respectively (s-1) (Simply, Eps/sn_dt)
Definition: DataClasses.h:358
double Eps_Dot
Definition: DataClasses.h:358
double N3
grain Coordination number (1)
Definition: DataClasses.h:348
double vapTrans_cumulativeDenChange
cumulative density change in the case of vapor transport (kg/m^3)
Definition: DataClasses.h:388
double Eps
Definition: DataClasses.h:357
double neckStressEnhancement() const
Computes the enhancement of hydrostatically applied stress (overburden) in the necks (or bonds)
double dth_w
Subsurface Melting & Freezing Data: change of water content.
Definition: DataClasses.h:353
double Rho
mean element density (or BULK density; kg m-3), that is, rho=M/V=sum( theta(i)*rho(i) )
Definition: DataClasses.h:339
double SlopeParFlux
Slope parallel flux (m^3/m^3 * m / timestep)
Definition: DataClasses.h:374
double neckLength() const
Computes the neck (or bond) length (mm)
void updDensity()
Updates element density.
double rime
Rime index.
Definition: DataClasses.h:379
double L0
Definition: DataClasses.h:326
double ogs
optical equivalent grain size (mm)
Definition: DataClasses.h:346
bool checkVolContent()
Check volumetric content.
void opticalEquivalentGrainSize()
Opical equivalent grain size CROCUS implementation as described in Vionnet et al.,...
static const unsigned short int noID
Definition: DataClasses.h:382
void snowResidualWaterContent()
std::vector< double > soil
Contains the heat conductivity, capacity and dry density of the soil (solid, non-ice) component phase...
Definition: DataClasses.h:338
double dd
snow dendricity: 0 = none, 1 = newsnow
Definition: DataClasses.h:344
double snowElasticity() const
SNOW ELASTICITY : This important routine was programmed by Marc Christen, who took it directly from M...
double crit_cut_length
Critical cut length (m)
Definition: DataClasses.h:367
const std::string toString() const
double sp
sphericity: 1 = round, 0 = angular
Definition: DataClasses.h:345
double concaveNeckRadius() const
A non-generic function to compute the concave neck radius (mm). It is assumed that the neck is bound...
double Qmm
Heat source/sink due to phase changes in the case of vapor transport (W/m^3)
Definition: DataClasses.h:385
double dEps
Definition: DataClasses.h:357
Parameters of the different layers of the snowpack.
Definition: DataClasses.h:186
double sp
Micro-structure : Sphericity.
Definition: DataClasses.h:213
double rg
Micro-structure : Grainsize in mm.
Definition: DataClasses.h:212
double phiIceReservoir
Volumetric ice reservoir content in %.
Definition: DataClasses.h:200
double salinity
salinity (kg/kg)
Definition: DataClasses.h:220
double phiVoids
Volumetric void content in %.
Definition: DataClasses.h:204
double phiSoil
Volumetric soil content in %.
Definition: DataClasses.h:198
double phiIce
Volumetric ice content in %.
Definition: DataClasses.h:199
double dsm
dry snow metamorphism factor
Definition: DataClasses.h:222
double h
capillary pressure head (m)
Definition: DataClasses.h:221
std::vector< double > cVoids
Solute concentrations in Air.
Definition: DataClasses.h:208
double CDot
Stress rate (Pa s-1), that is the LAST overload change rate.
Definition: DataClasses.h:218
mio::Date depositionDate
Date of deposition (mainly used for snow layers)
Definition: DataClasses.h:194
std::vector< double > cWater
Solute concentrations in Water.
Definition: DataClasses.h:207
double phiIceReservoirCumul
Volumetric cumulated ice reservoir content in %.
Definition: DataClasses.h:201
std::vector< double > cIce
Solute concentrations in Ice.
Definition: DataClasses.h:206
std::vector< double > cSoil
Solute concentrations in Soil.
Definition: DataClasses.h:205
double phiWaterPref
Volumetric preferential water content in %.
Definition: DataClasses.h:203
double metamo
keep track of metamorphism
Definition: DataClasses.h:219
const std::string toString() const
friend std::istream & operator>>(std::istream &is, LayerData &data)
double rb
Micro-structure : Bond Radius in mm.
Definition: DataClasses.h:215
double tl
Temperature at the top of the layer in K.
Definition: DataClasses.h:197
double hl
The thickness of the layer in m.
Definition: DataClasses.h:195
double hr
Surface hoar Mass in kg m-2.
Definition: DataClasses.h:217
double SoilC
Heat Capacity of soil.
Definition: DataClasses.h:211
double SoilK
Conductivity of soil.
Definition: DataClasses.h:210
friend std::ostream & operator<<(std::ostream &os, const LayerData &data)
double SoilRho
Density of soil in kg m-3.
Definition: DataClasses.h:209
double phiWater
Volumetric water content in %.
Definition: DataClasses.h:202
double dd
Micro-structure : Dendricity.
Definition: DataClasses.h:214
unsigned short int mk
Micro-structure : Marker.
Definition: DataClasses.h:216
size_t ne
Number of finite elements in the the layer (hl/ne defines elm. size)
Definition: DataClasses.h:196
NODAL DATA used as a pointer in the SnowStation structure.
Definition: DataClasses.h:392
double udot
downward creep velocity in m s-1
Definition: DataClasses.h:404
double rhov
nodal vapor density in kg/m^3
Definition: DataClasses.h:419
double Sigdsm
Definition: DataClasses.h:414
double S_n
Stability Index for natural avalanches.
Definition: DataClasses.h:406
double dsm
Dry snow metamorphism factor.
Definition: DataClasses.h:412
double S_s
Stability Index for skier triggered avalanches.
Definition: DataClasses.h:407
double hoar
Mass of surface hoar collected while node was exposed to surface.
Definition: DataClasses.h:409
friend std::ostream & operator<<(std::ostream &os, const NodeData &data)
Definition: DataClasses.h:394
double f
reaction or unbalanced forces (CREEP)
Definition: DataClasses.h:403
double u
creep displacements in m
Definition: DataClasses.h:402
double ssi
Structural Stability Index.
Definition: DataClasses.h:408
double T
nodal temperature in K
Definition: DataClasses.h:405
const std::string toString() const
friend std::istream & operator>>(std::istream &is, NodeData &data)
double S_dsm
Definition: DataClasses.h:413
double rime
Definition: DataClasses.h:415
double soil_lysimeter
Water flowing through the node.
Definition: DataClasses.h:417
double z
nodal height from ground in m
Definition: DataClasses.h:401
class to collect the information about the current simulation (version, date)
Definition: DataClasses.h:847
const mio::Date computation_date
Date of computation.
Definition: DataClasses.h:855
const double version_num
SNOWPACK version formatted as a number.
Definition: DataClasses.h:854
const std::string version
SNOWPACK version.
Definition: DataClasses.h:853
const std::string hostname
hostname of the computer running the simulation
Definition: DataClasses.h:858
const std::string compilation_date
Date of compilation.
Definition: DataClasses.h:856
const std::string user
logname of the user running the simulation
Definition: DataClasses.h:857
RunInfo & operator=(const RunInfo &)
Definition: DataClasses.h:851
SN_SNOWSOIL_DATA includes all important station parameters as well as LayerData.
Definition: DataClasses.h:230
const std::string toString() const
double TimeCountDeltaHS
Definition: DataClasses.h:264
double Canopy_alb_dry
Definition: DataClasses.h:270
mio::Date profileDate
Date of profile.
Definition: DataClasses.h:249
double Height
Total height of soil-snow column in m (sum of the layer heights)
Definition: DataClasses.h:251
size_t nN
Total number of FE nodes after loading.
Definition: DataClasses.h:250
double WindScalingFactor
Local scaling factor for wind at drift station.
Definition: DataClasses.h:262
int ErosionLevel
Erosion Level in operational mode (flat field virtual erosion)
Definition: DataClasses.h:263
double Canopy_Direct_Throughfall
Direct throughfall [fraction of precipitation].
Definition: DataClasses.h:261
mio::StationData meta
Station meta data.
Definition: DataClasses.h:248
friend std::ostream & operator<<(std::ostream &os, const SN_SNOWSOIL_DATA &data)
double Canopy_alb_wet
Definition: DataClasses.h:271
double Canopy_BasalArea
OPTIONAL PARAMETERS, a warning will be thrown in CANOPY::Initialize if no value is provided.
Definition: DataClasses.h:266
double Emissivity_soil
OPTIONAL PARAMETERS, if not provided Constants::emissivity_soil will be used.
Definition: DataClasses.h:274
size_t nLayers
Total number of soil and snow layers at loading.
Definition: DataClasses.h:252
double Canopy_LAI
Canopy Leaf Area Index in m2 m-2.
Definition: DataClasses.h:260
double Canopy_diameter
Average canopy (tree) diameter [m], parameter in the new radiation transfer model.
Definition: DataClasses.h:267
double SoilAlb
Soil albedo, default 0.2.
Definition: DataClasses.h:257
double Canopy_Height
Canopy Height in m.
Definition: DataClasses.h:259
Definition: DataClasses.h:232
std::vector< LayerData > Ldata
contains all the information required to construct the Xdata
Definition: DataClasses.h:253
double Canopy_int_cap_snow
Specific interception capacity for rain (I_LAI) (mm/LAI)
Definition: DataClasses.h:269
double BareSoil_z0
Bare soil roughness in m, default 0.02 m.
Definition: DataClasses.h:258
double Canopy_lai_frac_top_default
fraction of total LAI that is attributed to the uppermost layer. Here calibrated for Alptal.
Definition: DataClasses.h:268
double Canopy_alb_snow
Definition: DataClasses.h:272
friend std::istream & operator>>(std::istream &is, SN_SNOWSOIL_DATA &data)
double Albedo
REQUIRED PARAMETERS, an error will be thrown at reading (SnowpackIO) if no parameter are provided.
Definition: DataClasses.h:256
double HS_last
Definition: DataClasses.h:254
Definition: SeaIce.h:41
Defines structure for snow profile layers.
Definition: DataClasses.h:808
double theta_w
0 to 1, volume fraction of water (-)
Definition: DataClasses.h:828
double height
Height of snow or snow depth; 0 to 1000 (cm)
Definition: DataClasses.h:822
double theta_a
0 to 1, volume fraction of air (-)
Definition: DataClasses.h:829
void average(const double &w1, const double &w2, const SnowProfileLayer &Pdata)
Determines the averaged quantities of the current layer with another layer.
double T
-50 to 50, snow temperature at top of layer (degC)
Definition: DataClasses.h:824
double hard
0. to 5. (1)
Definition: DataClasses.h:838
mio::Date profileDate
Date of profile.
Definition: DataClasses.h:816
mio::Date depositionDate
Date of deposition (mainly used for snow layers)
Definition: DataClasses.h:821
unsigned short int marker
0 to 999 (1)
Definition: DataClasses.h:836
static std::vector< SnowProfileLayer > generateProfile(const mio::Date &dateOfProfile, const SnowStation &Xdata, const double hoar_density_surf, const double hoar_min_size_surf)
Generates a snow profile from snow station data (1 element = 1 layer)
double v_strain_rate
0 to 1.0e-5, viscous strain rate (s-1)
Definition: DataClasses.h:826
std::string stationname
Definition: DataClasses.h:817
unsigned char loc_for_wind
Definition: DataClasses.h:819
double coordin_num
0 to 10 (1)
Definition: DataClasses.h:835
unsigned char loc_for_snow
Definition: DataClasses.h:818
double ogs
0 to 100, optical equivalent grain size (mm)
Definition: DataClasses.h:834
double rho
0 to 1000 (kg m-3)
Definition: DataClasses.h:823
short unsigned int type
0 to 999 (1)
Definition: DataClasses.h:837
double sphericity
0 to 1 (1)
Definition: DataClasses.h:833
double grain_size
0 to 100 (mm)
Definition: DataClasses.h:830
double gradT
-1000 to 1000, temperature gradient across layer (K m-1)
Definition: DataClasses.h:825
double dendricity
0 to 1 (1)
Definition: DataClasses.h:832
double bond_size
0 to 100 (mm)
Definition: DataClasses.h:831
double theta_i
0 to 1, volume fraction of ice (-)
Definition: DataClasses.h:827
Definition: DataClasses.h:604
void combineElements(const size_t &number_top_elements, const bool &reduce_n_elements, const size_t &cond, const double &comb_thresh_l)
If more than NUMBER_TOP_ELEMENTS snow elements exist, attempt to reduce their number in the FEM mesh,...
double findMarkedReferenceLayer() const
returns the height of a marked reference layer inside the model domain Searches for the layer that is...
static const double comb_thresh_sp
Sphericity (1)
Definition: DataClasses.h:696
size_t SoilNode
The top soil node, 0 in case of SNP_SOIL == 0.
Definition: DataClasses.h:654
size_t getNumberOfNodes() const
bool hasSoilLayers() const
double z_S_n
Depth of Minimum Natural Stability.
Definition: DataClasses.h:673
void initialize(const SN_SNOWSOIL_DATA &SSdata, const size_t &i_sector)
This routine initializes the snow cover structure which contains all information about a station incl...
size_t getNumberOfElements() const
char S_class1
Stability class based on hand hardness, grain class ...
Definition: DataClasses.h:668
static const double thresh_moist_soil
Definition: DataClasses.h:697
friend std::istream & operator>>(std::istream &is, SnowStation &data)
double S_n
Minimum Natural Stability Index.
Definition: DataClasses.h:672
double S_s
Minimum Skier Stability Index (SSI)
Definition: DataClasses.h:674
double hn
Depth of new snow to be used on slopes.
Definition: DataClasses.h:663
mio::StationData meta
Station meta data.
Definition: DataClasses.h:643
size_t find_tag(const size_t &tag) const
Find element with corresponding tag or return IOUtils::npos if not found.
double SoilAlb
Soil albedo.
Definition: DataClasses.h:651
double rime_hn
rime of new snow to be used on slopes
Definition: DataClasses.h:665
double ErosionMass
Eroded mass either real or virtually (storage if less than one element)
Definition: DataClasses.h:667
static const size_t number_top_elements
Number of top elements left untouched by the join functions.
Definition: DataClasses.h:698
SeaIce * Seaice
Pointer to sea ice class.
Definition: DataClasses.h:648
double S_d
Minimum Direct Action Stability Index ...
Definition: DataClasses.h:670
double swc_sum_soil
Total solid water in soil.
Definition: DataClasses.h:662
double dIntEnergy
Internal energy change of snowpack (J m-2)
Definition: DataClasses.h:686
void * Kt
Pointer to pseudo-conductivity and stiffnes matrix.
Definition: DataClasses.h:682
double cos_sl
Cosinus of slope angle, initialized once!
Definition: DataClasses.h:644
void resize(const size_t &number_of_elements)
Reallocate element and node data Edata and Ndata as well as nElems and nNodes are reallocated or res...
double z_S_4
Depth of stab_index4.
Definition: DataClasses.h:677
double rho_hn
Density of new snow to be used on slopes.
Definition: DataClasses.h:664
double z_S_s
Depth of Minimum SSI.
Definition: DataClasses.h:675
double meltFreezeEnergy
Melt freeze part of internal energy change of snowpack (J m-2)
Definition: DataClasses.h:688
double lwc_sum_soil
Total liquid water in soil.
Definition: DataClasses.h:661
double ColdContent
Cold content of snowpack (J m-2)
Definition: DataClasses.h:684
double S_4
Definition: DataClasses.h:676
bool windward
True for windward (luv) slope.
Definition: DataClasses.h:691
double S_5
Definition: DataClasses.h:678
void splitElement(const size_t &e)
Split the element provided as first argument.
double ColdContentSoil
Cold content of soil (J m-2)
Definition: DataClasses.h:685
double getModelledTemperature(const double &z) const
Returns modelled internal snow or/and soil temperature (instantaneous value; degC),...
double mass_sum
Total mass summing mass of snow elements.
Definition: DataClasses.h:658
double swe
Total mass summing snow water equivalent of elements.
Definition: DataClasses.h:659
static const double comb_thresh_rg
Grain radius (mm)
Definition: DataClasses.h:696
void compSnowpackMasses()
Computes the actual total masses of the snowpack (kg m-2)
void reduceNumberOfElements(const size_t &rnE)
Remove the upper "marked" element of two (snow only) .
double z_S_d
Depth of Minimum Direct Action Stability.
Definition: DataClasses.h:671
std::vector< NodeData > Ndata
pointer to nodal data array (e.g. T, z, u, etc..)
Definition: DataClasses.h:680
static void mergeElements(ElementData &Edata0, const ElementData &Edata1, const bool &merge, const bool &topElement)
Merging two elements.
double ReSolver_dt
Last used RE time step in the previous SNOWPACK time step.
Definition: DataClasses.h:690
static unsigned short number_of_solutes
The model treats that number of solutes.
Definition: DataClasses.h:699
double BareSoil_z0
Bare soil roughness in m.
Definition: DataClasses.h:653
void reset_lysimeters()
static const double comb_thresh_dd
Dendricity (1)
Definition: DataClasses.h:696
double mH
The MEASURED height, including soil depth if SNP_SOIL == 1.
Definition: DataClasses.h:657
SnowStation & operator=(const SnowStation &)
Assignement operator.
std::vector< ElementData > Edata
pointer to element data array (e.g. Te, L, Rho, etc..)
Definition: DataClasses.h:681
double Albedo
Snow albedo used by the model.
Definition: DataClasses.h:650
double dIntEnergySoil
Internal energy change of soil (J m-2)
Definition: DataClasses.h:687
double z_S_5
Depth of stab_index5.
Definition: DataClasses.h:679
friend std::ostream & operator<<(std::ostream &os, const SnowStation &data)
static const double comb_thresh_water
Water content (1)
Definition: DataClasses.h:695
size_t sector
current slope sector of width 360./max(1, nSlopes-1)
Definition: DataClasses.h:645
double Ground
The ground height – meaning the height of the top soil node.
Definition: DataClasses.h:655
const std::string toString() const
static const double comb_thresh_ice
Volumetric ice content (1), i.e., about 46 kg m-3.
Definition: DataClasses.h:695
double WindScalingFactor
Local scaling factor for wind at drift station.
Definition: DataClasses.h:692
SnowStation(const bool i_useCanopyModel=true, const bool i_useSoilLayers=true, const bool i_isAlpine3D=false, const bool i_useSeaIceModule=false)
char S_class2
Stability class based on hand hardness, grain class ...
Definition: DataClasses.h:669
double getLiquidWaterIndex() const
Computes the liquid water index defined as the ratio of total liquid water content (in mm w....
void * Kt_vapor
Pointer to pseudo-conductivity and stiffnes matrix.
Definition: DataClasses.h:683
void compSoilInternalEnergyChange(const double &sn_dt)
Computes the internal energy change of the soil during one computation time step (J m-2)
bool isGlacier(const bool &hydro=false) const
returns if a snow profile can be considered as a glacier. Practically, the hydrological criteria is t...
double SoilEmissivity
Soil emissivity.
Definition: DataClasses.h:652
double TimeCountDeltaHS
Time counter tracking erroneous settlement in operational mode.
Definition: DataClasses.h:693
double lwc_sum
Total liquid water in snowpack.
Definition: DataClasses.h:660
static const double comb_thresh_l_ratio
The default ratio between height_new_elem and comb_thresh_l, in case comb_thresh_l is not explicitly ...
Definition: DataClasses.h:695
double cH
The CALCULATED height, including soil depth if SNP_SOIL == 1.
Definition: DataClasses.h:656
double meltFreezeEnergySoil
Melt freeze part of internal energy change of soil (J m-2)
Definition: DataClasses.h:689
double pAlbedo
Parameterized snow albedo.
Definition: DataClasses.h:649
void splitElements(const double &max_element_length, const double &comb_thresh_l)
Split elements when they are near the top of the snowpack, when REDUCE_N_ELEMENTS is used.
size_t ErosionLevel
Element where snow erosion stopped previously for the drift index.
Definition: DataClasses.h:666
static bool combineCondition(const ElementData &Edata0, const ElementData &Edata1, const double &depth, const bool &reduce_n_elements, const double &comb_thresh_l)
Boolean routine to check whether two snow elements can be combined.
void compSnowpackInternalEnergyChange(const double &sn_dt)
Computes the internal energy change of the snowpack during one computation time step (J m-2)
CanopyData Cdata
Pointer to canopy data.
Definition: DataClasses.h:647
static const double thresh_moist_snow
Snow elements with a LWC above this threshold are considered at least to be moist.
Definition: DataClasses.h:697
Definition: SnowpackConfig.h:28
Definition: DataClasses.h:732
The different types of mass fluxes: Mass fluxes in kg m-2 Rates in kg m-2 h-1 (MS_HNW,...
Definition: DataClasses.h:739
The total amount of water in the snowpack at the present time.
Definition: DataClasses.h:742
The mass loss or gain of the top element due to snow (ice) sublimating.
Definition: DataClasses.h:749
This of course is the total mass of the snowpack at the present time.
Definition: DataClasses.h:740
Solid precipitation rate.
Definition: DataClasses.h:745
Mass loss rate due to wind erosion.
Definition: DataClasses.h:747
Flooding of sea ice (Bucket scheme only)
Definition: DataClasses.h:753
The total amount of ice in the soil at the present time.
Definition: DataClasses.h:744
This too, of course, but summing rho*L.
Definition: DataClasses.h:741
Equivalent to MS_SNOWPACK_RUNOFF but at bottom soil node.
Definition: DataClasses.h:752
The mass loss of snowpack from snow melt due to water transport (virtual lysimeter)
Definition: DataClasses.h:750
The total amount of water in the soil at the present time.
Definition: DataClasses.h:743
The mass loss or gain of the top element due to water evaporating.
Definition: DataClasses.h:748
Total number of different mass change types.
Definition: DataClasses.h:754
Rain rate.
Definition: DataClasses.h:746
The total mass loss of snowpack due to water transport (virtual lysimeter)
Definition: DataClasses.h:751
std::vector< double > load
Total load (kg m-2) in water runoff from solutes like nitrate.
Definition: DataClasses.h:798
friend std::ostream & operator<<(std::ostream &os, const SurfaceFluxes &data)
double lw_in
Energy fluxes: Energy change of snowpack in kJ m-2 (dIntEnergy) Fluxes in W m-2.
Definition: DataClasses.h:773
double sw_dir
incoming direct shortwave radiation; on slopes: projected
Definition: DataClasses.h:786
double sw_hor
incoming global shortwave radiation on horizontal surface
Definition: DataClasses.h:782
double sw_diff
incoming diffuse shortwave radiation
Definition: DataClasses.h:787
double mAlbedo
measured Albedo (used for OUTPUT only)
Definition: DataClasses.h:789
double cRho_hn
Computed new snow density (kg m-3)
Definition: DataClasses.h:800
friend std::istream & operator>>(std::istream &is, SurfaceFluxes &data)
void collectSurfaceFluxes(const BoundCond &Bdata, SnowStation &Xdata, const CurrentMeteo &Mdata)
Assign surface data from SnowStation and BoundCond to SurfaceFluxes.
double qr
rain energy
Definition: DataClasses.h:779
std::vector< double > mass
Total mass of snowpack PLUS different amounts of total mass change, sublimation, runoff,...
Definition: DataClasses.h:797
double lw_net
net longwave radiation
Definition: DataClasses.h:775
double qg
geothermal heat flux or heat flux at lower boundary
Definition: DataClasses.h:780
double sw_in
incoming global shortwave radiation; on slopes: projected
Definition: DataClasses.h:783
void reset(const bool &cumsum_mass)
double drift
Other surface data:
Definition: DataClasses.h:796
double pAlbedo
parameterized Albedo (used for OUTPUT only)
Definition: DataClasses.h:788
double lw_out
outgoing longwave radiation
Definition: DataClasses.h:774
double meltFreezeEnergySoil
Melt freeze part of internal energy change in J m-2 in soil (used for OUTPUT only)
Definition: DataClasses.h:793
double hoar
mass of surface hoar formed or sublimated
Definition: DataClasses.h:778
double dIntEnergySoil
Internal energy change in J m-2 in soil (used for OUTPUT only)
Definition: DataClasses.h:791
double dIntEnergy
Internal energy change in J m-2 in snowpack (used for OUTPUT only)
Definition: DataClasses.h:790
double sw_out
reflected shortwave radiation
Definition: DataClasses.h:784
double qw
net shortwave radiation at the surface (absorbed within the snowpack)
Definition: DataClasses.h:785
const std::string toString() const
void multiplyFluxes(const double &factor)
If multiple surface fluxes have been summed over multiple time steps, the fluxes then need to be aver...
void compSnowSoilHeatFlux(const SnowStation &Xdata)
Compute ground heat flux at soil/snow boundary.
double dhs_corr
operational mode only: snow depth correction in case of squeezing or blow-up (m)
Definition: DataClasses.h:799
double qg0
ground heat flux at soil-snow interface
Definition: DataClasses.h:781
double qs
sensible heat
Definition: DataClasses.h:776
double mRho_hn
Measured new snow density (kg m-3)
Definition: DataClasses.h:801
double meltFreezeEnergy
Melt freeze part of internal energy change in J m-2 in snowpack (used for OUTPUT only)
Definition: DataClasses.h:792
double ql
latent heat
Definition: DataClasses.h:777
ZwischenData contains "memory" information mainly for operational use It is used to prepare some para...
Definition: DataClasses.h:65
Definition: DataClasses.h:67
void reset()
Sets all the values in the vectors to 0.0.
std::vector< double > hn24
Twenty-four hour snow heights every half-hour over three days 144.
Definition: DataClasses.h:76
std::vector< double > hn3
Three hour new snow heights every half-hour over three days 144.
Definition: DataClasses.h:75
std::vector< double > drift24
Twenty-four hour hoar index every half-hour over one day 48.
Definition: DataClasses.h:74
friend std::ostream & operator<<(std::ostream &os, const ZwischenData &data)
std::vector< double > hoar24
Twenty-four hour hoar index every half-hour over one day 48.
Definition: DataClasses.h:73
friend std::istream & operator>>(std::istream &is, ZwischenData &data)
This module contains the van Genuchten model for the water retention curve.
Definition: vanGenuchten.h:36
Definition: Constants.h:46
const double undefined
This is the snowpack undefined value.
Definition: Constants.h:47
Optical Properties of snow.
Definition: DataClasses.h:48
double ssa
Single Scattering Albedo.
Definition: DataClasses.h:51
double exteff
Extinction Efficiency.
Definition: DataClasses.h:50
double ggg
Asymmetry Parameter.
Definition: DataClasses.h:49
Spectrum of incoming solar radiation.
Definition: DataClasses.h:55
double perc
Percentage of Energy.
Definition: DataClasses.h:57
double nm
Definition: DataClasses.h:56