SNOWPACK 3.7.0
DataClasses.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*/
26#ifndef DATACLASSES_H
27#define DATACLASSES_H
28
32
33#include <snowpack/Constants.h>
34#include <meteoio/MeteoIO.h>
35
36#include <string>
37#include <vector>
38
40enum {
45};
46
48struct SNOW_OPTIC {
49 double ggg;
50 double exteff;
51 double ssa;
52};
53
55struct WL_STRUCT {
56 double nm;
57 double perc;
58};
59
66 public:
67 ZwischenData(): hoar24(48, 0.0), drift24(48, 0.0), hn3(144, 0.0), hn24(144, 0.0) {}
68 void reset();
69
70 friend std::ostream& operator<<(std::ostream& os, const ZwischenData& data);
71 friend std::istream& operator>>(std::istream& is, ZwischenData& data);
72
73 std::vector<double> hoar24;
74 std::vector<double> drift24;
75 std::vector<double> hn3;
76 std::vector<double> hn24;
77};
78
84 public:
86 CurrentMeteo(const SnowpackConfig& i_cfg);
87
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);
97
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);
101
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;
135
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;
142
143 bool poor_ea;
144
145 private:
146 size_t getNumberMeasTemperatures(const mio::MeteoData& md);
147
148 std::vector<double> fixedPositions;
149 double minDepthSubsurf;
150 size_t maxNumberMeasTemperatures;
151 size_t numberMeasTemperatures;
152 size_t numberFixedRates;
153};
154
162
164enum {
172
180
187 public:
188 LayerData();
189
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);
193
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;
223};
224
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 {}
243
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);
247
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)
275
276
277};
278
286 public:
288 typedef enum YOUNG_MODULUS {
291 Exp
293
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;
297
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;
308
309 double snowElasticity() const;
310 double neckStressEnhancement() const;
311 double concaveNeckRadius() const;
312 double neckLength() const;
313 double neck2VolumetricStrain() const;
314
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);
320
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);
324
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;
380
381 unsigned short int ID;
382 static const unsigned short int noID;
383
384 double rhov;
385 double Qmm;
390};
391
393class NodeData {
394 public:
395 NodeData() : z(0.), u(0.), f(0.), udot(0.), T(0.), S_n(0.), S_s(0.), ssi(6.), hoar(0.),
396 dsm(0.), S_dsm(0.), Sigdsm(0.), rime(0.), water_flux(0.), rhov(0.) {} //HACK: set ssi to max_stability!
397
398 const std::string toString() const;
399 friend std::ostream& operator<<(std::ostream& os, const NodeData& data);
400 friend std::istream& operator>>(std::istream& is, NodeData& data);
401
402 double z;
403 double u;
404 double f;
405 double udot;
406 double T;
407 double S_n;
408 double S_s;
409 double ssi;
410 double hoar;
411
412 //NIED (H. Hirashima)
413 double dsm;
414 double S_dsm;
415 double Sigdsm;
416 double rime;
417
418 double water_flux;
419
420 double rhov;
421};
422
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.) {}
453
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);
458
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);
462
472 double int_cap_snow; //iMax in Gouttevin,2015
480
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
510
516 double can_ch0;
521 double rsmin;
527 double f3_gd;
529 double rootdepth;
533 double h_wilt;
535
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
580
581 double snowfac;
582 double rainfac;
584 double sigftrunk;
585 double Ttrunk;
590 double QStrunks;
592 double BasalArea;
593 double HMLeaves;
594 double HMTrunks;
595};
596
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);
609
610 ~SnowStation();
612
613 void initialize(const SN_SNOWSOIL_DATA& SSdata, const size_t& i_sector);
614 void resize(const size_t& number_of_elements);
615
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
622
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;
628 double getTotalLateralFlowSnow() const;
629 double getTotalLateralFlowSoil() const;
630 void resetSlopeParFlux();
631
632 size_t getNumberOfElements() const;
633 size_t getNumberOfNodes() const;
634 bool isGlacier(const bool& hydro=false) const;
635 bool hasSoilLayers() const;
636 double findMarkedReferenceLayer() const;
637
638 size_t find_tag(const size_t& tag) const;
639
640 void reset_water_fluxes();
641
642 const std::string toString() const;
643 friend std::ostream& operator<<(std::ostream& os, const SnowStation& data);
644 friend std::istream& operator>>(std::istream& is, SnowStation& data);
645
646 mio::StationData meta;
647 double cos_sl;
648 size_t sector;
649
652 double pAlbedo;
653 double Albedo;
654 double SoilAlb;
656 double BareSoil_z0;
657 size_t SoilNode;
658 double Ground;
659 double cH;
660 double mH;
661 double mass_sum;
662 double swe;
663 double lwc_sum;
666 double hn;
667 double rho_hn;
668 double rime_hn;
670 double ErosionMass;
671 char S_class1;
672 char S_class2;
673 double S_d;
674 double z_S_d;
675 double S_n;
676 double z_S_n;
677 double S_s;
678 double z_S_s;
679 double S_4;
680 double z_S_4;
681 double S_5;
682 double z_S_5;
683 std::vector<NodeData> Ndata;
684 std::vector<ElementData> Edata;
685 void *Kt;
686 double ColdContent;
688 double dIntEnergy;
692 double ReSolver_dt;
693 bool windward;
699 static const size_t number_top_elements;
700 static unsigned short number_of_solutes;
701
702 private:
703 size_t nNodes;
704 size_t nElems;
705 unsigned short int maxElementID;
706 bool useCanopyModel, useSoilLayers, isAlpine3D;
707 static double flexibleMaxElemLength(const double& depth, const double& comb_thresh_l);
708};
709
714
715 public:
716 BoundCond() : lw_out(0.), lw_net(0.), qs(0.), ql(0.), qr(0.), qg(Constants::undefined) {}
717 const std::string toString() const;
718 void reset();
719
720 double lw_out;
721 double lw_net;
722 double qs;
723 double ql;
724 double qr;
725 double qg;
726};
727
734 public:
757 };
758
759 const std::string toString() const;
760 friend std::ostream& operator<<(std::ostream& os, const SurfaceFluxes& data);
761 friend std::istream& operator>>(std::istream& is, SurfaceFluxes& data);
762
764
765 void reset(const bool& cumsum_mass);
766 void compSnowSoilHeatFlux(const SnowStation& Xdata);
767 void collectSurfaceFluxes(const BoundCond& Bdata, SnowStation& Xdata, const CurrentMeteo& Mdata);
768 void multiplyFluxes(const double& factor);
769
775 double lw_in;
776 double lw_out;
777 double lw_net;
778 double qs;
779 double ql;
780 double hoar;
781 double qr;
782 double qg;
783 double qg0;
784 double sw_hor;
785 double sw_in;
786 double sw_out;
787 double qw;
788 double sw_dir;
789 double sw_diff;
790 double pAlbedo;
791 double mAlbedo;
792 double dIntEnergy;
796
798 double drift;
799 std::vector<double> mass;
800 std::vector<double> load;
801 double dhs_corr;
802 double cRho_hn;
803 double mRho_hn;
804
805};
807
809//HACK: could it be moved to plugins? (as well as Aggregate)
811 public:
813
814 void average(const double& w1, const double& w2, const SnowProfileLayer& Pdata);
815 static std::vector<SnowProfileLayer> generateProfile(const mio::Date& dateOfProfile, const SnowStation& Xdata, const double hoar_density_surf, const double hoar_min_size_surf);
816
817 // Profile meta data
818 mio::Date profileDate;
819 std::string stationname;
820 unsigned char loc_for_snow;
821 unsigned char loc_for_wind;
822
823 mio::Date depositionDate;
824 double height;
825 double rho;
826 double T;
827 double gradT;
829 double theta_i;
830 double theta_w;
831 double theta_a;
832 double grain_size;
833 double bond_size;
834 double dendricity;
835 double sphericity;
836 double ogs;
837 double coordin_num;
838 unsigned short int marker;
839 short unsigned int type;
840 double hard;
841
842 private:
843 void generateLayer(const ElementData& Edata, const NodeData& Ndata);
844 void generateLayer(const ElementData& Edata, const NodeData& Ndata,
845 const mio::Date& dateOfProfile, const double hoar_density_surf);
846};
847
849class RunInfo {
850 public:
851 RunInfo();
852 RunInfo(const RunInfo& orig);
853 RunInfo& operator=(const RunInfo&) {return *this;} //everything is static, so we can not change anything
854
855 const std::string version;
856 const double version_num;
857 const mio::Date computation_date;
858 const std::string compilation_date;
859 const std::string user;
860 const std::string hostname;
861
862 private:
863 static double getNumericVersion(std::string version_str);
864 static mio::Date getRunDate();
865 static std::string getCompilationDate();
866};
867
868#endif
@ SOLID
Solid.
Definition: DataClasses.h:41
@ GAS
Gas.
Definition: DataClasses.h:43
@ LIQUID
Liquid.
Definition: DataClasses.h:42
@ NUMBER_OF_PHASES
Definition: DataClasses.h:44
SN_SOIL_DATA
The different soil fields (PERMAFROST)
Definition: DataClasses.h:174
@ SOIL_RHO
Bulk density of dry soil component (without accounting for porosity)
Definition: DataClasses.h:175
@ SOIL_C
Specific heat of dry soil component.
Definition: DataClasses.h:177
@ SOIL_K
Bulk conductivity of dry soil component.
Definition: DataClasses.h:176
@ N_SOIL_FIELDS
Definition: DataClasses.h:178
SN_FIELD
The 3 mathematical fields that can be solved.
Definition: DataClasses.h:156
@ SEEPAGE
Water transport.
Definition: DataClasses.h:158
@ N_SN_FIELDS
Definition: DataClasses.h:160
@ TEMPERATURE
Temperature (phase change and metamorphism)
Definition: DataClasses.h:157
@ SETTLEMENT
Creep displacements.
Definition: DataClasses.h:159
@ AIR
Air.
Definition: DataClasses.h:169
@ WATER_PREF
Water in preferential flow.
Definition: DataClasses.h:168
@ SOIL
Soil.
Definition: DataClasses.h:165
@ ICE
Ice.
Definition: DataClasses.h:166
@ N_COMPONENTS
Definition: DataClasses.h:170
@ WATER
Water.
Definition: DataClasses.h:167
BoundCond is used to set Neumann boundary conditions.
Definition: DataClasses.h:713
double qs
sensible heat
Definition: DataClasses.h:722
double qg
geothermal heat flux or heat flux at lower boundary
Definition: DataClasses.h:725
double ql
latent heat
Definition: DataClasses.h:723
BoundCond()
Definition: DataClasses.h:716
double lw_out
outgoing longwave radiation
Definition: DataClasses.h:720
const std::string toString() const
Definition: DataClasses.cc:272
double qr
rain energy
Definition: DataClasses.h:724
double lw_net
net longwave radiation
Definition: DataClasses.h:721
void reset()
Definition: DataClasses.cc:282
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
CanopyData()
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)
Definition: DataClasses.cc:920
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
Definition: DataClasses.cc:1010
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 ...
Definition: DataClasses.cc:801
double trunkalb
Definition: DataClasses.h:495
double rsmin
TRANSPIRATION.
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)
Definition: DataClasses.cc:761
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
RADIATION BALANCE.
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...
Definition: DataClasses.cc:1107
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....
Definition: DataClasses.cc:548
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)
Definition: DataClasses.cc:830
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
Definition: DataClasses.cc:3170
void reset(const SnowpackConfig &i_cfg)
Definition: DataClasses.cc:3092
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.
Definition: DataClasses.cc:3151
CurrentMeteo()
Definition: DataClasses.cc:3066
double rime_hn
riming index of new snow
Definition: DataClasses.h:140
const std::string toString() const
Definition: DataClasses.cc:3353
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
Definition: DataClasses.cc:3175
void setMeasTempParameters(const mio::MeteoData &md)
Definition: DataClasses.cc:3113
double rho_hn
Measured new snow density (kg m-3)
Definition: DataClasses.h:139
friend std::ostream & operator<<(std::ostream &os, const CurrentMeteo &data)
Definition: DataClasses.cc:3221
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)
Definition: DataClasses.cc:3285
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)
Definition: DataClasses.cc:3190
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
Definition: DataClasses.cc:3185
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)
Definition: DataClasses.cc:3207
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
Definition: DataClasses.cc:3180
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
bulk 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.
Definition: DataClasses.cc:1658
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 ...
Definition: DataClasses.cc:1541
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...
Definition: DataClasses.cc:1676
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.
Definition: DataClasses.cc:1443
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.
Definition: DataClasses.cc:1482
unsigned short int type
grain class
Definition: DataClasses.h:350
Young_Modulus
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)
Definition: DataClasses.cc:1147
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 vapTrans_underSaturationDegree
the degree of undersaturation, (rhov-rohv_sat)/rhov_sat (-)
Definition: DataClasses.h:389
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)
Definition: DataClasses.cc:1172
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()
Definition: DataClasses.cc:1664
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.
Definition: DataClasses.cc:1426
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)
Definition: DataClasses.cc:1341
double RelativeHumidity() const
RelativeHumidity.
Definition: DataClasses.cc:1583
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)
Definition: DataClasses.cc:1254
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)
Definition: DataClasses.cc:1618
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)
Definition: DataClasses.cc:1647
void updDensity()
Updates element density.
Definition: DataClasses.cc:1452
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.
Definition: DataClasses.cc:1369
void opticalEquivalentGrainSize()
Opical equivalent grain size CROCUS implementation as described in Vionnet et al.,...
Definition: DataClasses.cc:1468
static const unsigned short int noID
Definition: DataClasses.h:382
void snowResidualWaterContent()
Definition: DataClasses.cc:1490
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...
Definition: DataClasses.cc:1603
double crit_cut_length
Critical cut length (m)
Definition: DataClasses.h:367
const std::string toString() const
Definition: DataClasses.cc:1830
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...
Definition: DataClasses.cc:1632
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
bulk salinity (g/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
Definition: DataClasses.cc:3625
friend std::istream & operator>>(std::istream &is, LayerData &data)
Definition: DataClasses.cc:3573
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)
Definition: DataClasses.cc:3525
double SoilRho
Density of soil in kg m-3.
Definition: DataClasses.h:209
LayerData()
Definition: DataClasses.cc:3517
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:393
double udot
downward creep velocity in m s-1
Definition: DataClasses.h:405
double rhov
nodal vapor density in kg/m^3
Definition: DataClasses.h:420
double Sigdsm
Definition: DataClasses.h:415
double S_n
Stability Index for natural avalanches.
Definition: DataClasses.h:407
double dsm
Dry snow metamorphism factor.
Definition: DataClasses.h:413
double S_s
Stability Index for skier triggered avalanches.
Definition: DataClasses.h:408
double hoar
Mass of surface hoar collected while node was exposed to surface.
Definition: DataClasses.h:410
friend std::ostream & operator<<(std::ostream &os, const NodeData &data)
Definition: DataClasses.cc:1853
NodeData()
Definition: DataClasses.h:395
double f
reaction or unbalanced forces (CREEP)
Definition: DataClasses.h:404
double u
creep displacements in m
Definition: DataClasses.h:403
double ssi
Structural Stability Index.
Definition: DataClasses.h:409
double T
nodal temperature in K
Definition: DataClasses.h:406
const std::string toString() const
Definition: DataClasses.cc:1893
friend std::istream & operator>>(std::istream &is, NodeData &data)
Definition: DataClasses.cc:1873
double water_flux
Water flowing through the node (kg/m2). Positive values denote downward fluxes.
Definition: DataClasses.h:418
double S_dsm
Definition: DataClasses.h:414
double rime
Definition: DataClasses.h:416
double z
nodal height from ground in m
Definition: DataClasses.h:402
class to collect the information about the current simulation (version, date)
Definition: DataClasses.h:849
const mio::Date computation_date
Date of computation.
Definition: DataClasses.h:857
const double version_num
SNOWPACK version formatted as a number.
Definition: DataClasses.h:856
const std::string version
SNOWPACK version.
Definition: DataClasses.h:855
const std::string hostname
hostname of the computer running the simulation
Definition: DataClasses.h:860
RunInfo()
Definition: DataClasses.cc:60
const std::string compilation_date
Date of compilation.
Definition: DataClasses.h:858
const std::string user
logname of the user running the simulation
Definition: DataClasses.h:859
RunInfo & operator=(const RunInfo &)
Definition: DataClasses.h:853
SN_SNOWSOIL_DATA includes all important station parameters as well as LayerData.
Definition: DataClasses.h:230
const std::string toString() const
Definition: DataClasses.cc:3453
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)
Definition: DataClasses.cc:3385
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
SN_SNOWSOIL_DATA()
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)
Definition: DataClasses.cc:3418
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:42
Defines structure for snow profile layers.
Definition: DataClasses.h:810
double theta_w
0 to 1, volume fraction of water (-)
Definition: DataClasses.h:830
double height
Height of snow or snow depth; 0 to 1000 (cm)
Definition: DataClasses.h:824
double theta_a
0 to 1, volume fraction of air (-)
Definition: DataClasses.h:831
void average(const double &w1, const double &w2, const SnowProfileLayer &Pdata)
Determines the averaged quantities of the current layer with another layer.
Definition: DataClasses.cc:248
double T
-50 to 50, snow temperature at top of layer (degC)
Definition: DataClasses.h:826
double hard
0. to 5. (1)
Definition: DataClasses.h:840
mio::Date profileDate
Date of profile.
Definition: DataClasses.h:818
mio::Date depositionDate
Date of deposition (mainly used for snow layers)
Definition: DataClasses.h:823
unsigned short int marker
0 to 999 (1)
Definition: DataClasses.h:838
SnowProfileLayer()
Definition: DataClasses.cc:131
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)
Definition: DataClasses.cc:203
double v_strain_rate
0 to 1.0e-5, viscous strain rate (s-1)
Definition: DataClasses.h:828
std::string stationname
Definition: DataClasses.h:819
unsigned char loc_for_wind
Definition: DataClasses.h:821
double coordin_num
0 to 10 (1)
Definition: DataClasses.h:837
unsigned char loc_for_snow
Definition: DataClasses.h:820
double ogs
0 to 100, optical equivalent grain size (mm)
Definition: DataClasses.h:836
double rho
0 to 1000 (kg m-3)
Definition: DataClasses.h:825
short unsigned int type
0 to 999 (1)
Definition: DataClasses.h:839
double sphericity
0 to 1 (1)
Definition: DataClasses.h:835
double grain_size
0 to 100 (mm)
Definition: DataClasses.h:832
double gradT
-1000 to 1000, temperature gradient across layer (K m-1)
Definition: DataClasses.h:827
double dendricity
0 to 1 (1)
Definition: DataClasses.h:834
double bond_size
0 to 100 (mm)
Definition: DataClasses.h:833
double theta_i
0 to 1, volume fraction of ice (-)
Definition: DataClasses.h:829
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,...
Definition: DataClasses.cc:2244
double findMarkedReferenceLayer() const
returns the height of a marked reference layer inside the model domain Searches for the layer that is...
Definition: DataClasses.cc:2842
static const double comb_thresh_sp
Sphericity (1)
Definition: DataClasses.h:697
size_t SoilNode
The top soil node, 0 in case of SNP_SOIL == 0.
Definition: DataClasses.h:657
size_t getNumberOfNodes() const
Definition: DataClasses.cc:2196
bool hasSoilLayers() const
Definition: DataClasses.cc:2217
double z_S_n
Depth of Minimum S_n.
Definition: DataClasses.h:676
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...
Definition: DataClasses.cc:2343
size_t getNumberOfElements() const
Definition: DataClasses.cc:2191
char S_class1
Stability class based on hand hardness, grain class ...
Definition: DataClasses.h:671
static const double thresh_moist_soil
Definition: DataClasses.h:698
friend std::istream & operator>>(std::istream &is, SnowStation &data)
Definition: DataClasses.cc:2936
double S_n
Minimum natural stability index.
Definition: DataClasses.h:675
double S_s
Minimum skier stability index sk38 (Sk38)
Definition: DataClasses.h:677
double hn
Depth of new snow to be used on slopes.
Definition: DataClasses.h:666
mio::StationData meta
Station meta data.
Definition: DataClasses.h:646
size_t find_tag(const size_t &tag) const
Find element with corresponding tag or return IOUtils::npos if not found.
Definition: DataClasses.cc:2206
double SoilAlb
Soil albedo.
Definition: DataClasses.h:654
double rime_hn
rime of new snow to be used on slopes
Definition: DataClasses.h:668
double ErosionMass
Eroded mass either real or virtually (storage if less than one element)
Definition: DataClasses.h:670
static const size_t number_top_elements
Number of top elements left untouched by the join functions.
Definition: DataClasses.h:699
SeaIce * Seaice
Pointer to sea ice class.
Definition: DataClasses.h:651
double S_d
Minimum deformation rate stability index.
Definition: DataClasses.h:673
double swc_sum_soil
Total solid water in soil.
Definition: DataClasses.h:665
double dIntEnergy
Internal energy change of snowpack (J m-2)
Definition: DataClasses.h:688
void * Kt
Pointer to pseudo-conductivity and stiffnes matrix.
Definition: DataClasses.h:685
double cos_sl
Cosinus of slope angle, initialized once!
Definition: DataClasses.h:647
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...
Definition: DataClasses.cc:2171
double z_S_4
Depth of Minimum S_4.
Definition: DataClasses.h:680
double rho_hn
Density of new snow to be used on slopes.
Definition: DataClasses.h:667
~SnowStation()
Definition: DataClasses.cc:2009
double z_S_s
Depth of Minimum S_s.
Definition: DataClasses.h:678
double meltFreezeEnergy
Melt freeze part of internal energy change of snowpack (J m-2)
Definition: DataClasses.h:690
double getTotalLateralFlowSoil() const
Computes the total lateral flow in soil (kg / m2)
Definition: DataClasses.cc:2143
double lwc_sum_soil
Total liquid water in soil.
Definition: DataClasses.h:664
double ColdContent
Cold content of snowpack (J m-2)
Definition: DataClasses.h:686
double S_4
placeholder - currently Minimum structural stability index (SSI)
Definition: DataClasses.h:679
bool windward
True for windward (luv) slope.
Definition: DataClasses.h:693
double S_5
placeholder
Definition: DataClasses.h:681
void splitElement(const size_t &e)
Split the element provided as first argument.
Definition: DataClasses.cc:2626
double ColdContentSoil
Cold content of soil (J m-2)
Definition: DataClasses.h:687
double getModelledTemperature(const double &z) const
Returns modelled internal snow or/and soil temperature (instantaneous value; degC),...
Definition: DataClasses.cc:2110
double mass_sum
Total mass summing mass of snow elements.
Definition: DataClasses.h:661
double swe
Total mass summing snow water equivalent of elements.
Definition: DataClasses.h:662
static const double comb_thresh_rg
Grain radius (mm)
Definition: DataClasses.h:697
void compSnowpackMasses()
Computes the actual total masses of the snowpack (kg m-2)
Definition: DataClasses.cc:2032
void reduceNumberOfElements(const size_t &rnE)
Remove the upper "marked" element of two (snow only) .
Definition: DataClasses.cc:2290
double z_S_d
Depth of Minimum S_d.
Definition: DataClasses.h:674
std::vector< NodeData > Ndata
pointer to nodal data array (e.g. T, z, u, etc..)
Definition: DataClasses.h:683
static void mergeElements(ElementData &Edata0, const ElementData &Edata1, const bool &merge, const bool &topElement)
Merging two elements.
Definition: DataClasses.cc:2707
double ReSolver_dt
Last used RE time step in the previous SNOWPACK time step.
Definition: DataClasses.h:692
static unsigned short number_of_solutes
The model treats that number of solutes.
Definition: DataClasses.h:700
double BareSoil_z0
Bare soil roughness in m.
Definition: DataClasses.h:656
static const double comb_thresh_dd
Dendricity (1)
Definition: DataClasses.h:697
void reset_water_fluxes()
Definition: DataClasses.cc:2222
double mH
The MEASURED height, including soil depth if SNP_SOIL == 1.
Definition: DataClasses.h:660
SnowStation & operator=(const SnowStation &)
Assignement operator.
Definition: DataClasses.cc:1943
std::vector< ElementData > Edata
pointer to element data array (e.g. Te, L, Rho, etc..)
Definition: DataClasses.h:684
double Albedo
Snow albedo used by the model.
Definition: DataClasses.h:653
double dIntEnergySoil
Internal energy change of soil (J m-2)
Definition: DataClasses.h:689
double z_S_5
Depth of Minimum S_5.
Definition: DataClasses.h:682
friend std::ostream & operator<<(std::ostream &os, const SnowStation &data)
Definition: DataClasses.cc:2855
double getTotalLateralFlowSnow() const
Computes the total lateral flow in snow (kg / m2)
Definition: DataClasses.cc:2128
static const double comb_thresh_water
Water content (1)
Definition: DataClasses.h:696
size_t sector
current slope sector of width 360./max(1, nSlopes-1)
Definition: DataClasses.h:648
double Ground
The ground height – meaning the height of the top soil node.
Definition: DataClasses.h:658
const std::string toString() const
Definition: DataClasses.cc:3022
void resetSlopeParFlux()
Reset lateral flow.
Definition: DataClasses.cc:2158
static const double comb_thresh_ice
Volumetric ice content (1), i.e., about 46 kg m-3.
Definition: DataClasses.h:696
double WindScalingFactor
Local scaling factor for wind at drift station.
Definition: DataClasses.h:694
SnowStation(const bool i_useCanopyModel=true, const bool i_useSoilLayers=true, const bool i_isAlpine3D=false, const bool i_useSeaIceModule=false)
Definition: DataClasses.cc:1907
char S_class2
Stability class based on hand hardness, grain class ...
Definition: DataClasses.h:672
double getLiquidWaterIndex() const
Computes the liquid water index defined as the ratio of total liquid water content (in mm w....
Definition: DataClasses.cc:2098
void compSoilInternalEnergyChange(const double &sn_dt)
Computes the internal energy change of the soil during one computation time step (J m-2)
Definition: DataClasses.cc:2073
bool isGlacier(const bool &hydro=false) const
returns if a snow profile can be considered as a glacier. Practically, the hydrological criteria is t...
Definition: DataClasses.cc:2801
double SoilEmissivity
Soil emissivity.
Definition: DataClasses.h:655
double TimeCountDeltaHS
Time counter tracking erroneous settlement in operational mode.
Definition: DataClasses.h:695
double lwc_sum
Total liquid water in snowpack.
Definition: DataClasses.h:663
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:696
double cH
The CALCULATED height, including soil depth if SNP_SOIL == 1.
Definition: DataClasses.h:659
double meltFreezeEnergySoil
Melt freeze part of internal energy change of soil (J m-2)
Definition: DataClasses.h:691
double pAlbedo
Parameterized snow albedo.
Definition: DataClasses.h:652
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.
Definition: DataClasses.cc:2672
size_t ErosionLevel
Element where snow erosion stopped previously for the drift index.
Definition: DataClasses.h:669
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.
Definition: DataClasses.cc:2576
void compSnowpackInternalEnergyChange(const double &sn_dt)
Computes the internal energy change of the snowpack during one computation time step (J m-2)
Definition: DataClasses.cc:2051
CanopyData Cdata
Pointer to canopy data.
Definition: DataClasses.h:650
static const double thresh_moist_snow
Snow elements with a LWC above this threshold are considered at least to be moist.
Definition: DataClasses.h:698
Definition: SnowpackConfig.h:28
Definition: DataClasses.h:733
SN_MASS_CHANGES
The different types of mass fluxes: Mass fluxes in kg m-2 Rates in kg m-2 h-1 (MS_HNW,...
Definition: DataClasses.h:740
@ MS_WATER
The total amount of water in the snowpack at the present time.
Definition: DataClasses.h:743
@ MS_SUBLIMATION
The mass loss or gain of the top element due to snow (ice) sublimating.
Definition: DataClasses.h:750
@ MS_TOTALMASS
This of course is the total mass of the snowpack at the present time.
Definition: DataClasses.h:741
@ MS_HNW
Solid precipitation rate.
Definition: DataClasses.h:746
@ MS_WIND
Mass loss rate due to wind erosion.
Definition: DataClasses.h:748
@ MS_FLOODING
The mass gain due to adding ocean water to snow- seaice by flodding process.
Definition: DataClasses.h:754
@ MS_ICE_SOIL
The total amount of ice in the soil at the present time.
Definition: DataClasses.h:745
@ MS_SWE
This too, of course, but summing rho*L.
Definition: DataClasses.h:742
@ MS_SOIL_RUNOFF
Equivalent to MS_SNOWPACK_RUNOFF but at bottom soil node.
Definition: DataClasses.h:753
@ MS_SNOWPACK_RUNOFF
The mass loss of snowpack from snow melt due to water transport (virtual lysimeter)
Definition: DataClasses.h:751
@ MS_WATER_SOIL
The total amount of water in the soil at the present time.
Definition: DataClasses.h:744
@ MS_EVAPORATION
The mass loss or gain of the top element due to water evaporating.
Definition: DataClasses.h:749
@ N_MASS_CHANGES
Total number of different mass change types.
Definition: DataClasses.h:756
@ MS_RAIN
Rain rate.
Definition: DataClasses.h:747
@ MS_SURFACE_MASS_FLUX
The total mass loss of snowpack due to water transport (virtual lysimeter)
Definition: DataClasses.h:752
@ MS_ICEBASE_MELTING_FREEZING
The mass gain/loss of the ice base due to melting-freezing.
Definition: DataClasses.h:755
std::vector< double > load
Total load (kg m-2) in water runoff from solutes like nitrate.
Definition: DataClasses.h:800
friend std::ostream & operator<<(std::ostream &os, const SurfaceFluxes &data)
Definition: DataClasses.cc:454
double lw_in
Energy fluxes: Energy change of snowpack in kJ m-2 (dIntEnergy) Fluxes in W m-2.
Definition: DataClasses.h:775
double sw_dir
incoming direct shortwave radiation; on slopes: projected
Definition: DataClasses.h:788
double sw_hor
incoming global shortwave radiation on horizontal surface
Definition: DataClasses.h:784
double sw_diff
incoming diffuse shortwave radiation
Definition: DataClasses.h:789
double mAlbedo
measured Albedo (used for OUTPUT only)
Definition: DataClasses.h:791
double cRho_hn
Computed new snow density (kg m-3)
Definition: DataClasses.h:802
SurfaceFluxes()
Definition: DataClasses.cc:292
friend std::istream & operator>>(std::istream &is, SurfaceFluxes &data)
Definition: DataClasses.cc:494
void collectSurfaceFluxes(const BoundCond &Bdata, SnowStation &Xdata, const CurrentMeteo &Mdata)
Assign surface data from SnowStation and BoundCond to SurfaceFluxes.
Definition: DataClasses.cc:361
double qr
rain energy
Definition: DataClasses.h:781
std::vector< double > mass
Total mass of snowpack PLUS different amounts of total mass change, sublimation, runoff,...
Definition: DataClasses.h:799
double lw_net
net longwave radiation
Definition: DataClasses.h:777
double qg
geothermal heat flux or heat flux at lower boundary
Definition: DataClasses.h:782
double sw_in
incoming global shortwave radiation; on slopes: projected
Definition: DataClasses.h:785
void reset(const bool &cumsum_mass)
Definition: DataClasses.cc:297
double drift
Other surface data:
Definition: DataClasses.h:798
double pAlbedo
parameterized Albedo (used for OUTPUT only)
Definition: DataClasses.h:790
double lw_out
outgoing longwave radiation
Definition: DataClasses.h:776
double meltFreezeEnergySoil
Melt freeze part of internal energy change in J m-2 in soil (used for OUTPUT only)
Definition: DataClasses.h:795
double hoar
mass of surface hoar formed or sublimated
Definition: DataClasses.h:780
double dIntEnergySoil
Internal energy change in J m-2 in soil (used for OUTPUT only)
Definition: DataClasses.h:793
double dIntEnergy
Internal energy change in J m-2 in snowpack (used for OUTPUT only)
Definition: DataClasses.h:792
double sw_out
reflected shortwave radiation
Definition: DataClasses.h:786
double qw
net shortwave radiation at the surface (absorbed within the snowpack)
Definition: DataClasses.h:787
const std::string toString() const
Definition: DataClasses.cc:3488
void multiplyFluxes(const double &factor)
If multiple surface fluxes have been summed over multiple time steps, the fluxes then need to be aver...
Definition: DataClasses.cc:432
void compSnowSoilHeatFlux(const SnowStation &Xdata)
Compute ground heat flux at soil/snow boundary.
Definition: DataClasses.cc:331
double dhs_corr
operational mode only: snow depth correction in case of squeezing or blow-up (m)
Definition: DataClasses.h:801
double qg0
ground heat flux at soil-snow interface
Definition: DataClasses.h:783
double qs
sensible heat
Definition: DataClasses.h:778
double mRho_hn
Measured new snow density (kg m-3)
Definition: DataClasses.h:803
double meltFreezeEnergy
Melt freeze part of internal energy change in J m-2 in snowpack (used for OUTPUT only)
Definition: DataClasses.h:794
double ql
latent heat
Definition: DataClasses.h:779
ZwischenData contains "memory" information mainly for operational use It is used to prepare some para...
Definition: DataClasses.h:65
ZwischenData()
Definition: DataClasses.h:67
void reset()
Sets all the values in the vectors to 0.0.
Definition: DataClasses.cc:92
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)
Definition: DataClasses.cc:100
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)
Definition: DataClasses.cc:114
This module contains the van Genuchten model for the water retention curve.
Definition: vanGenuchten.h:36
Definition: Constants.h:43
const double undefined
This is the snowpack undefined value.
Definition: Constants.h:44
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
Wavelength.
Definition: DataClasses.h:56