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: AdHocModel

HydPy-Snow (base model).

The following “run methods” are called in the given sequence during each simulation step:
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_V1 Return the altitude-adjusted temperature.

DOCNAME = ('Snow', 'base model')
OBSERVER_METHODS = ()
REUSABLE_METHODS = ()
class hydpy.models.snow.snow_model.Calc_PLayer_V1[source]

Bases: Method

Adjust the precipitation to the altitude for the snow layers according to Valéry (2010).

Requires the control parameters:

NLayers ZLayers LayerArea GradP

Requires the derived parameter:

ZMean

Requires the fixed parameter:

ZThreshold

Requires the input sequence:

P

Calculates the flux sequence:

PLayer

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 ZThreshold is 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_V1 indirectly 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: Method

Return the altitude-adjusted temperature.

Required by the methods:

Calc_TLayer_V1 Calc_TMaxLayer_V1 Calc_TMinLayer_V1

Requires the control parameter:

ZLayers

Requires the derived parameters:

DOY ZMean

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: Method

Calculate the mean temperature for each snow layer based on method Return_T_V1.

Required submethod:

Return_T_V1

Requires the control parameters:

NLayers ZLayers GradTMean

Requires the derived parameters:

DOY ZMean

Requires the input sequence:

T

Calculates the factor sequence:

TLayer

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: Method

Calculate the minimum temperature for each snow layer based on method Return_T_V1.

Required submethod:

Return_T_V1

Requires the control parameters:

NLayers ZLayers GradTMin

Requires the derived parameters:

DOY ZMean

Requires the input sequence:

TMin

Calculates the factor sequence:

TMinLayer

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: Method

Calculate the maximum temperature for each snow layer based on method Return_T_V1.

Required submethod:

Return_T_V1

Requires the control parameters:

NLayers ZLayers GradTMax

Requires the derived parameters:

DOY ZMean

Requires the input sequence:

TMax

Calculates the factor sequence:

TMaxLayer

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: Method

Calculate the solid precipitation fraction for each snow layer according to USACE (1956).

Requires the control parameter:

NLayers

Requires the fixed parameters:

TThreshSnow TThreshRain

Requires the factor sequence:

TLayer

Calculates the factor sequence:

SolidFractionPrecipitation

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: Method

Calculate the solid precipitation fraction for each snow layer according to Turcotte et al. (2007) and USACE (1956).

Requires the control parameter:

NLayers

Requires the derived parameter:

ZMean

Requires the fixed parameters:

TThreshSnow TThreshRain

Requires the factor sequences:

TLayer TMinLayer TMaxLayer

Calculates the factor sequence:

SolidFractionPrecipitation

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 TMaxLayer and TMinLayer:

>>> 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 using Calc_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: Method

Calculate the liquid part of precipitation (USACE, 1956).

Requires the control parameter:

NLayers

Requires the factor sequence:

SolidFractionPrecipitation

Requires the flux sequence:

PLayer

Calculates the flux sequence:

PRainLayer

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: Method

Calculate the frozen part of precipitation.

Requires the control parameter:

NLayers

Requires the factor sequence:

SolidFractionPrecipitation

Requires the flux sequence:

PLayer

Calculates the flux sequence:

PSnowLayer

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: Method

Add the snowfall to each layer’s snow pack.

Requires the control parameter:

NLayers

Requires the flux sequence:

PSnowLayer

Updates the state sequence:

G

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: Method

Update the thermal state of each snow layer.

Requires the control parameters:

NLayers CN1

Requires the factor sequence:

TLayer

Updates the state sequence:

ETG

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: Method

Calculate the potential melt for each snow layer.

Requires the control parameters:

NLayers CN2

Requires the factor sequence:

TLayer

Requires the state sequences:

ETG G

Calculates the flux sequence:

PotMelt

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_V1 extends 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: Method

Calculate the fraction of the snow-covered area for each snow layer.

Requires the control parameter:

NLayers

Requires the derived parameter:

GThresh

Requires the state sequence:

G

Updates the state sequence:

GRatio

Basic equation:

\(GRatio = min(G / GThresh, \, 1)\)

Example:

We set CN4, used to derive GThresh, 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: Method

Calculate the fraction of the snow-covered area for each snow layer and update GLocalMax before calculating the snowmelt.

Requires the control parameters:

NLayers Hysteresis

Requires the derived parameter:

GThresh

Requires the flux sequence:

PotMelt

Requires the state sequence:

G

Updates the state sequence:

GRatio

Updates the log sequence:

GLocalMax

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, GRatio will dependent solely on GThresh and GLocalMax is 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: Method

Calculate the actual snow melt for each layer.

