#include <DataClasses.h>
Public Member Functions | |
SnowStation (const bool i_useCanopyModel=true, const bool i_useSoilLayers=true, const bool i_isAlpine3D=false, const bool i_useSeaIceModule=false) | |
SnowStation (const SnowStation &c) | |
~SnowStation () | |
SnowStation & | operator= (const SnowStation &) |
Assignement operator. More... | |
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 including element, nodal and canopy data Because you are working with layers, the first node is a special case; the rest can be generated in a loop .... The bottom temperature at the beginning of the computation is given by the temperature at the top of the lowest soil or snow layer IMPORTANT: it is very important for Alpine3D that Cdata.height is initialized even if CANOPY = 0, otherwise SnowInterface will not recognize the canopy grids (David 2007-06-25). More... | |
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 reset, respectively. More... | |
void | reduceNumberOfElements (const size_t &rnE) |
Remove the upper "marked" element of two (snow only) . More... | |
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, leaving NUMBER_TOP_ELEMENTS surface elements untouched Pairs of elements within the snow cover satisfying the conditions of combineCondition() are combined by placing everything in the lower element, setting the density of upper element to Constants::undefined, and getting rid of node in between. The elements being very similar and thus the microstructure parameters being approximately equal as defined in combineCondition(), simply average the microstructure properties NOTE that the condense element check is placed at the end of a time step, allowing elements do develop on their own. More... | |
void | splitElement (const size_t &e) |
Split the element provided as first argument. More... | |
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. More... | |
void | compSnowpackMasses () |
Computes the actual total masses of the snowpack (kg m-2) More... | |
void | compSnowpackInternalEnergyChange (const double &sn_dt) |
Computes the internal energy change of the snowpack during one computation time step (J m-2) More... | |
void | compSoilInternalEnergyChange (const double &sn_dt) |
Computes the internal energy change of the soil during one computation time step (J m-2) More... | |
double | getLiquidWaterIndex () const |
Computes the liquid water index defined as the ratio of total liquid water content (in mm w.e.) to calculated snow depth (in mm) divided by 0.03. Unit: (1) More... | |
double | getModelledTemperature (const double &z) const |
Returns modelled internal snow or/and soil temperature (instantaneous value; degC), at a given position z perpendicular to slope (m) z must be less than computed height (Xdata->cH), otherwise modeled temperature is set to Constants::undefined. More... | |
double | getTotalLateralFlowSnow () const |
Computes the total lateral flow in snow (kg / m2) More... | |
double | getTotalLateralFlowSoil () const |
Computes the total lateral flow in soil (kg / m2) More... | |
void | resetSlopeParFlux () |
Reset lateral flow. More... | |
size_t | getNumberOfElements () const |
size_t | getNumberOfNodes () const |
bool | isGlacier (const bool &hydro=false) const |
returns if a snow profile can be considered as a glacier. Practically, the hydrological criteria is that if a pixel contains more than 2 m of pure ice anywhere, it is considered to be glaciated. The standard criteria is that if the top 5 layers are made of pure ice, the pixel is glaciated. Therefore, a glacier covered by seasonal snow is glaciated in regard to the hydrological criteria but non-glaciated in regard to the standard criteria. More... | |
bool | hasSoilLayers () const |
double | findMarkedReferenceLayer () const |
returns the height of a marked reference layer inside the model domain Searches for the layer that is marked using (int(mk/1000)==9, e.g. 9000 or 9028) inside model domain This is for example used to interpret snow height measurements with an arbitrary reference level (i.e., not necessarily 0.) on a glacier, ice sheets or sea ice using the snow height driven mode. More... | |
size_t | find_tag (const size_t &tag) const |
Find element with corresponding tag or return IOUtils::npos if not found. More... | |
void | reset_water_fluxes () |
const std::string | toString () const |
Static Public Member Functions | |
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. More... | |
static void | mergeElements (ElementData &Edata0, const ElementData &Edata1, const bool &merge, const bool &topElement) |
Merging two elements. More... | |
Public Attributes | |
mio::StationData | meta |
Station meta data. More... | |
double | cos_sl |
Cosinus of slope angle, initialized once! More... | |
size_t | sector |
current slope sector of width 360./max(1, nSlopes-1) More... | |
CanopyData | Cdata |
Pointer to canopy data. More... | |
SeaIce * | Seaice |
Pointer to sea ice class. More... | |
double | pAlbedo |
Parameterized snow albedo. More... | |
double | Albedo |
Snow albedo used by the model. More... | |
double | SoilAlb |
Soil albedo. More... | |
double | SoilEmissivity |
Soil emissivity. More... | |
double | BareSoil_z0 |
Bare soil roughness in m. More... | |
size_t | SoilNode |
The top soil node, 0 in case of SNP_SOIL == 0. More... | |
double | Ground |
The ground height – meaning the height of the top soil node. More... | |
double | cH |
The CALCULATED height, including soil depth if SNP_SOIL == 1. More... | |
double | mH |
The MEASURED height, including soil depth if SNP_SOIL == 1. More... | |
double | mass_sum |
Total mass summing mass of snow elements. More... | |
double | swe |
Total mass summing snow water equivalent of elements. More... | |
double | lwc_sum |
Total liquid water in snowpack. More... | |
double | lwc_sum_soil |
Total liquid water in soil. More... | |
double | swc_sum_soil |
Total solid water in soil. More... | |
double | hn |
Depth of new snow to be used on slopes. More... | |
double | rho_hn |
Density of new snow to be used on slopes. More... | |
double | rime_hn |
rime of new snow to be used on slopes More... | |
size_t | ErosionLevel |
Element where snow erosion stopped previously for the drift index. More... | |
double | ErosionMass |
Eroded mass either real or virtually (storage if less than one element) More... | |
char | S_class1 |
Stability class based on hand hardness, grain class ... More... | |
char | S_class2 |
Stability class based on hand hardness, grain class ... More... | |
double | S_d |
Minimum deformation rate stability index. More... | |
double | z_S_d |
Depth of Minimum S_d. More... | |
double | S_n |
Minimum natural stability index. More... | |
double | z_S_n |
Depth of Minimum S_n. More... | |
double | S_s |
Minimum skier stability index sk38 (Sk38) More... | |
double | z_S_s |
Depth of Minimum S_s. More... | |
double | S_4 |
placeholder - currently Minimum structural stability index (SSI) More... | |
double | z_S_4 |
Depth of Minimum S_4. More... | |
double | S_5 |
placeholder More... | |
double | z_S_5 |
Depth of Minimum S_5. More... | |
std::vector< NodeData > | Ndata |
pointer to nodal data array (e.g. T, z, u, etc..) More... | |
std::vector< ElementData > | Edata |
pointer to element data array (e.g. Te, L, Rho, etc..) More... | |
void * | Kt |
Pointer to pseudo-conductivity and stiffnes matrix. More... | |
double | ColdContent |
Cold content of snowpack (J m-2) More... | |
double | ColdContentSoil |
Cold content of soil (J m-2) More... | |
double | dIntEnergy |
Internal energy change of snowpack (J m-2) More... | |
double | dIntEnergySoil |
Internal energy change of soil (J m-2) More... | |
double | meltFreezeEnergy |
Melt freeze part of internal energy change of snowpack (J m-2) More... | |
double | meltFreezeEnergySoil |
Melt freeze part of internal energy change of soil (J m-2) More... | |
double | ReSolver_dt |
Last used RE time step in the previous SNOWPACK time step. More... | |
bool | windward |
True for windward (luv) slope. More... | |
double | WindScalingFactor |
Local scaling factor for wind at drift station. More... | |
double | TimeCountDeltaHS |
Time counter tracking erroneous settlement in operational mode. More... | |
Static Public Attributes | |
static const double | comb_thresh_l_ratio = 0.75 |
The default ratio between height_new_elem and comb_thresh_l, in case comb_thresh_l is not explicitly defined. More... | |
static const double | comb_thresh_ice = 0.05 |
Volumetric ice content (1), i.e., about 46 kg m-3. More... | |
static const double | comb_thresh_water = 0.01 |
Water content (1) More... | |
static const double | comb_thresh_dd = 0.2 |
Dendricity (1) More... | |
static const double | comb_thresh_sp = 0.05 |
Sphericity (1) More... | |
static const double | comb_thresh_rg = 0.125 |
Grain radius (mm) More... | |
static const double | thresh_moist_snow = 0.003 |
Snow elements with a LWC above this threshold are considered at least to be moist. More... | |
static const double | thresh_moist_soil = 0.0001 |
static const size_t | number_top_elements = 5 |
Number of top elements left untouched by the join functions. More... | |
static unsigned short | number_of_solutes = 0 |
The model treats that number of solutes. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const SnowStation &data) |
std::istream & | operator>> (std::istream &is, SnowStation &data) |
|
explicit |
SnowStation::SnowStation | ( | const SnowStation & | c | ) |
SnowStation::~SnowStation | ( | ) |
|
static |
Boolean routine to check whether two snow elements can be combined.
Edata0 | Lower element |
Edata1 | Upper element |
depth | Distance of the element from the snow surface |
reduce_n_elements | Enable more "aggressive" combining for layers deeper in the snowpack, to reduce the number of elements and thus the computational load. |
void SnowStation::combineElements | ( | const size_t & | i_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, leaving NUMBER_TOP_ELEMENTS surface elements untouched
Pairs of elements within the snow cover satisfying the conditions of combineCondition() are combined by placing everything in the lower element, setting the density of upper element to Constants::undefined, and getting rid of node in between.
The elements being very similar and thus the microstructure parameters being approximately equal as defined in combineCondition(), simply average the microstructure properties
NOTE that the condense element check is placed at the end of a time step, allowing elements do develop on their own.
i_number_top_elements | The number of surface elements to be left untouched |
reduce_n_elements | Enable more "aggressive" combining for layers deeper in the snowpack |
cond | Condition to use to determine whether or not to combine: 1 = combineCondition, 2 = Aggregate::joinSimilarLayers, 3 = Aggregate::mergeThinLayer |
comb_thresh_l | Only used for cond == 1: both elements must be smaller than this value for an action to be taken. |
void SnowStation::compSnowpackInternalEnergyChange | ( | const double & | sn_dt | ) |
Computes the internal energy change of the snowpack during one computation time step (J m-2)
void SnowStation::compSnowpackMasses | ( | ) |
Computes the actual total masses of the snowpack (kg m-2)
void SnowStation::compSoilInternalEnergyChange | ( | const double & | sn_dt | ) |
Computes the internal energy change of the soil during one computation time step (J m-2)
size_t SnowStation::find_tag | ( | const size_t & | tag | ) | const |
Find element with corresponding tag or return IOUtils::npos if not found.
tag | Tag to look for |
double SnowStation::findMarkedReferenceLayer | ( | ) | const |
returns the height of a marked reference layer inside the model domain Searches for the layer that is marked using (int(mk/1000)==9, e.g. 9000 or 9028) inside model domain This is for example used to interpret snow height measurements with an arbitrary reference level (i.e., not necessarily 0.) on a glacier, ice sheets or sea ice using the snow height driven mode.
double SnowStation::getLiquidWaterIndex | ( | ) | const |
Computes the liquid water index defined as the ratio of total liquid water content (in mm w.e.) to calculated snow depth (in mm) divided by 0.03. Unit: (1)
double SnowStation::getModelledTemperature | ( | const double & | z | ) | const |
Returns modelled internal snow or/and soil temperature (instantaneous value; degC), at a given position z perpendicular to slope (m)
z must be less than computed height (Xdata->cH), otherwise modeled temperature is set to Constants::undefined.
z | Sensor position perpendicular to slope (m) |
size_t SnowStation::getNumberOfElements | ( | ) | const |
size_t SnowStation::getNumberOfNodes | ( | ) | const |
double SnowStation::getTotalLateralFlowSnow | ( | ) | const |
Computes the total lateral flow in snow (kg / m2)
double SnowStation::getTotalLateralFlowSoil | ( | ) | const |
Computes the total lateral flow in soil (kg / m2)
bool SnowStation::hasSoilLayers | ( | ) | const |
void SnowStation::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 including element, nodal and canopy data
Because you are working with layers, the first node is a special case; the rest can be generated in a loop .... The bottom temperature at the beginning of the computation is given by the temperature at the top of the lowest soil or snow layer
IMPORTANT: it is very important for Alpine3D that Cdata.height is initialized even if CANOPY = 0, otherwise SnowInterface will not recognize the canopy grids (David 2007-06-25).
SSdata | |
i_sector | defines the exposition sector of the slope (width 360./number_slopes) |
bool SnowStation::isGlacier | ( | const bool & | hydro = false | ) | const |
returns if a snow profile can be considered as a glacier. Practically, the hydrological criteria is that if a pixel contains more than 2 m of pure ice anywhere, it is considered to be glaciated. The standard criteria is that if the top 5 layers are made of pure ice, the pixel is glaciated. Therefore, a glacier covered by seasonal snow is glaciated in regard to the hydrological criteria but non-glaciated in regard to the standard criteria.
hydro | if true, use an hydrologist criteria (default: false) |
|
static |
Merging two elements.
EdataLower | Properties of lower element |
EdataUpper | Properties of upper element |
merge | True if upper element is to be joined with lower one, false if upper element is to be removed |
topElement | set to true if the upper element is at the very top of the snow pack |
SnowStation & SnowStation::operator= | ( | const SnowStation & | source | ) |
Assignement operator.
void SnowStation::reduceNumberOfElements | ( | const size_t & | rnE | ) |
Remove the upper "marked" element of two (snow only)
.
rnE | Reduced number of elements |
void SnowStation::reset_water_fluxes | ( | ) |
void SnowStation::resetSlopeParFlux | ( | ) |
Reset lateral flow.
void SnowStation::resize | ( | const size_t & | number_of_elements | ) |
Reallocate element and node data
Edata and Ndata as well as nElems and nNodes are reallocated or reset, respectively.
number_of_elements | The new number of elements |
void SnowStation::splitElement | ( | const size_t & | e | ) |
Split the element provided as first argument.
void SnowStation::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.
max_element_length | If positive: maximum allowed element length (m), above which splitting is applied. If argument is not positive: use function flexibleMaxElemLength. |
const std::string SnowStation::toString | ( | ) | const |
|
friend |
|
friend |
double SnowStation::Albedo |
Snow albedo used by the model.
double SnowStation::BareSoil_z0 |
Bare soil roughness in m.
CanopyData SnowStation::Cdata |
Pointer to canopy data.
double SnowStation::cH |
The CALCULATED height, including soil depth if SNP_SOIL == 1.
double SnowStation::ColdContent |
Cold content of snowpack (J m-2)
double SnowStation::ColdContentSoil |
Cold content of soil (J m-2)
|
static |
Dendricity (1)
|
static |
Volumetric ice content (1), i.e., about 46 kg m-3.
|
static |
The default ratio between height_new_elem and comb_thresh_l, in case comb_thresh_l is not explicitly defined.
|
static |
Grain radius (mm)
|
static |
Sphericity (1)
|
static |
Water content (1)
double SnowStation::cos_sl |
Cosinus of slope angle, initialized once!
double SnowStation::dIntEnergy |
Internal energy change of snowpack (J m-2)
double SnowStation::dIntEnergySoil |
Internal energy change of soil (J m-2)
std::vector<ElementData> SnowStation::Edata |
pointer to element data array (e.g. Te, L, Rho, etc..)
size_t SnowStation::ErosionLevel |
Element where snow erosion stopped previously for the drift index.
double SnowStation::ErosionMass |
Eroded mass either real or virtually (storage if less than one element)
double SnowStation::Ground |
The ground height – meaning the height of the top soil node.
double SnowStation::hn |
Depth of new snow to be used on slopes.
void* SnowStation::Kt |
Pointer to pseudo-conductivity and stiffnes matrix.
double SnowStation::lwc_sum |
Total liquid water in snowpack.
double SnowStation::lwc_sum_soil |
Total liquid water in soil.
double SnowStation::mass_sum |
Total mass summing mass of snow elements.
double SnowStation::meltFreezeEnergy |
Melt freeze part of internal energy change of snowpack (J m-2)
double SnowStation::meltFreezeEnergySoil |
Melt freeze part of internal energy change of soil (J m-2)
mio::StationData SnowStation::meta |
Station meta data.
double SnowStation::mH |
The MEASURED height, including soil depth if SNP_SOIL == 1.
std::vector<NodeData> SnowStation::Ndata |
pointer to nodal data array (e.g. T, z, u, etc..)
|
static |
The model treats that number of solutes.
|
static |
Number of top elements left untouched by the join functions.
double SnowStation::pAlbedo |
Parameterized snow albedo.
double SnowStation::ReSolver_dt |
Last used RE time step in the previous SNOWPACK time step.
double SnowStation::rho_hn |
Density of new snow to be used on slopes.
double SnowStation::rime_hn |
rime of new snow to be used on slopes
double SnowStation::S_4 |
placeholder - currently Minimum structural stability index (SSI)
double SnowStation::S_5 |
placeholder
char SnowStation::S_class1 |
Stability class based on hand hardness, grain class ...
char SnowStation::S_class2 |
Stability class based on hand hardness, grain class ...
double SnowStation::S_d |
Minimum deformation rate stability index.
double SnowStation::S_n |
Minimum natural stability index.
double SnowStation::S_s |
Minimum skier stability index sk38 (Sk38)
SeaIce* SnowStation::Seaice |
Pointer to sea ice class.
size_t SnowStation::sector |
current slope sector of width 360./max(1, nSlopes-1)
double SnowStation::SoilAlb |
Soil albedo.
double SnowStation::SoilEmissivity |
Soil emissivity.
size_t SnowStation::SoilNode |
The top soil node, 0 in case of SNP_SOIL == 0.
double SnowStation::swc_sum_soil |
Total solid water in soil.
double SnowStation::swe |
Total mass summing snow water equivalent of elements.
|
static |
Snow elements with a LWC above this threshold are considered at least to be moist.
|
static |
double SnowStation::TimeCountDeltaHS |
Time counter tracking erroneous settlement in operational mode.
double SnowStation::WindScalingFactor |
Local scaling factor for wind at drift station.
bool SnowStation::windward |
True for windward (luv) slope.
double SnowStation::z_S_4 |
Depth of Minimum S_4.
double SnowStation::z_S_5 |
Depth of Minimum S_5.
double SnowStation::z_S_d |
Depth of Minimum S_d.
double SnowStation::z_S_n |
Depth of Minimum S_n.
double SnowStation::z_S_s |
Depth of Minimum S_s.