HydPy-Snow (base model)¶
The HydPy-Snow (base model) model family supplies methods for modelling snow processes.
Method Features¶
- class hydpy.models.snow.snow_model.Model[source]¶
Bases:
AdHocModelHydPy-Snow (base model).
- The following “run methods” are called in the given sequence during each simulation step:
Calc_PLayer_V1Adjust the precipitation to the altitude for the snow layers according to Valéry (2010).Calc_TLayer_V1Calculate the mean temperature for each snow layer based on methodReturn_T_V1.Calc_TMinLayer_V1Calculate the minimum temperature for each snow layer based on methodReturn_T_V1.Calc_TMaxLayer_V1Calculate the maximum temperature for each snow layer based on methodReturn_T_V1.Calc_SolidFractionPrecipitation_V1Calculate the solid precipitation fraction for each snow layer according to USACE (1956).Calc_SolidFractionPrecipitation_V2Calculate the solid precipitation fraction for each snow layer according to Turcotte et al. (2007) and USACE (1956).Calc_PRainLayer_V1Calculate the liquid part of precipitation (USACE, 1956).Calc_PSnowLayer_V1Calculate the frozen part of precipitation.Update_G_V1Add the snowfall to each layer’s snow pack.Calc_ETG_V1Update the thermal state of each snow layer.Calc_PotMelt_V1Calculate the potential melt for each snow layer.Calc_GRatio_V1Calculate the fraction of the snow-covered area for each snow layer.Update_GRatio_GLocalMax_V1Calculate the fraction of the snow-covered area for each snow layer and updateGLocalMaxbefore calculating the snowmelt.Calc_Melt_V1Calculate the actual snow melt for each layer.Update_G_V2Remove the snowmelt from the snowpack.Update_GRatio_GLocalMax_V2Calculate the fraction of the snow-covered area for each snow layer and updateGLocalMaxafter calculating the snowmelt.Calc_PNetLayer_V1Sum the rainfall and the actual snow melt for each layer.Calc_PNet_V1Calculate the catchment’s average net rainfall.
- The following “additional methods” might be called by one or more of the other methods or are meant to be directly called by the user:
Return_T_V1Return the altitude-adjusted temperature.
- DOCNAME = ('Snow', 'base model')¶
- OBSERVER_METHODS = ()¶
- REUSABLE_METHODS = ()¶
- class hydpy.models.snow.snow_model.Calc_PLayer_V1[source]¶
Bases:
MethodAdjust the precipitation to the altitude for the snow layers according to Valéry (2010).
Basic equations:
\[\begin{split}L_i^* = P \cdot \begin{cases} e^{G\cdot \big(Z_i - \overline{Z}\big)} &|\ Z_i \leq T \\ e^{G\cdot max\big(T- \overline{Z}, \,0\big)} &|\ Z_i > T \end{cases} \\ L_i = L_i^* \cdot \frac{P}{\sum_{i=1}^{N} A_i \cdot L_i^*} \\ \\ L = PLayer \\ G = GradP \\ Z = ZLayers \\ \overline{Z} = ZMean \\ T = ZThreshold \\ N = NLayers \\ A = LayerArea\end{split}\]Examples:
>>> from hydpy.models.snow import * >>> parameterstep() >>> nlayers(5) >>> layerarea(0.2) >>> gradp(0.00041) >>> inputs.p = 10.0
The threshold parameter
ZThresholdis usually fixed to 4000 m:>>> fixed.zthreshold zthreshold(4000.0)
If all layers lie below the threshold, their precipitation values become adjusted by the same equation:
>>> zlayers(2199.0, 2599.0, 2999.0, 3399.0, 3799.0) >>> derived.zmean.update() >>> derived.zmean zmean(2999.0) >>> model.calc_player_v1() >>> fluxes.player player(7.013551, 8.263467, 9.736135, 11.471253, 13.515595)
The total precipitation volume stays intact:
>>> from hydpy import round_ >>> round_(fluxes.player.average_values()) 10.0
Layers above the threshold altitude are only adjusted with respect to the threshold:
>>> zlayers(3199.0, 3599.0, 3999.0, 4399.0, 4799.0) >>> derived.zmean.update() >>> derived.zmean zmean(3999.0) >>> model.calc_player_v1() >>> fluxes.player player(7.881562, 9.28617, 10.941098, 10.945585, 10.945585) >>> round_(fluxes.player.average_values()) 10.0
If the average layer altitude exceeds the threshold, the precipitation values of the upper layers are not directly adjusted. Still,
Calc_PLayer_V1indirectly increases them by decreasing the lower layers’ precipitation and subsequently adjusting all layers’ precipitation sum back to the original volume:>>> zlayers(3201.0, 3601.0, 4001.0, 4401.0, 4801.0) >>> derived.zmean.update() >>> derived.zmean zmean(4001.0) >>> model.calc_player_v1() >>> fluxes.player player(7.882977, 9.287837, 10.943062, 10.943062, 10.943062) >>> round_(fluxes.player.average_values()) 10.0
If all layers lie above the threshold, all get the same (original) precipitation value:
>>> zlayers(4201.0, 4601.0, 5001.0, 5401.0, 5801.0) >>> derived.zmean.update() >>> model.calc_player_v1() >>> fluxes.player player(10.0, 10.0, 10.0, 10.0, 10.0)
The last example demonstrates that the water balance remains intact for layers with different sizes:
>>> zlayers(3201.0, 3601.0, 4001.0, 4401.0, 4801.0) >>> control.layerarea(0.3, 0.2, 0.2, 0.2, 0.1) >>> derived.zmean.update() >>> model.calc_player_v1() >>> fluxes.player player(8.1337, 9.583241, 11.286484, 11.286484, 11.286484) >>> round_(fluxes.player.average_values()) 10.0
- class hydpy.models.snow.snow_model.Return_T_V1[source]¶
Bases:
MethodReturn the altitude-adjusted temperature.
- Required by the methods:
- Requires the control parameter:
- Requires the derived parameters:
- Basic equation:
\(f(t, \, k, \, g) = t + (ZMean - ZLayer_k) \cdot g / 100\)
Examples:
The adjustment depends on the selected layer’s altitude relative to the average altitude and the current-day temperature gradient:
>>> from hydpy.models.snow import * >>> parameterstep() >>> nlayers(2) >>> zlayers(100.0, 500.0) >>> import numpy >>> gradtmean(numpy.linspace(0.5, 1.0, 366)) >>> derived.zmean(300.0) >>> from hydpy import pub, round_ >>> pub.timegrids = "2000-01-01", "2001-01-01", "1d" >>> derived.doy.update()
>>> model.idx_sim = pub.timegrids.init["2000-01-01"] >>> round_(model.return_t_v1(5.0, 0, gradtmean.values)) 6.0 >>> round_(model.return_t_v1(5.0, 1, gradtmean.values)) 4.0
>>> model.idx_sim = pub.timegrids.init["2000-12-31"] >>> round_(model.return_t_v1(5.0, 0, gradtmean.values)) 7.0 >>> round_(model.return_t_v1(5.0, 1, gradtmean.values)) 3.0
- class hydpy.models.snow.snow_model.Calc_TLayer_V1[source]¶
Bases:
MethodCalculate the mean temperature for each snow layer based on method
Return_T_V1.- Basic equation:
\(TLayer_k = f_{Return\_T\_V1}(T, \, k, \, GradTMean)\)
Examples:
>>> from hydpy.models.snow import * >>> parameterstep() >>> nlayers(2) >>> zlayers(100.0, 500.0) >>> import numpy >>> gradtmean(numpy.linspace(0.5, 1.0, 366)) >>> derived.zmean(300.0) >>> from hydpy import pub >>> pub.timegrids = "2000-01-01", "2001-01-01", "1d" >>> derived.doy.update() >>> inputs.t = 5.0
>>> model.idx_sim = 0 >>> model.calc_tlayer_v1() >>> factors.tlayer tlayer(6.0, 4.0)
>>> model.idx_sim = 365 >>> model.calc_tlayer_v1() >>> factors.tlayer tlayer(7.0, 3.0)
- class hydpy.models.snow.snow_model.Calc_TMinLayer_V1[source]¶
Bases:
MethodCalculate the minimum temperature for each snow layer based on method
Return_T_V1.- Basic equation:
\(TMinLayer_k = f_{Return\_T\_V1}(TMin, \, k, \, GradTMin)\)
Examples:
>>> from hydpy.models.snow import * >>> parameterstep() >>> nlayers(2) >>> zlayers(100.0, 500.0) >>> import numpy >>> gradtmin(numpy.linspace(0.5, 1.0, 366)) >>> derived.zmean(300.0) >>> from hydpy import pub >>> pub.timegrids = "2000-01-01", "2001-01-01", "1d" >>> derived.doy.update() >>> inputs.tmin = 5.0
>>> model.idx_sim = 0 >>> model.calc_tminlayer_v1() >>> factors.tminlayer tminlayer(6.0, 4.0)
>>> model.idx_sim = 365 >>> model.calc_tminlayer_v1() >>> factors.tminlayer tminlayer(7.0, 3.0)
- class hydpy.models.snow.snow_model.Calc_TMaxLayer_V1[source]¶
Bases:
MethodCalculate the maximum temperature for each snow layer based on method
Return_T_V1.- Basic equation:
\(TMaxLayer_k = f_{Return\_T\_V1}(TMax, \, k, \, GradTMax)\)
Examples:
>>> from hydpy.models.snow import * >>> parameterstep() >>> nlayers(2) >>> zlayers(100.0, 500.0) >>> import numpy >>> gradtmax(numpy.linspace(0.5, 1.0, 366)) >>> derived.zmean(300.0) >>> from hydpy import pub >>> pub.timegrids = "2000-01-01", "2001-01-01", "1d" >>> derived.doy.update() >>> inputs.tmax = 5.0
>>> model.idx_sim = 0 >>> model.calc_tmaxlayer_v1() >>> factors.tmaxlayer tmaxlayer(6.0, 4.0)
>>> model.idx_sim = 365 >>> model.calc_tmaxlayer_v1() >>> factors.tmaxlayer tmaxlayer(7.0, 3.0)
- class hydpy.models.snow.snow_model.Calc_SolidFractionPrecipitation_V1[source]¶
Bases:
MethodCalculate the solid precipitation fraction for each snow layer according to USACE (1956).
- Requires the control parameter:
- Requires the fixed parameters:
- Requires the factor sequence:
- Calculates the factor sequence:
- Basic equation:
- \[\begin{split}F = min \left( max \left( \frac{R - T}{R - S}, \, 0 \right), \, 1 \right) \\ \\ F = SolidFractionPrecipitation \\ T = TLayer \\ R = TThreshRain \\ S = TThreshSnow\end{split}\]
Example:
>>> from hydpy.models.snow import * >>> parameterstep() >>> nlayers(7) >>> factors.tlayer = -2.0, -1.0, 0.0, 1.0, 2.0, 3.0, 4.0 >>> model.calc_solidfractionprecipitation_v1() >>> factors.solidfractionprecipitation solidfractionprecipitation(1.0, 1.0, 0.75, 0.5, 0.25, 0.0, 0.0)
- class hydpy.models.snow.snow_model.Calc_SolidFractionPrecipitation_V2[source]¶
Bases:
MethodCalculate the solid precipitation fraction for each snow layer according to Turcotte et al. (2007) and USACE (1956).
- Requires the control parameter:
- Requires the derived parameter:
- Requires the fixed parameters:
- Requires the factor sequences:
- Calculates the factor sequence:
- Basic equation:
- \[\begin{split}F = \begin{cases} min \left( max \left( 1 - \frac{X}{X - N}, \, 0 \right), \, 1 \right) &|\ Z < 1500 \\ min \left( max \left( \frac{R - T}{R - S}, \, 0 \right), \, 1 \right) &|\ Z \geq 1500 \end{cases} \\ \\ F = SolidFractionPrecipitation \\ Z = ZMean \\ X = TMaxLayer \\ N = TMinLayer \\ T = TLayer \\ R = TThreshRain \\ S = TThreshSnow\end{split}\]
Examples:
For catchments with an average elevation below 1500 m, the (daily) solid precipitation fraction is determined by the time with an air temperature below 0°C, which is estimated based on
TMaxLayerandTMinLayer:>>> from hydpy.models.snow import * >>> parameterstep() >>> nlayers(7) >>> derived.zmean(1499.0) >>> factors.tminlayer = -2.0, -2.0, -2.0, -2.0, -1.0, 0.0, 1.0 >>> factors.tmaxlayer = -1.0, 0.0, 1.0, 2.0, 2.0, 2.0, 2.0 >>> model.calc_solidfractionprecipitation_v2() >>> factors.solidfractionprecipitation solidfractionprecipitation(1.0, 1.0, 0.666667, 0.5, 0.333333, 0.0, 0.0)
Swapping the minimum and maximum values (which might occur in applications due to input data errors or problematic altitude adjustments) yields the same results:
>>> factors.tminlayer = -1.0, 0.0, 1.0, 2.0, 2.0, 2.0, 2.0 >>> factors.tmaxlayer = -2.0, -2.0, -2.0, -2.0, -1.0, 0.0, 1.0 >>> model.calc_solidfractionprecipitation_v2() >>> factors.solidfractionprecipitation solidfractionprecipitation(1.0, 1.0, 0.666667, 0.5, 0.333333, 0.0, 0.0)
Identical minimum and maximum temperatures also pose no problem:
>>> factors.tminlayer = -3.0, -2.0, -1.0, 0.0, 1.0, 2.0, 3.0 >>> factors.tmaxlayer = -3.0, -2.0, -1.0, 0.0, 1.0, 2.0, 3.0 >>> model.calc_solidfractionprecipitation_v2() >>> factors.solidfractionprecipitation solidfractionprecipitation(1.0, 1.0, 1.0, 0.5, 0.0, 0.0, 0.0)
For higher catchments, the usual linear interpolation approach between a minimum (
TThreshSnow) and a maximum (TThreshRain) temperature threshold applies (as when usingCalc_SolidFractionPrecipitation_V1):>>> factors.tlayer = -2.0, -1.0, 0.0, 1.0, 2.0, 3.0, 4.0 >>> derived.zmean(1500.0) >>> model.calc_solidfractionprecipitation_v2() >>> factors.solidfractionprecipitation solidfractionprecipitation(1.0, 1.0, 0.75, 0.5, 0.25, 0.0, 0.0)
- class hydpy.models.snow.snow_model.Calc_PRainLayer_V1[source]¶
Bases:
MethodCalculate the liquid part of precipitation (USACE, 1956).
- Requires the control parameter:
- Requires the factor sequence:
- Requires the flux sequence:
- Calculates the flux sequence:
- Basic equation:
\(PRainLayer = (1 - SolidFractionPrecipitation) \cdot PLayer\)
Example:
>>> from hydpy.models.snow import * >>> parameterstep() >>> nlayers(2) >>> fluxes.player = 0.0, 4.0 >>> factors.solidfractionprecipitation = 0.25 >>> model.calc_prainlayer() >>> fluxes.prainlayer prainlayer(0.0, 3.0)
- class hydpy.models.snow.snow_model.Calc_PSnowLayer_V1[source]¶
Bases:
MethodCalculate the frozen part of precipitation.
- Requires the control parameter:
- Requires the factor sequence:
- Requires the flux sequence:
- Calculates the flux sequence:
- Basic equation:
\(PSnowLayer = SolidFractionPrecipitation \cdot PLayer\)
Example:
>>> from hydpy.models.snow import * >>> parameterstep() >>> nlayers(2) >>> fluxes.player = 0.0, 4.0 >>> factors.solidfractionprecipitation = 0.25 >>> model.calc_psnowlayer() >>> fluxes.psnowlayer psnowlayer(0.0, 1.0)
- class hydpy.models.snow.snow_model.Update_G_V1[source]¶
Bases:
MethodAdd the snowfall to each layer’s snow pack.
- Requires the control parameter:
- Requires the flux sequence:
- Updates the state sequence:
- Basic equation:
\(G_{new} = G_{old} + PSnowLayer\)
Examples:
>>> from hydpy.models.snow import * >>> from hydpy import pub >>> parameterstep() >>> nlayers(3) >>> fluxes.psnowlayer = 0.0, 1.0, 1.0 >>> states.g = 1.0, 1.0, 0.0 >>> model.update_g_v1() >>> states.g g(1.0, 2.0, 1.0)
- class hydpy.models.snow.snow_model.Calc_ETG_V1[source]¶
Bases:
MethodUpdate the thermal state of each snow layer.
- Basic equation:
- \[\begin{split}E_{new} = min(C \cdot E_{old} + (1 - C) \cdot T, \, 0) \\ \\ E = ETG \\ C = CN1 \\ T = TLayer\end{split}\]
Example:
>>> from hydpy.models.snow import * >>> parameterstep() >>> nlayers(3) >>> cn1(0.75) >>> factors.tlayer = 1.0, 0.0, -1.0 >>> states.etg = -1.0, 0.0, 1.0 >>> model.calc_etg_v1() >>> states.etg etg(-0.5, 0.0, 0.0)
- class hydpy.models.snow.snow_model.Calc_PotMelt_V1[source]¶
Bases:
MethodCalculate the potential melt for each snow layer.
- Basic equation:
- \[\begin{split}P = \begin{cases} min \big(G, \, C \cdot max(T, \, 0) \big) &|\ E = 0 \\ 0 &|\ E < 0 \end{cases} \\ \\ P = PotMelt \\ E = ETG \\ C = CN2 \\ T = TLayer\end{split}\]
Example:
Calc_PotMelt_V1extends the classical day degree with a restriction that prevents any melting as long as the snowpack’s thermal state is below 0°C:>>> from hydpy.models.snow import * >>> from hydpy import pub >>> simulationstep("1d") >>> parameterstep("12h") >>> nlayers(5) >>> cn2(1.0) >>> factors.tlayer = 1.0, -1.0, 1.0, 1.0, 1.0 >>> states.g = 1.0, 1.0, 1.0, 2.0, 3.0 >>> states.etg = -1.0, 0.0, 0.0, 0.0, 0.0 >>> model.calc_potmelt_v1() >>> fluxes.potmelt potmelt(0.0, 0.0, 1.0, 2.0, 2.0)
- class hydpy.models.snow.snow_model.Calc_GRatio_V1[source]¶
Bases:
MethodCalculate the fraction of the snow-covered area for each snow layer.
- Basic equation:
\(GRatio = min(G / GThresh, \, 1)\)
Example:
We set
CN4, used to deriveGThresh, to 0.9, which corresponds to the configuration of the original CemaNeige model:>>> from hydpy.models.snow import * >>> parameterstep() >>> nlayers(4) >>> cn4(0.9) >>> meanansolidprecip(100.0, 100.0, 100.0, 200.0) >>> derived.gthresh.update() >>> derived.gthresh gthresh(90.0, 90.0, 90.0, 180.0) >>> states.g = 67.5, 90.0, 90.1, 90.0 >>> model.calc_gratio_v1() >>> states.gratio gratio(0.75, 1.0, 1.0, 0.5)
- class hydpy.models.snow.snow_model.Update_GRatio_GLocalMax_V1[source]¶
Bases:
MethodCalculate the fraction of the snow-covered area for each snow layer and update
GLocalMaxbefore calculating the snowmelt.- Basic equations:
- \[\begin{split}L_{new} = min(G, \, L_{old}) \\ R = min(G / L_{new}, \, 1.0) \\ \\ L = GLocalMax \\ R = GRatio\end{split}\]
Examples:
>>> from hydpy.models.snow import * >>> parameterstep() >>> nlayers(5) >>> meanansolidprecip(80.0) >>> cn4(0.9) >>> derived.gthresh.update() >>> derived.gthresh gthresh(72.0) >>> states.g = 30.0, 20.0, 12.0, 80.0, 50.0 >>> states.gratio = 0.0, 0.2, 1.0, 1.0, 1.0 >>> fluxes.potmelt = 10.0, 10.0, 10.0, 0.0, 0.0 >>> logs.glocalmax = 40.0, 30.0, 20.0, 10.0, 0.0 >>> hysteresis(True) >>> model.update_gratio_glocalmax_v1() >>> states.gratio gratio(0.75, 0.666667, 1.0, 1.0, 1.0) >>> logs.glocalmax glocalmax(40.0, 30.0, 12.0, 10.0, 72.0)
If we switch off hysteresis,
GRatiowill dependent solely onGThreshandGLocalMaxis always set to zero:>>> hysteresis(False) >>> model.update_gratio_glocalmax_v1() >>> states.gratio gratio(0.416667, 0.277778, 0.166667, 1.0, 0.694444) >>> logs.glocalmax glocalmax(0.0, 0.0, 0.0, 0.0, 0.0)
- class hydpy.models.snow.snow_model.Calc_Melt_V1[source]¶
Bases:
MethodCalculate the actual snow melt for each layer.
- Basic equation:
- \[\begin{split}M = P \cdot ((1 - N) \cdot R + N) \\ \\ M = Melt \\ P = PotMelt \\ N = MinMelt \\ R = GRatio\end{split}\]
Examples:
>>> from hydpy.models.snow import * >>> parameterstep() >>> nlayers(5) >>> fluxes.potmelt = 0.0, 0.5, 1.0, 1.5, 2.0 >>> states.gratio = 0.0, 0.25, 0.5, 0.75, 1.0 >>> states.g = 0.0, 0.5, 1.0, 1.5, 2.0 >>> model.calc_melt_v1() >>> fluxes.melt melt(0.0, 0.1625, 0.55, 1.1625, 2.0)
In the original formulation of the CemaNeige model, the basic equation typically results in an exponential decrease in snow cover because
PotMeltnever exceedsGandGRatioconverges to zero during snow cover depletion. To provide an opportunity to avoid infinitely thin snow layers in summer, we introduced the fixed parameterMinG, which defines the amount of snow below whichMeltequalsPotMelt:>>> fixed.ming(1.0) >>> model.calc_melt_v1() >>> fluxes.melt melt(0.0, 0.5, 0.55, 1.1625, 2.0)
- class hydpy.models.snow.snow_model.Update_G_V2[source]¶
Bases:
MethodRemove the snowmelt from the snowpack.
- Basic equation:
\(G_{new} = G_{old} - Melt\)
Example:
>>> from hydpy.models.snow import * >>> parameterstep() >>> nlayers(4) >>> fluxes.melt = 0.0, 0.2, 0.2, 0.2 >>> states.g = 0.0, 0.2, 0.4, 0.6 >>> model.update_g_v2() >>> states.g g(0.0, 0.0, 0.2, 0.4)
- class hydpy.models.snow.snow_model.Update_GRatio_GLocalMax_V2[source]¶
Bases:
MethodCalculate the fraction of the snow-covered area for each snow layer and update
GLocalMaxafter calculating the snowmelt.- Requires the control parameters:
- Requires the derived parameter:
- Requires the flux sequences:
- Requires the state sequence:
- Updates the state sequence:
- Updates the log sequence:
Basic equation:
\[\begin{split}R_{new}= \begin{cases} min \left( R_{old} + \Delta / C, \, 1 \right) &|\ \Delta > 0 \\ min \left( G / L, \, 1 \right) &|\ \Delta < 0 \end{cases} \\ \\ R = GRatio \\ \Delta = PSnowLayer - Melt \\ C = CN3 \\ L = GLocalMax\end{split}\]Examples:
>>> from hydpy.models.snow import * >>> parameterstep() >>> nlayers(5) >>> cn3(3.0) >>> cn4(0.2) >>> meanansolidprecip(100.0) >>> derived.gthresh.update() >>> fluxes.psnowlayer = 0.0, 1.0, 2.0, 3.0, 4.0 >>> fluxes.melt = 0.0, 0.0, 3.0, 2.0, 2.0 >>> states.g = 10.0, 20.0, 30.0, 40.0, 50.0 >>> states.gratio = 0.1, 0.5, 0.8, 0.2, 0.4 >>> logs.glocalmax = 10.0
If
Hysteresisis deactivated,Update_GRatio_GLocalMax_V2has no effect:>>> hysteresis(False) >>> model.update_gratio_glocalmax_v2() >>> states.gratio gratio(0.1, 0.5, 0.8, 0.2, 0.4) >>> logs.glocalmax glocalmax(10.0, 10.0, 10.0, 10.0, 10.0)
After activating
Hysteresis,Update_GRatio_GLocalMax_V2updatesGRatioandGLocalMaxdifferently depending on whether the snowpack is increasing or decreasing:>>> hysteresis(True) >>> model.update_gratio_glocalmax_v2() >>> states.gratio gratio(0.1, 0.833333, 1.0, 0.533333, 1.0) >>> logs.glocalmax glocalmax(10.0, 10.0, 10.0, 10.0, 20.0)
- class hydpy.models.snow.snow_model.Calc_PNetLayer_V1[source]¶
Bases:
MethodSum the rainfall and the actual snow melt for each layer.
- Requires the control parameter:
- Requires the flux sequences:
- Calculates the flux sequence:
- Basic equation:
\(PNetLayer = PRainLayer + Melt\)
Example:
>>> from hydpy.models.snow import * >>> parameterstep() >>> nlayers(2) >>> fluxes.prainlayer = 1.0, 2.0 >>> fluxes.melt = 3.0, 4.0 >>> model.calc_pnetlayer_v1() >>> fluxes.pnetlayer pnetlayer(4.0, 6.0)
- class hydpy.models.snow.snow_model.Calc_PNet_V1[source]¶
Bases:
MethodCalculate the catchment’s average net rainfall.
- Basic equation:
\(PNet = \sum_{i=1}^{NLayers} LayerArea_i \cdot PRainLayer_i\)
Example:
>>> from hydpy.models.snow import * >>> parameterstep() >>> nlayers(2) >>> layerarea(0.2, 0.8) >>> fluxes.pnetlayer = 2.0, 1.0 >>> model.calc_pnet_v1() >>> fluxes.pnet pnet(1.2) >>> from hydpy import round_ >>> round_(fluxes.pnetlayer.average_values()) 1.2
- class hydpy.models.snow.snow_model.BaseModel[source]¶
Bases:
AdHocModelBase model for CemaNeige-like layered models.
- prepare_layers(*, hypsodata: Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]) None[source]¶
Set the control parameters
LayerAreaandZLayersbased on hypsometric data.Method
prepare_layers()requires the percentiles of the catchment’s elevation distribution in meters, prefixed by the minimum and suffixed by the maximum elevation, which makes exactly 101 data points:>>> from hydpy.models.snow_cn import * >>> parameterstep() >>> model.prepare_layers(hypsodata=[0.0]) Traceback (most recent call last): ... ValueError: Method `prepare_layers` requires a vector of 101 hypsometric data points but 1 value is given.
If 100 is a multiple of the number of layers,
prepare_layers()can select the correct data directly:>>> nlayers(5) >>> hypsodata = [ ... 286.0, 309.0, 320.0, 327.0, 333.0, 338.0, 342.0, 347.0, 351.0, 356.0, ... 360.0, 365.0, 369.0, 373.0, 378.0, 382.0, 387.0, 393.0, 399.0, 405.0, ... 411.0, 417.0, 423.0, 428.0, 434.0, 439.0, 443.0, 448.0, 453.0, 458.0, ... 463.0, 469.0, 474.0, 480.0, 485.0, 491.0, 496.0, 501.0, 507.0, 513.0, ... 519.0, 524.0, 530.0, 536.0, 542.0, 548.0, 554.0, 560.0, 566.0, 571.0, ... 577.0, 583.0, 590.0, 596.0, 603.0, 609.0, 615.0, 622.0, 629.0, 636.0, ... 642.0, 649.0, 656.0, 663.0, 669.0, 677.0, 684.0, 691.0, 698.0, 706.0, ... 714.0, 722.0, 730.0, 738.0, 746.0, 754.0, 762.0, 770.0, 777.0, 786.0, ... 797.0, 808.0, 819.0, 829.0, 841.0, 852.0, 863.0, 875.0, 887.0, 901.0, ... 916.0, 934.0, 952.0, 972.0, 994.0, 1012.0, 1029.0, 10540.0, 10800.0, ... 11250.0, 12780.0 ... ] >>> model.prepare_layers(hypsodata=hypsodata) >>> layerarea layerarea(0.2) >>> zlayers zlayers(360.0, 463.0, 577.0, 714.0, 916.0)
Otherwise, it still selects some of the given values and thereby needs to trick a little, which results in some deviations from the original elevation distribution:
>>> nlayers(7) >>> model.prepare_layers(hypsodata=hypsodata) >>> layerarea layerarea(0.142857) >>> zlayers zlayers(347.0, 423.0, 501.0, 583.0, 677.0, 786.0, 972.0)
>>> nlayers(70) >>> model.prepare_layers(hypsodata=hypsodata) >>> layerarea layerarea(0.014286) >>> zlayers zlayers(286.0, 320.0, 333.0, 342.0, 351.0, 360.0, 369.0, 378.0, 387.0, 399.0, 411.0, 423.0, 434.0, 443.0, 453.0, 463.0, 474.0, 485.0, 496.0, 507.0, 519.0, 530.0, 542.0, 554.0, 566.0, 577.0, 590.0, 603.0, 615.0, 629.0, 642.0, 649.0, 656.0, 663.0, 669.0, 677.0, 684.0, 691.0, 698.0, 706.0, 714.0, 722.0, 730.0, 738.0, 746.0, 754.0, 762.0, 770.0, 777.0, 786.0, 797.0, 808.0, 819.0, 829.0, 841.0, 852.0, 863.0, 875.0, 887.0, 901.0, 916.0, 934.0, 952.0, 972.0, 994.0, 1012.0, 1029.0, 10540.0, 10800.0, 11250.0)
Due to this selection mechanism (without interpolation), the highest number of supported layers is 100:
>>> nlayers(100) >>> model.prepare_layers(hypsodata=hypsodata) >>> layerarea layerarea(0.01) >>> assert zlayers == hypsodata[:-1]
>>> nlayers(101) >>> model.prepare_layers(hypsodata=hypsodata) Traceback (most recent call last): ... ValueError: Method `prepare_layers` works for at most 100 layers, but the value of parameter `nlayers` of element `?` is set to 101.
- REUSABLE_METHODS = ()¶
Parameter Features¶
Parameter tools¶
- class hydpy.models.snow.snow_parameters.Parameter1DLayers(subvars: SubParameters)[source]¶
Bases:
ParameterBase class for parameters with different values for individual layers.
The following example shows that the shape of parameter
MeanAnSolidPrecipis set automatically, and that weighted averaging is possible:>>> from hydpy.models.snow import * >>> parameterstep() >>> nlayers(4) >>> layerarea(0.1, 0.2, 0.3, 0.4) >>> meanansolidprecip(3.0, 1.0, 4.0, 2.0) >>> from hydpy import round_ >>> round_(meanansolidprecip.average_values()) 2.5
- NDIM = 1¶
- property refweights: Parameter¶
Alias for the associated instance of
LayerAreafor calculating aggregated values for layer-specific parameters.
- name = 'parameter1dlayers'¶
Name of the variable in lowercase letters.
- unit = '?'¶
Unit of the variable.
Control parameters¶
- class hydpy.models.snow.ControlParameters(master: Parameters, cls_fastaccess: type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
SubParametersControl parameters of model snow.
- The following classes are selected:
NLayers()Number of snow layers [-].ZLayers()Height of each snow layer [m].LayerArea()Area of snow layer as a percentage of total area [-].GradP()Altitude gradient of precipitation [1/m].GradTMean()Altitude gradient of daily mean air temperature for each day of the year [°C/100m].GradTMin()Altitude gradient of daily minimum air temperature for each day of the year [°C/100m].GradTMax()Altitude gradient of daily maximum air temperature for each day of the year [°C/100m].MeanAnSolidPrecip()Mean annual solid precipitation [mm/a].CN1()Temporal weighting coefficient for the snow pack’s thermal state [-].CN2()Degree-day melt coefficient [mm/°C/T].CN3()Accumulation threshold [mm].CN4()Fraction of annual snowfall defining the melt threshold [-].Hysteresis()Flag that indicates whether hysteresis of build-up and melting of the snow cover should be considered [-].
- class hydpy.models.snow.snow_control.NLayers(subvars: SubParameters)[source]¶
Bases:
NmbParameterNumber of snow layers [-].
- Required by the methods:
Calc_ETG_V1Calc_GRatio_V1Calc_Melt_V1Calc_PLayer_V1Calc_PNetLayer_V1Calc_PNet_V1Calc_PRainLayer_V1Calc_PSnowLayer_V1Calc_PotMelt_V1Calc_SolidFractionPrecipitation_V1Calc_SolidFractionPrecipitation_V2Calc_TLayer_V1Calc_TMaxLayer_V1Calc_TMinLayer_V1Update_GRatio_GLocalMax_V1Update_GRatio_GLocalMax_V2Update_G_V1Update_G_V2
- NDIM = 0¶
- TIME = None¶
- SPAN = (1, None)¶
- name = 'nlayers'¶
Name of the variable in lowercase letters.
- unit = '-'¶
Unit of the variable.
- class hydpy.models.snow.snow_control.ZLayers(subvars: SubParameters)[source]¶
Bases:
Parameter1DLayersHeight of each snow layer [m].
- Required by the methods:
Calc_PLayer_V1Calc_TLayer_V1Calc_TMaxLayer_V1Calc_TMinLayer_V1Return_T_V1
You can use method
prepare_layers()to determine the values ofZLayersbased on the catchment’s elevation distribution.- TIME = None¶
- SPAN = (None, None)¶
- name = 'zlayers'¶
Name of the variable in lowercase letters.
- unit = 'm'¶
Unit of the variable.
- class hydpy.models.snow.snow_control.LayerArea(subvars: SubParameters)[source]¶
Bases:
Parameter1DLayersArea of snow layer as a percentage of total area [-].
- Required by the methods:
Calling method
prepare_layers()to determine the values of parameterZLayersalso sets all entries of parameterLayerAreato the same average value.- TIME = None¶
- SPAN = (0.0, 1.0)¶
- name = 'layerarea'¶
Name of the variable in lowercase letters.
- unit = '-'¶
Unit of the variable.
- class hydpy.models.snow.snow_control.GradP(subvars: SubParameters)[source]¶
Bases:
ParameterAltitude gradient of precipitation [1/m].
- Required by the method:
- NDIM = 0¶
- TIME = None¶
- SPAN = (None, None)¶
- INIT = 0.00041¶
- name = 'gradp'¶
Name of the variable in lowercase letters.
- unit = '1/m'¶
Unit of the variable.
- class hydpy.models.snow.snow_control.GradTMean(subvars: SubParameters)[source]¶
Bases:
Parameter1D366Altitude gradient of daily mean air temperature for each day of the year [°C/100m].
- Required by the method:
- NDIM = 1¶
- TIME = None¶
- SPAN = (0.0, None)¶
- name = 'gradtmean'¶
Name of the variable in lowercase letters.
- unit = '°C/100m'¶
Unit of the variable.
- class hydpy.models.snow.snow_control.GradTMin(subvars: SubParameters)[source]¶
Bases:
Parameter1D366Altitude gradient of daily minimum air temperature for each day of the year [°C/100m].
- Required by the method:
- NDIM = 1¶
- TIME = None¶
- SPAN = (0.0, None)¶
- name = 'gradtmin'¶
Name of the variable in lowercase letters.
- unit = '°C/100m'¶
Unit of the variable.
- class hydpy.models.snow.snow_control.GradTMax(subvars: SubParameters)[source]¶
Bases:
Parameter1D366Altitude gradient of daily maximum air temperature for each day of the year [°C/100m].
- Required by the method:
- NDIM = 1¶
- TIME = None¶
- SPAN = (0.0, None)¶
- name = 'gradtmax'¶
Name of the variable in lowercase letters.
- unit = '°C/100m'¶
Unit of the variable.
- class hydpy.models.snow.snow_control.MeanAnSolidPrecip(subvars: SubParameters)[source]¶
Bases:
Parameter1DLayersMean annual solid precipitation [mm/a].
- TIME = None¶
- SPAN = (0.0, None)¶
- name = 'meanansolidprecip'¶
Name of the variable in lowercase letters.
- unit = 'mm/a'¶
Unit of the variable.
- class hydpy.models.snow.snow_control.CN1(subvars: SubParameters)[source]¶
Bases:
ParameterTemporal weighting coefficient for the snow pack’s thermal state [-].
- Required by the method:
- NDIM = 0¶
- TIME = None¶
- SPAN = (0.0, 1.0)¶
- name = 'cn1'¶
Name of the variable in lowercase letters.
- unit = '-'¶
Unit of the variable.
- class hydpy.models.snow.snow_control.CN2(subvars: SubParameters)[source]¶
Bases:
ParameterDegree-day melt coefficient [mm/°C/T].
- Required by the method:
- NDIM = 0¶
- TIME = True¶
- SPAN = (0.0, None)¶
- name = 'cn2'¶
Name of the variable in lowercase letters.
- unit = 'mm/°C/T'¶
Unit of the variable.
- class hydpy.models.snow.snow_control.CN3(subvars: SubParameters)[source]¶
Bases:
ParameterAccumulation threshold [mm].
- Required by the method:
- NDIM = 0¶
- TIME = None¶
- SPAN = (0.0, None)¶
- name = 'cn3'¶
Name of the variable in lowercase letters.
- unit = 'mm'¶
Unit of the variable.
- class hydpy.models.snow.snow_control.CN4(subvars: SubParameters)[source]¶
Bases:
ParameterFraction of annual snowfall defining the melt threshold [-].
- NDIM = 0¶
- TIME = None¶
- SPAN = (0.0, 1.0)¶
- name = 'cn4'¶
Name of the variable in lowercase letters.
- unit = '-'¶
Unit of the variable.
- class hydpy.models.snow.snow_control.Hysteresis(subvars: SubParameters)[source]¶
Bases:
ParameterFlag that indicates whether hysteresis of build-up and melting of the snow cover should be considered [-].
- Required by the methods:
- NDIM = 0¶
- TIME = None¶
- SPAN = (False, True)¶
- INIT = False¶
- name = 'hysteresis'¶
Name of the variable in lowercase letters.
- unit = '-'¶
Unit of the variable.
Derived parameters¶
- class hydpy.models.snow.DerivedParameters(master: Parameters, cls_fastaccess: type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
SubParametersDerived parameters of model snow.
- class hydpy.models.snow.snow_derived.DOY(subvars: SubParameters)[source]¶
Bases:
DOYParameterReferences the “global” month of the year index array [-].
- Required by the methods:
Calc_TLayer_V1Calc_TMaxLayer_V1Calc_TMinLayer_V1Return_T_V1
- name = 'doy'¶
Name of the variable in lowercase letters.
- unit = '-'¶
Unit of the variable.
- class hydpy.models.snow.snow_derived.GThresh(subvars: SubParameters)[source]¶
Bases:
Parameter1DLayersAccumulation threshold [mm].
- Required by the methods:
Calc_GRatio_V1Update_GRatio_GLocalMax_V1Update_GRatio_GLocalMax_V2
- TIME = None¶
- SPAN = (0.0, None)¶
- update()[source]¶
Update
GThreshbased on \(GThresh = MeanAnSolidPrecip / CN4\) [-].>>> from hydpy.models.snow import * >>> parameterstep() >>> nlayers(5) >>> meanansolidprecip(700.0, 750.0, 730.0, 630.0, 700.0) >>> cn4(0.6) >>> derived.gthresh.update() >>> derived.gthresh gthresh(420.0, 450.0, 438.0, 378.0, 420.0)
- name = 'gthresh'¶
Name of the variable in lowercase letters.
- unit = 'mm'¶
Unit of the variable.
- class hydpy.models.snow.snow_derived.ZMean(subvars: SubParameters)[source]¶
Bases:
ParameterMean elevation of all layer [m].
- Required by the methods:
Calc_PLayer_V1Calc_SolidFractionPrecipitation_V2Calc_TLayer_V1Calc_TMaxLayer_V1Calc_TMinLayer_V1Return_T_V1
- NDIM = 0¶
- TIME = None¶
- SPAN = (None, None)¶
- update()[source]¶
Update
ZMeanby averagingZLayers(weighted withLayerArea).>>> from hydpy.models.snow import * >>> parameterstep() >>> nlayers(5) >>> zlayers(700.0, 750.0, 730.0, 630.0, 700.0) >>> layerarea(0.1, 0.3, 0.2, 0.2, 0.2) >>> derived.zmean.update() >>> derived.zmean zmean(707.0)
- name = 'zmean'¶
Name of the variable in lowercase letters.
- unit = 'm'¶
Unit of the variable.
Fixed parameters¶
- class hydpy.models.snow.FixedParameters(master: Parameters, cls_fastaccess: type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
SubParametersFixed parameters of model snow.
- The following classes are selected:
ZThreshold()Altitude threshold for constant precipitation [m].MinMelt()Minimum ratio of actual to potential melt [-].TThreshSnow()Temperature below which all precipitation falls as snow [°C].TThreshRain()Temperature above which all precipitation falls as rain [°C].MinG()Amount of snow below which actual melt can be equal to potential melt [mm].
- class hydpy.models.snow.snow_fixed.ZThreshold(subvars: SubParameters)[source]¶
Bases:
FixedParameterAltitude threshold for constant precipitation [m].
- Required by the method:
- NDIM = 0¶
- TIME = None¶
- SPAN = (None, None)¶
- INIT = 4000.0¶
- name = 'zthreshold'¶
Name of the variable in lowercase letters.
- unit = 'm'¶
Unit of the variable.
- class hydpy.models.snow.snow_fixed.MinMelt(subvars: SubParameters)[source]¶
Bases:
FixedParameterMinimum ratio of actual to potential melt [-].
- Required by the method:
- NDIM = 0¶
- TIME = None¶
- SPAN = (0.0, 1.0)¶
- INIT = 0.1¶
- name = 'minmelt'¶
Name of the variable in lowercase letters.
- unit = '-'¶
Unit of the variable.
- class hydpy.models.snow.snow_fixed.TThreshSnow(subvars: SubParameters)[source]¶
Bases:
FixedParameterTemperature below which all precipitation falls as snow [°C].
- Required by the methods:
Calc_SolidFractionPrecipitation_V1Calc_SolidFractionPrecipitation_V2
- NDIM = 0¶
- TIME = None¶
- SPAN = (None, None)¶
- INIT = -1.0¶
- name = 'tthreshsnow'¶
Name of the variable in lowercase letters.
- unit = '°C'¶
Unit of the variable.
- class hydpy.models.snow.snow_fixed.TThreshRain(subvars: SubParameters)[source]¶
Bases:
FixedParameterTemperature above which all precipitation falls as rain [°C].
- Required by the methods:
Calc_SolidFractionPrecipitation_V1Calc_SolidFractionPrecipitation_V2
- NDIM = 0¶
- TIME = None¶
- SPAN = (None, None)¶
- INIT = 3.0¶
- name = 'tthreshrain'¶
Name of the variable in lowercase letters.
- unit = '°C'¶
Unit of the variable.
- class hydpy.models.snow.snow_fixed.MinG(subvars: SubParameters)[source]¶
Bases:
FixedParameterAmount of snow below which actual melt can be equal to potential melt [mm].
- Required by the method:
- NDIM = 0¶
- TIME = None¶
- SPAN = (None, None)¶
- INIT = 0.0¶
- name = 'ming'¶
Name of the variable in lowercase letters.
- unit = 'mm'¶
Unit of the variable.
Sequence Features¶
Sequence tools¶
- class hydpy.models.snow.snow_sequences.Sequence1DNLayers(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
ModelSequenceBase class for sequences with different values for individual layers.
- property refweights: Parameter¶
Alias for the associated instance of
LayerAreafor calculating aggregated values for layer-specific flux sequences.
- name = 'sequence1dnlayers'¶
Name of the variable in lowercase letters.
- unit = '?'¶
Unit of the variable.
- class hydpy.models.snow.snow_sequences.Factor1DNLayers(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
Sequence1DNLayers,FactorSequenceBase class for factor sequences with different values for individual layers.
The following example shows that the shape of sequence
TLayeris set automatically, and that weighted averaging is possible:>>> from hydpy.models.snow import * >>> parameterstep() >>> nlayers(4) >>> layerarea(0.1, 0.2, 0.3, 0.4) >>> factors.tlayer(3.0, 1.0, 4.0, 2.0) >>> from hydpy import round_ >>> round_(factors.tlayer.average_values()) 2.5
- NDIM = 1¶
- NUMERIC = False¶
- name = 'factor1dnlayers'¶
Name of the variable in lowercase letters.
- unit = '?'¶
Unit of the variable.
- class hydpy.models.snow.snow_sequences.Flux1DNLayers(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
Sequence1DNLayers,FluxSequenceBase class for flux sequences with different values for individual layers.
The following example shows that the shape of sequence
PLayeris set automatically, and that weighted averaging is possible:>>> from hydpy.models.snow import * >>> parameterstep() >>> nlayers(4) >>> layerarea(0.1, 0.2, 0.3, 0.4) >>> fluxes.player(3.0, 1.0, 4.0, 2.0) >>> from hydpy import round_ >>> round_(fluxes.player.average_values()) 2.5
- NDIM = 1¶
- NUMERIC = False¶
- name = 'flux1dnlayers'¶
Name of the variable in lowercase letters.
- unit = '?'¶
Unit of the variable.
- class hydpy.models.snow.snow_sequences.State1DNLayers(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
Sequence1DNLayers,StateSequenceBase class for state sequences with different values for individual layers.
The following example shows that the shape of sequence
Gis set automatically, and that weighted averaging is possible:>>> from hydpy.models.snow import * >>> parameterstep() >>> nlayers(4) >>> layerarea(0.1, 0.2, 0.3, 0.4) >>> states.g(3.0, 1.0, 4.0, 2.0) >>> from hydpy import round_ >>> round_(states.g.average_values()) 2.5
- NDIM = 1¶
- NUMERIC = False¶
- name = 'state1dnlayers'¶
Name of the variable in lowercase letters.
- unit = '?'¶
Unit of the variable.
- class hydpy.models.snow.snow_sequences.Log1DNLayers(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
Sequence1DNLayers,LogSequenceBase class for log sequences with different values for individual layers.
The following example shows that the shape of sequence
GLocalMaxis set automatically, and that weighted averaging is possible:>>> from hydpy.models.snow import * >>> parameterstep() >>> nlayers(4) >>> layerarea(0.1, 0.2, 0.3, 0.4) >>> logs.glocalmax(3.0, 1.0, 4.0, 2.0) >>> from hydpy import round_ >>> round_(logs.glocalmax.average_values()) 2.5
- NDIM = 1¶
- NUMERIC = False¶
- name = 'log1dnlayers'¶
Name of the variable in lowercase letters.
- unit = '?'¶
Unit of the variable.
Input sequences¶
- class hydpy.models.snow.InputSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
InputSequencesInput sequences of model snow.
- class hydpy.models.snow.snow_inputs.P(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
InputSequencePrecipitation [mm/T].
- Required by the method:
- NDIM = 0¶
- NUMERIC = False¶
- STANDARD_NAME = 'precipitation'¶
- name = 'p'¶
Name of the variable in lowercase letters.
- unit = 'mm/T'¶
Unit of the variable.
- class hydpy.models.snow.snow_inputs.T(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
InputSequenceMean air temperature [°C].
- Required by the method:
- NDIM = 0¶
- NUMERIC = False¶
- STANDARD_NAME = 'air_temperature'¶
- name = 't'¶
Name of the variable in lowercase letters.
- unit = '°C'¶
Unit of the variable.
- class hydpy.models.snow.snow_inputs.TMin(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
InputSequenceMinimum air temperature [°C].
- Required by the method:
- NDIM = 0¶
- NUMERIC = False¶
- STANDARD_NAME = 'minimum_air_temperature'¶
- name = 'tmin'¶
Name of the variable in lowercase letters.
- unit = '°C'¶
Unit of the variable.
- class hydpy.models.snow.snow_inputs.TMax(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
InputSequenceMaximum air temperature [°C].
- Required by the method:
- NDIM = 0¶
- NUMERIC = False¶
- STANDARD_NAME = 'maximum_air_temperature'¶
- name = 'tmax'¶
Name of the variable in lowercase letters.
- unit = '°C'¶
Unit of the variable.
Factor sequences¶
- class hydpy.models.snow.FactorSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
FactorSequencesFactor sequences of model snow.
- The following classes are selected:
TLayer()Mean air temperature of each snow layer [°C].TMinLayer()Minimum air temperature of each snow layer [°C].TMaxLayer()Maximum air temperature of each snow layer [°C].SolidFractionPrecipitation()Solid fraction of precipitation of each snow layer [-].
- class hydpy.models.snow.snow_factors.TLayer(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
Factor1DNLayersMean air temperature of each snow layer [°C].
- Calculated by the method:
- Required by the methods:
Calc_ETG_V1Calc_PotMelt_V1Calc_SolidFractionPrecipitation_V1Calc_SolidFractionPrecipitation_V2
- name = 'tlayer'¶
Name of the variable in lowercase letters.
- unit = '°C'¶
Unit of the variable.
- class hydpy.models.snow.snow_factors.TMinLayer(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
Factor1DNLayersMinimum air temperature of each snow layer [°C].
- Calculated by the method:
- Required by the method:
- name = 'tminlayer'¶
Name of the variable in lowercase letters.
- unit = '°C'¶
Unit of the variable.
- class hydpy.models.snow.snow_factors.TMaxLayer(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
Factor1DNLayersMaximum air temperature of each snow layer [°C].
- Calculated by the method:
- Required by the method:
- name = 'tmaxlayer'¶
Name of the variable in lowercase letters.
- unit = '°C'¶
Unit of the variable.
- class hydpy.models.snow.snow_factors.SolidFractionPrecipitation(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
Factor1DNLayersSolid fraction of precipitation of each snow layer [-].
- Calculated by the methods:
Calc_SolidFractionPrecipitation_V1Calc_SolidFractionPrecipitation_V2- Required by the methods:
- SPAN = (0.0, 1.0)¶
- name = 'solidfractionprecipitation'¶
Name of the variable in lowercase letters.
- unit = '-'¶
Unit of the variable.
Flux sequences¶
- class hydpy.models.snow.FluxSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
FluxSequencesFlux sequences of model snow.
- The following classes are selected:
PLayer()Precipitation of each snow layer [mm/T].PSnowLayer()Snowfall of each snow layer [mm/T].PRainLayer()Rainfall of each snow layer [mm/T].PotMelt()Potential snow melt of each snow layer [mm/T].Melt()Actual snow melt of each snow layer [mm/T].PNetLayer()Net precipitation of each snow layer [mm/T].PNet()Net precipitation of the complete catchment [mm/T].
- class hydpy.models.snow.snow_fluxes.PLayer(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
Flux1DNLayersPrecipitation of each snow layer [mm/T].
- Calculated by the method:
- Required by the methods:
- name = 'player'¶
Name of the variable in lowercase letters.
- unit = 'mm/T'¶
Unit of the variable.
- class hydpy.models.snow.snow_fluxes.PSnowLayer(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
Flux1DNLayersSnowfall of each snow layer [mm/T].
- Calculated by the method:
- Required by the methods:
- name = 'psnowlayer'¶
Name of the variable in lowercase letters.
- unit = 'mm/T'¶
Unit of the variable.
- class hydpy.models.snow.snow_fluxes.PRainLayer(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
Flux1DNLayersRainfall of each snow layer [mm/T].
- Calculated by the method:
- Required by the method:
- name = 'prainlayer'¶
Name of the variable in lowercase letters.
- unit = 'mm/T'¶
Unit of the variable.
- class hydpy.models.snow.snow_fluxes.PotMelt(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
Flux1DNLayersPotential snow melt of each snow layer [mm/T].
- Calculated by the method:
- Required by the methods:
- name = 'potmelt'¶
Name of the variable in lowercase letters.
- unit = 'mm/T'¶
Unit of the variable.
- class hydpy.models.snow.snow_fluxes.Melt(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
Flux1DNLayersActual snow melt of each snow layer [mm/T].
- Calculated by the method:
- Required by the methods:
- name = 'melt'¶
Name of the variable in lowercase letters.
- unit = 'mm/T'¶
Unit of the variable.
- class hydpy.models.snow.snow_fluxes.PNetLayer(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
Flux1DNLayersNet precipitation of each snow layer [mm/T].
- Calculated by the method:
- Required by the method:
- name = 'pnetlayer'¶
Name of the variable in lowercase letters.
- unit = 'mm/T'¶
Unit of the variable.
- class hydpy.models.snow.snow_fluxes.PNet(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
FluxSequenceNet precipitation of the complete catchment [mm/T].
- Calculated by the method:
- NDIM = 0¶
- NUMERIC = False¶
- name = 'pnet'¶
Name of the variable in lowercase letters.
- unit = 'mm/T'¶
Unit of the variable.
State sequences¶
- class hydpy.models.snow.StateSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
StateSequencesState sequences of model snow.
- class hydpy.models.snow.snow_states.G(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
State1DNLayersSnow pack [mm].
- Updated by the methods:
- Required by the methods:
Calc_GRatio_V1Calc_Melt_V1Calc_PotMelt_V1Update_GRatio_GLocalMax_V1Update_GRatio_GLocalMax_V2
- SPAN = (0.0, None)¶
- name = 'g'¶
Name of the variable in lowercase letters.
- unit = 'mm'¶
Unit of the variable.
- class hydpy.models.snow.snow_states.ETG(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
State1DNLayersThermal state of the snow pack [°C].
- Updated by the method:
- Required by the method:
- SPAN = (None, 0.0)¶
- name = 'etg'¶
Name of the variable in lowercase letters.
- unit = '°C'¶
Unit of the variable.
- class hydpy.models.snow.snow_states.GRatio(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]¶
Bases:
State1DNLayersRatio of the snow-covered area [-].
- Updated by the methods:
Calc_GRatio_V1Update_GRatio_GLocalMax_V1Update_GRatio_GLocalMax_V2- Required by the method:
- SPAN = (0.0, 1.0)¶
- name = 'gratio'¶
Name of the variable in lowercase letters.
- unit = '-'¶
Unit of the variable.
Log sequences¶
- class hydpy.models.snow.LogSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
LogSequencesLog sequences of model snow.
- The following classes are selected:
GLocalMax()Local melt threshold [mm].
- class hydpy.models.snow.snow_logs.GLocalMax(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
Log1DNLayersLocal melt threshold [mm].
- Updated by the methods:
- name = 'glocalmax'¶
Name of the variable in lowercase letters.
- unit = 'mm'¶
Unit of the variable.
- class hydpy.models.snow.ControlParameters(master: Parameters, cls_fastaccess: type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
SubParametersControl parameters of model snow.
- The following classes are selected:
NLayers()Number of snow layers [-].ZLayers()Height of each snow layer [m].LayerArea()Area of snow layer as a percentage of total area [-].GradP()Altitude gradient of precipitation [1/m].GradTMean()Altitude gradient of daily mean air temperature for each day of the year [°C/100m].GradTMin()Altitude gradient of daily minimum air temperature for each day of the year [°C/100m].GradTMax()Altitude gradient of daily maximum air temperature for each day of the year [°C/100m].MeanAnSolidPrecip()Mean annual solid precipitation [mm/a].CN1()Temporal weighting coefficient for the snow pack’s thermal state [-].CN2()Degree-day melt coefficient [mm/°C/T].CN3()Accumulation threshold [mm].CN4()Fraction of annual snowfall defining the melt threshold [-].Hysteresis()Flag that indicates whether hysteresis of build-up and melting of the snow cover should be considered [-].
- class hydpy.models.snow.DerivedParameters(master: Parameters, cls_fastaccess: type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
SubParametersDerived parameters of model snow.
- class hydpy.models.snow.FactorSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
FactorSequencesFactor sequences of model snow.
- The following classes are selected:
TLayer()Mean air temperature of each snow layer [°C].TMinLayer()Minimum air temperature of each snow layer [°C].TMaxLayer()Maximum air temperature of each snow layer [°C].SolidFractionPrecipitation()Solid fraction of precipitation of each snow layer [-].
- class hydpy.models.snow.FixedParameters(master: Parameters, cls_fastaccess: type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
SubParametersFixed parameters of model snow.
- The following classes are selected:
ZThreshold()Altitude threshold for constant precipitation [m].MinMelt()Minimum ratio of actual to potential melt [-].TThreshSnow()Temperature below which all precipitation falls as snow [°C].TThreshRain()Temperature above which all precipitation falls as rain [°C].MinG()Amount of snow below which actual melt can be equal to potential melt [mm].
- class hydpy.models.snow.FluxSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
FluxSequencesFlux sequences of model snow.
- The following classes are selected:
PLayer()Precipitation of each snow layer [mm/T].PSnowLayer()Snowfall of each snow layer [mm/T].PRainLayer()Rainfall of each snow layer [mm/T].PotMelt()Potential snow melt of each snow layer [mm/T].Melt()Actual snow melt of each snow layer [mm/T].PNetLayer()Net precipitation of each snow layer [mm/T].PNet()Net precipitation of the complete catchment [mm/T].
- class hydpy.models.snow.InputSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
InputSequencesInput sequences of model snow.
- class hydpy.models.snow.LogSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
LogSequencesLog sequences of model snow.
- The following classes are selected:
GLocalMax()Local melt threshold [mm].
- class hydpy.models.snow.StateSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
StateSequencesState sequences of model snow.