Requires the control parameter:

NLayers

Requires the fixed parameters:

MinMelt MinG

Requires the flux sequence:

PotMelt

Requires the state sequences:

GRatio G

Calculates the flux sequence:

Melt

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 PotMelt never exceeds G and GRatio converges to zero during snow cover depletion. To provide an opportunity to avoid infinitely thin snow layers in summer, we introduced the fixed parameter MinG, which defines the amount of snow below which Melt equals PotMelt:

>>> 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: Method

Remove the snowmelt from the snowpack.

Requires the control parameter:

NLayers

Requires the flux sequence:

Melt

Updates the state sequence:

G

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: Method

Calculate the fraction of the snow-covered area for each snow layer and update GLocalMax after calculating the snowmelt.

Requires the control parameters:

NLayers Hysteresis CN3

Requires the derived parameter:

GThresh

Requires the flux sequences:

Melt PSnowLayer

Requires the state sequence:

G

Updates the state sequence:

GRatio

Updates the log sequence:

GLocalMax

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 Hysteresis is deactivated, Update_GRatio_GLocalMax_V2 has 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_V2 updates GRatio and GLocalMax differently 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: Method

Sum the rainfall and the actual snow melt for each layer.

Requires the control parameter:

NLayers

Requires the flux sequences:

PRainLayer Melt

Calculates the flux sequence:

PNetLayer

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: Method

Calculate the catchment’s average net rainfall.

Requires the control parameters:

NLayers LayerArea

Requires the flux sequence:

PNetLayer

Calculates the flux sequence:

PNet

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: AdHocModel

Base model for CemaNeige-like layered models.

prepare_layers(*, hypsodata: Sequence[float] | ndarray[tuple[Any, ...], dtype[float64]]) None[source]

Set the control parameters LayerArea and ZLayers based 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: Parameter

Base class for parameters with different values for individual layers.

The following example shows that the shape of parameter MeanAnSolidPrecip is 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
TYPE

alias of float

property refweights: Parameter

Alias for the associated instance of LayerArea for calculating aggregated values for layer-specific parameters.

name = 'parameter1dlayers'

Name of the variable in lowercase letters.

unit = '?'

Unit of the variable.

class hydpy.models.snow.snow_parameters.Parameter1D366(subvars: SubParameters)[source]

Bases: Parameter

Base class for parameters with 366 values (days of the year).

name = 'parameter1d366'

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: SubParameters

Control 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: NmbParameter

Number of snow layers [-].

Required by the methods:

Calc_ETG_V1 Calc_GRatio_V1 Calc_Melt_V1 Calc_PLayer_V1 Calc_PNetLayer_V1 Calc_PNet_V1 Calc_PRainLayer_V1 Calc_PSnowLayer_V1 Calc_PotMelt_V1 Calc_SolidFractionPrecipitation_V1 Calc_SolidFractionPrecipitation_V2 Calc_TLayer_V1 Calc_TMaxLayer_V1 Calc_TMinLayer_V1 Update_GRatio_GLocalMax_V1 Update_GRatio_GLocalMax_V2 Update_G_V1 Update_G_V2

NDIM = 0
TYPE

alias of int

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: Parameter1DLayers

Height of each snow layer [m].

You can use method prepare_layers() to determine the values of ZLayers based 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: Parameter1DLayers

Area of snow layer as a percentage of total area [-].

Required by the methods:

Calc_PLayer_V1 Calc_PNet_V1

Calling method prepare_layers() to determine the values of parameter ZLayers also sets all entries of parameter LayerArea to 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: Parameter

Altitude gradient of precipitation [1/m].

Required by the method:

Calc_PLayer_V1

NDIM = 0
TYPE

alias of float

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: Parameter1D366

Altitude gradient of daily mean air temperature for each day of the year [°C/100m].

Required by the method:

Calc_TLayer_V1

NDIM = 1
TYPE

alias of float

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: Parameter1D366

Altitude gradient of daily minimum air temperature for each day of the year [°C/100m].

Required by the method:

Calc_TMinLayer_V1

NDIM = 1
TYPE

alias of float

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: Parameter1D366

Altitude gradient of daily maximum air temperature for each day of the year [°C/100m].

Required by the method:

Calc_TMaxLayer_V1

NDIM = 1
TYPE

alias of float

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: Parameter1DLayers

Mean 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: Parameter

Temporal weighting coefficient for the snow pack’s thermal state [-].

Required by the method:

Calc_ETG_V1

NDIM = 0
TYPE

alias of float

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: Parameter

Degree-day melt coefficient [mm/°C/T].

Required by the method:

Calc_PotMelt_V1

NDIM = 0
TYPE

alias of float

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: Parameter

Accumulation threshold [mm].

Required by the method:

Update_GRatio_GLocalMax_V2

NDIM = 0
TYPE

alias of float

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: Parameter

Fraction of annual snowfall defining the melt threshold [-].

NDIM = 0
TYPE

alias of float

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: Parameter

Flag that indicates whether hysteresis of build-up and melting of the snow cover should be considered [-].

NDIM = 0
TYPE

alias of bool

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: SubParameters

Derived parameters of model snow.

The following classes are selected:
  • DOY() References the “global” month of the year index array [-].

  • GThresh() Accumulation threshold [mm].

  • ZMean() Mean elevation of all layer [m].

class hydpy.models.snow.snow_derived.DOY(subvars: SubParameters)[source]

Bases: DOYParameter

References the “global” month of the year index array [-].

Required by the methods:

Calc_TLayer_V1 Calc_TMaxLayer_V1 Calc_TMinLayer_V1 Return_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: Parameter1DLayers

Accumulation threshold [mm].

Required by the methods:

Calc_GRatio_V1 Update_GRatio_GLocalMax_V1 Update_GRatio_GLocalMax_V2

TIME = None
SPAN = (0.0, None)
update()[source]

Update GThresh based 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: Parameter

Mean elevation of all layer [m].

Required by the methods:

Calc_PLayer_V1 Calc_SolidFractionPrecipitation_V2 Calc_TLayer_V1 Calc_TMaxLayer_V1 Calc_TMinLayer_V1 Return_T_V1

NDIM = 0
TYPE

alias of float

TIME = None
SPAN = (None, None)
update()[source]

Update ZMean by averaging ZLayers (weighted with LayerArea).

>>> 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: SubParameters

Fixed 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: FixedParameter

Altitude threshold for constant precipitation [m].

Required by the method:

Calc_PLayer_V1

NDIM = 0
TYPE

alias of float

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: FixedParameter

Minimum ratio of actual to potential melt [-].

Required by the method:

Calc_Melt_V1

NDIM = 0
TYPE

alias of float

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: FixedParameter

Temperature below which all precipitation falls as snow [°C].

Required by the methods:

Calc_SolidFractionPrecipitation_V1 Calc_SolidFractionPrecipitation_V2

NDIM = 0
TYPE

alias of float

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: FixedParameter

Temperature above which all precipitation falls as rain [°C].

Required by the methods:

Calc_SolidFractionPrecipitation_V1 Calc_SolidFractionPrecipitation_V2

NDIM = 0
TYPE

alias of float

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: FixedParameter

Amount of snow below which actual melt can be equal to potential melt [mm].

Required by the method:

Calc_Melt_V1

NDIM = 0
TYPE

alias of float

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: ModelSequence

Base class for sequences with different values for individual layers.

property refweights: Parameter

Alias for the associated instance of LayerArea for 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, FactorSequence

Base class for factor sequences with different values for individual layers.

The following example shows that the shape of sequence TLayer is 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, FluxSequence

Base class for flux sequences with different values for individual layers.

The following example shows that the shape of sequence PLayer is 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, StateSequence

Base class for state sequences with different values for individual layers.

The following example shows that the shape of sequence G is 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, LogSequence

Base class for log sequences with different values for individual layers.

The following example shows that the shape of sequence GLocalMax is 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: InputSequences

Input sequences of model snow.

The following classes are selected:
  • P() Precipitation [mm/T].

  • T() Mean air temperature [°C].

  • TMin() Minimum air temperature [°C].

  • TMax() Maximum air temperature [°C].

class hydpy.models.snow.snow_inputs.P(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]

Bases: InputSequence

Precipitation [mm/T].

Required by the method:

Calc_PLayer_V1

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: InputSequence

Mean air temperature [°C].

Required by the method:

Calc_TLayer_V1

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: InputSequence

Minimum air temperature [°C].

Required by the method:

Calc_TMinLayer_V1

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: InputSequence

Maximum air temperature [°C].

Required by the method:

Calc_TMaxLayer_V1

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: FactorSequences

Factor sequences of model snow.

The following classes are selected:
class hydpy.models.snow.snow_factors.TLayer(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]

Bases: Factor1DNLayers

Mean air temperature of each snow layer [°C].

Calculated by the method:

Calc_TLayer_V1

Required by the methods:

Calc_ETG_V1 Calc_PotMelt_V1 Calc_SolidFractionPrecipitation_V1 Calc_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: Factor1DNLayers

Minimum air temperature of each snow layer [°C].

Calculated by the method:

Calc_TMinLayer_V1

Required by the method:

Calc_SolidFractionPrecipitation_V2

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: Factor1DNLayers

Maximum air temperature of each snow layer [°C].

Calculated by the method:

Calc_TMaxLayer_V1

Required by the method:

Calc_SolidFractionPrecipitation_V2

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: Factor1DNLayers

Solid fraction of precipitation of each snow layer [-].

Calculated by the methods:

Calc_SolidFractionPrecipitation_V1 Calc_SolidFractionPrecipitation_V2

Required by the methods:

Calc_PRainLayer_V1 Calc_PSnowLayer_V1

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: FluxSequences

Flux 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: Flux1DNLayers

Precipitation of each snow layer [mm/T].

Calculated by the method:

Calc_PLayer_V1

Required by the methods:

Calc_PRainLayer_V1 Calc_PSnowLayer_V1

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: Flux1DNLayers

Snowfall of each snow layer [mm/T].

Calculated by the method:

Calc_PSnowLayer_V1

Required by the methods:

Update_GRatio_GLocalMax_V2 Update_G_V1

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: Flux1DNLayers

Rainfall of each snow layer [mm/T].

Calculated by the method:

Calc_PRainLayer_V1

Required by the method:

Calc_PNetLayer_V1

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: Flux1DNLayers

Potential snow melt of each snow layer [mm/T].

Calculated by the method:

Calc_PotMelt_V1

Required by the methods:

Calc_Melt_V1 Update_GRatio_GLocalMax_V1

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: Flux1DNLayers

Actual snow melt of each snow layer [mm/T].

Calculated by the method:

Calc_Melt_V1

Required by the methods:

Calc_PNetLayer_V1 Update_GRatio_GLocalMax_V2 Update_G_V2

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: Flux1DNLayers

Net precipitation of each snow layer [mm/T].

Calculated by the method:

Calc_PNetLayer_V1

Required by the method:

Calc_PNet_V1

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: FluxSequence

Net precipitation of the complete catchment [mm/T].

Calculated by the method:

Calc_PNet_V1

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: StateSequences

State sequences of model snow.

The following classes are selected:
  • G() Snow pack [mm].

  • ETG() Thermal state of the snow pack [°C].

  • GRatio() Ratio of the snow-covered area [-].

class hydpy.models.snow.snow_states.G(subvars: ModelIOSequences[ModelIOSequence, FastAccessIOSequence])[source]

Bases: State1DNLayers

Snow pack [mm].

Updated by the methods:

Update_G_V1 Update_G_V2

Required by the methods:

Calc_GRatio_V1 Calc_Melt_V1 Calc_PotMelt_V1 Update_GRatio_GLocalMax_V1 Update_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: State1DNLayers

Thermal state of the snow pack [°C].

Updated by the method:

Calc_ETG_V1

Required by the method:

Calc_PotMelt_V1

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: State1DNLayers

Ratio of the snow-covered area [-].

Updated by the methods:

Calc_GRatio_V1 Update_GRatio_GLocalMax_V1 Update_GRatio_GLocalMax_V2

Required by the method:

Calc_Melt_V1

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: LogSequences

Log sequences of model snow.

The following classes are selected:
class hydpy.models.snow.snow_logs.GLocalMax(subvars: ModelSequences[ModelSequence, FastAccess])[source]

Bases: Log1DNLayers

Local melt threshold [mm].

Updated by the methods:

Update_GRatio_GLocalMax_V1 Update_GRatio_GLocalMax_V2

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: SubParameters

Control 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: SubParameters

Derived parameters of model snow.

The following classes are selected:
  • DOY() References the “global” month of the year index array [-].

  • GThresh() Accumulation threshold [mm].

  • ZMean() Mean elevation of all layer [m].

class hydpy.models.snow.FactorSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)

Bases: FactorSequences

Factor sequences of model snow.

The following classes are selected:
class hydpy.models.snow.FixedParameters(master: Parameters, cls_fastaccess: type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)

Bases: SubParameters

Fixed 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: FluxSequences

Flux 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: InputSequences

Input sequences of model snow.

The following classes are selected:
  • P() Precipitation [mm/T].

  • T() Mean air temperature [°C].

  • TMin() Minimum air temperature [°C].

  • TMax() Maximum air temperature [°C].

class hydpy.models.snow.LogSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)

Bases: LogSequences

Log sequences of model snow.

The following classes are selected:
class hydpy.models.snow.StateSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)

Bases: StateSequences

State sequences of model snow.

The following classes are selected:
  • G() Snow pack [mm].

  • ETG() Thermal state of the snow pack [°C].

  • GRatio() Ratio of the snow-covered area [-].