HydPy-G (base model)¶
gland
is the core of the HydPy implementation of the frequently applied Génie
Rurale models, of which GR4J (Perrin et al., 2007) is probably the most known one.
Method Features¶
- class hydpy.models.gland.gland_model.Model[source]¶
Bases:
AdHocModel
HydPy-G (base model).
- The following “inlet update methods” are called in the given sequence at the beginning of each simulation step:
Calc_E_V1
Let a submodel that conforms to thePETModel_V1
interface calculate the potential evapotranspiration.
- The following “run methods” are called in the given sequence during each simulation step:
Calc_EI_V1
Calculate the actual evaporation from the interception store.Calc_PN_V1
Calculate the net precipitation by considering all interception losses.Calc_EN_V1
Calculate the net evapotranspiration capacity by considering interception evaporation.Update_I_V1
Update the interception store based on precipitation, net precipitation, and interception evaporation.Calc_PS_V1
Calculate the part of net precipitation filling the production store.Calc_ES_V1
Calculate the actual evapotranspiration from the production store.Update_S_V1
Update the production store by adding precipitation and evapotranspiration.Calc_Perc_V1
Calculate the percolation from the production store.Update_S_V2
Update the production store by subtracting percolation.Calc_AE_V1
Calculate the total actual evapotranspiration.Calc_Pr_V1
Calculate the total inflow into the runoff concentration module.Calc_PR1_PR9_V1
SplitPR
intoPR1
andPR9
.Calc_Q9_V1
TransformPR9
intoQ9
.Calc_Q1_V1
TransformPR1
intoQ1
.Calc_Q10_V1
TransformPR
intoQ10
.Calc_Q1_Q9_V2
CalculateQ1
andQ9
by splittingQ10
.Calc_FR_V1
Calculate the groundwater exchange affecting the routing store according to GR4.Calc_FR_V2
Calculate the groundwater exchange affecting the routing store according to GR5 and GR6.Update_R_V1
Update the level of the non-linear routing store by adding its inflows according to GR4 and GR5.Update_R_V3
Update the non-linear routing store by subtracting its outflow.Update_R_V2
Update the level of the non-linear routing store by adding its inflows according to GR6.Calc_QR_V1
Calculate the outflow of the routing store.Update_R_V3
Update the non-linear routing store by subtracting its outflow.Calc_FR2_V1
Calculate the groundwater exchange affecting the exponential routing store.Update_R2_V1
Update the exponential routing store by adding its inflows.Calc_QR2_R2_V1
Calculate the outflow of the exponential routing store and update its content.Update_R_V2
Update the level of the non-linear routing store by adding its inflows according to GR6.Calc_FD_V1
Calculate the groundwater exchange affecting the direct runoff.Calc_QD_V1
Calculate the direct runoff.Calc_QH_V1
Calculate the total runoff according to GR4 and GR5.Calc_QH_V2
Calculate the total runoff according to GR6.Calc_QV_V1
Calculate total discharge in m³/s.
- The following “outlet update methods” are called in the given sequence at the end of each simulation step:
Pass_Q_V1
Update the outlet link sequence.
- 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:
Calc_E_PETModel_V1
Let a submodel that conforms to thePETModel_V1
interface calculate the potential evapotranspiration.Calc_Q_RConcModel_V1
Let a submodel that follows theRConcModel_V1
submodel interface perform runoff concentration.
- Users can hook submodels into the defined main model if they satisfy one of the following interfaces:
PETModel_V1
Simple interface for calculating all potential evapotranspiration values in one step.RConcModel_V1
Simple interface for calculating runoff concentration processes.
- petmodel¶
Required submodel that complies with the following interface: PETModel_V1.
- petmodel_is_mainmodel¶
- petmodel_typeid¶
- rconcmodel¶
Required submodel that complies with the following interface: RConcModel_V1.
- rconcmodel_is_mainmodel¶
- rconcmodel_typeid¶
- rconcmodel_directflow¶
Required submodel that complies with the following interface: RConcModel_V1.
- rconcmodel_directflow_is_mainmodel¶
- rconcmodel_directflow_typeid¶
- rconcmodel_routingstore¶
Required submodel that complies with the following interface: RConcModel_V1.
- rconcmodel_routingstore_is_mainmodel¶
- rconcmodel_routingstore_typeid¶
- REUSABLE_METHODS: ClassVar[tuple[type[ReusableMethod], ...]] = ()¶
- class hydpy.models.gland.gland_model.Calc_E_PETModel_V1[source]¶
Bases:
Method
Let a submodel that conforms to the
PETModel_V1
interface calculate the potential evapotranspiration.Example:
We use
evap_ret_tw2002
as an example:>>> from hydpy.models.gland_gr4 import * >>> parameterstep() >>> from hydpy import prepare_model >>> area(50.0) >>> with model.add_petmodel_v1("evap_ret_tw2002"): ... hrualtitude(200.0) ... coastfactor(0.6) ... evapotranspirationfactor(1.1) ... with model.add_radiationmodel_v2("meteo_glob_io"): ... inputs.globalradiation = 200.0 ... with model.add_tempmodel_v2("meteo_temp_io"): ... temperatureaddend(1.0) ... inputs.temperature = 14.0 >>> model.calc_e_v1() >>> fluxes.e e(3.07171)
- class hydpy.models.gland.gland_model.Calc_E_V1[source]¶
Bases:
Method
Let a submodel that conforms to the
PETModel_V1
interface calculate the potential evapotranspiration.- Required submethod:
- Calculates the flux sequence:
- class hydpy.models.gland.gland_model.Calc_EI_V1[source]¶
Bases:
Method
Calculate the actual evaporation from the interception store.
- Requires the input sequence:
- Requires the flux sequence:
- Requires the state sequence:
- Calculates the flux sequence:
Basic equation:
\(EI = min(E, \, I + P)\)
Examples:
>>> from hydpy.models.gland import * >>> parameterstep()
>>> inputs.p = 1.0 >>> fluxes.e = 0.5 >>> states.i = 0.0 >>> model.calc_ei_v1() >>> fluxes.ei ei(0.5)
>>> inputs.p = 0.5 >>> fluxes.e = 1.0 >>> states.i = 0.2 >>> model.calc_ei_v1() >>> fluxes.ei ei(0.7)
- class hydpy.models.gland.gland_model.Calc_PN_V1[source]¶
Bases:
Method
Calculate the net precipitation by considering all interception losses.
- Requires the control parameter:
- Requires the input sequence:
- Requires the flux sequence:
- Requires the state sequence:
- Calculates the flux sequence:
Basic equation:
\(PN = max(P - (IMax - I) - EI, \, 0)\)
- Examples:
>>> from hydpy.models.gland import * >>> parameterstep() >>> control.imax(10.0) >>> inputs.p = 1.0 >>> states.i = 5.0 >>> fluxes.ei = 2.0 >>> model.calc_pn_v1() >>> fluxes.pn pn(0.0)
>>> inputs.p = 8.0 >>> model.calc_pn_v1() >>> fluxes.pn pn(1.0)
- class hydpy.models.gland.gland_model.Calc_EN_V1[source]¶
Bases:
Method
Calculate the net evapotranspiration capacity by considering interception evaporation.
Basic equation:
\(EN = max(E - EI, \, 0.0)\)
Examples:
>>> from hydpy.models.gland import * >>> parameterstep()
>>> fluxes.e = 1.0 >>> fluxes.ei = 2.0 >>> model.calc_en_v1() >>> fluxes.en en(0.0)
>>> fluxes.e = 3.0 >>> model.calc_en_v1() >>> fluxes.en en(1.0)
- class hydpy.models.gland.gland_model.Update_I_V1[source]¶
Bases:
Method
Update the interception store based on precipitation, net precipitation, and interception evaporation.
Basic equation:
\(I_{new} = I_{old} + P - PN - EI\)
Example:
>>> from hydpy.models.gland import * >>> parameterstep("1d") >>> states.i = 10.0 >>> inputs.p = 5.0 >>> fluxes.ei = 4.0 >>> fluxes.pn = 3.0 >>> model.update_i_v1() >>> states.i i(8.0)
- class hydpy.models.gland.gland_model.Calc_PS_V1[source]¶
Bases:
Method
Calculate the part of net precipitation filling the production store.
- Requires the control parameter:
- Requires the flux sequence:
- Requires the state sequence:
- Calculates the flux sequence:
Basic equation:
\(PS = \frac{ X1 \cdot \left( 1 - \left( \frac{S}{X1} \right)^2 \right) \cdot tanh \left( \frac{PN}{X1} \right)} {1 + \frac{S}{X1} \cdot tanh \left( \frac{PN}{X1} \right)}\)
Examples:
If the production store is full, no more precipitation can enter it:
>>> from hydpy.models.gland import * >>> from hydpy import pub >>> parameterstep() >>> x1(300.0) >>> states.s = 300.0 >>> fluxes.pn = 50.0 >>> model.calc_ps_v1() >>> fluxes.ps ps(0.0)
If the production store is empty, nearly all net precipitation enters it:
>>> states.s = 0.0 >>> model.calc_ps_v1() >>> fluxes.ps ps(49.542124)
If net precipitation is zero, there can be no inflow into the production store:
>>> fluxes.pn = 0.0 >>> model.calc_ps_v1() >>> fluxes.ps ps(0.0)
- class hydpy.models.gland.gland_model.Calc_ES_V1[source]¶
Bases:
Method
Calculate the actual evapotranspiration from the production store.
- Requires the control parameter:
- Requires the flux sequence:
- Requires the state sequence:
- Calculates the flux sequence:
Basic equation:
\[\begin{split}Es = \frac{S \cdot (2 - r) \cdot t}{1 + (1 - r) \cdot t} \\ t = tanh \left( EN / X1 \right) \\ r = S / X1\end{split}\]Examples:
If the production store is nearly full, actual and potential evapotranspiration are almost equal:
>>> from hydpy.models.gland import * >>> parameterstep() >>> x1(300.0) >>> states.s = 270.0 >>> fluxes.en = 2.0 >>> model.calc_es_v1() >>> fluxes.es es(1.978652)
If the production store is nearly empty, actual evapotranspiration is almost zero:
>>> states.s = 10.0 >>> model.calc_es_v1() >>> fluxes.es es(0.13027)
- class hydpy.models.gland.gland_model.Update_S_V1[source]¶
Bases:
Method
Update the production store by adding precipitation and evapotranspiration.
Basic equation:
\(S_{new} = S_{old} + PS - ES\)
Examples:
>>> from hydpy.models.gland import * >>> parameterstep() >>> x1(300.0) >>> fluxes.ps = 10.0 >>> fluxes.es = 3.0 >>> states.s = 270.0 >>> model.update_s_v1() >>> states.s s(277.0)
- class hydpy.models.gland.gland_model.Calc_Perc_V1[source]¶
Bases:
Method
Calculate the percolation from the production store.
- Requires the control parameter:
- Requires the derived parameter:
- Updates the state sequence:
- Calculates the flux sequence:
Basic equation:
\(Perc = S \cdot \left( 1 - \left(1 + \left(\frac{S}{Beta \cdot X1} \right)^4 \right)^{-1/4} \right)\)
Examples:
>>> from hydpy.models.gland import * >>> simulationstep("1d") >>> parameterstep() >>> derived.beta.update()
>>> x1(300.0) >>> states.s = 268.0 >>> model.calc_perc_v1() >>> fluxes.perc perc(1.639555)
>>> states.s = 50.0 >>> model.calc_perc_v1() >>> fluxes.perc perc(0.000376)
- class hydpy.models.gland.gland_model.Update_S_V2[source]¶
Bases:
Method
Update the production store by subtracting percolation.
Basic equation:
\(S_{new} = S_{old} - Perc\)
Examples:
>>> from hydpy.models.gland import * >>> parameterstep() >>> fluxes.perc = 2.0 >>> states.s = 20.0 >>> model.update_s_v2() >>> states.s s(18.0)
- class hydpy.models.gland.gland_model.Calc_AE_V1[source]¶
Bases:
Method
Calculate the total actual evapotranspiration.
Basic equation:
\(AE = EI + ES\)
Examples:
>>> from hydpy.models.gland import * >>> parameterstep() >>> fluxes.ei = 2.0 >>> fluxes.es = 1.0 >>> model.calc_ae_v1() >>> fluxes.ae ae(3.0)
- class hydpy.models.gland.gland_model.Calc_Pr_V1[source]¶
Bases:
Method
Calculate the total inflow into the runoff concentration module.
Basic equation:
\(PR = Perc + (PN - PS)\)
Example:
>>> from hydpy.models.gland import * >>> parameterstep() >>> fluxes.perc = 1.0 >>> fluxes.pn = 5.0 >>> fluxes.ps = 2.0 >>> model.calc_pr_v1() >>> fluxes.pr pr(4.0)
- class hydpy.models.gland.gland_model.Calc_PR1_PR9_V1[source]¶
Bases:
Method
Basic equations:
\(PR9 = 0.9 \cdot PR\)
\(PR1 = 0.1 \cdot PR\)
Examples:
>>> from hydpy.models.gland import * >>> parameterstep() >>> fluxes.pr = 10.0 >>> model.calc_pr1_pr9_v1() >>> fluxes.pr9 pr9(9.0) >>> fluxes.pr1 pr1(1.0)
- class hydpy.models.gland.gland_model.Calc_Q_RConcModel_V1[source]¶
Bases:
Method
Let a submodel that follows the
RConcModel_V1
submodel interface perform runoff concentration.- Required by the methods:
- class hydpy.models.gland.gland_model.Calc_Q9_V1[source]¶
Bases:
Method
- Required submethod:
- Requires the flux sequence:
- Calculates the flux sequence:
Examples:
Without a rconcmodel_routingstore submodel,
Calc_Q9_V1
directsPR9
instantaneously toQ9
:>>> from hydpy.models.gland_gr4 import * >>> simulationstep("1d") >>> parameterstep("1d") >>> fluxes.pr9 = 1.0 >>> model.calc_q9_v1() >>> fluxes.q9 q9(1.0)
For a GR-compatible calculation of runoff concentration, you can select the Unit Hydrograph submodel
rconc_uh
and configure its ordinates via the gr_uh1 option:>>> with model.add_rconcmodel_routingstore_v1("rconc_uh"): ... uh("gr_uh1", x4=3.0) ... logs.quh = 1.0, 3.0, 0.0 >>> fluxes.pr9 = 2.0 >>> model.calc_q9_v1() >>> fluxes.q9 q9(1.1283)
- class hydpy.models.gland.gland_model.Calc_Q1_V1[source]¶
Bases:
Method
- Required submethod:
- Requires the flux sequence:
- Calculates the flux sequence:
Examples:
Without a rconcmodel_directflow submodel,
Calc_Q1_V1
directsPR1
instantaneously toQ1
:>>> from hydpy.models.gland_gr4 import * >>> simulationstep("1d") >>> parameterstep("1d") >>> fluxes.pr1 = 1.0 >>> model.calc_q1_v1() >>> fluxes.q1 q1(1.0)
For a GR-compatible calculation of runoff concentration, you can select the Unit Hydrograph submodel
rconc_uh
and configure its ordinates via the gr_uh2 option:>>> with model.add_rconcmodel_directflow_v1("rconc_uh"): ... uh("gr_uh2", x4=1.5) ... logs.quh = 1.0, 3.0, 0.0 >>> fluxes.pr1 = 2.0 >>> model.calc_q1_v1() >>> fluxes.q1 q1(1.362887)
- class hydpy.models.gland.gland_model.Calc_Q10_V1[source]¶
Bases:
Method
- Required submethod:
- Requires the flux sequence:
- Calculates the flux sequence:
Examples:
Without a rconcmodel submodel,
Calc_Q10_V1
directsPR
instantaneously toQ10
:>>> from hydpy.models.gland_gr5 import * >>> simulationstep("1d") >>> parameterstep("1d") >>> fluxes.pr = 1.0 >>> model.calc_q10_v1() >>> fluxes.q10 q10(1.0)
For a GR-compatible calculation of runoff concentration, you can select the Unit Hydrograph submodel
rconc_uh
and configure its ordinates via the gr_uh2 option:>>> with model.add_rconcmodel_v1("rconc_uh"): ... uh("gr_uh2", x4=1.5) ... logs.quh = 1.0, 3.0, 0.0 >>> fluxes.pr = 2.0 >>> model.calc_q10_v1() >>> fluxes.q10 q10(1.362887)
- class hydpy.models.gland.gland_model.Calc_Q1_Q9_V2[source]¶
Bases:
Method
Calculate
Q1
andQ9
by splittingQ10
.Basic equations:
\(Q9 = 0.9 \cdot Q10\)
\(Q1 = 0.1 \cdot Q10\)
Example:
>>> from hydpy.models.gland import * >>> parameterstep() >>> fluxes.q10 = 10.0 >>> model.calc_q1_q9_v2() >>> fluxes.q1 q1(1.0) >>> fluxes.q9 q9(9.0)
- class hydpy.models.gland.gland_model.Calc_FR_V1[source]¶
Bases:
Method
Calculate the groundwater exchange affecting the routing store according to GR4.
Basic equation:
\(FR = X2 \cdot \left( \frac{R}{X3} \right)^{7/2}\)
Examples:
If the routing store is nearly full, groundwater exchange is high and close to
X3
:>>> from hydpy.models.gland import * >>> from hydpy import pub >>> simulationstep("1d") >>> parameterstep("1d") >>> x2(1.02) >>> x3(100.0) >>> states.r = 95.0 >>> model.calc_fr_v1() >>> fluxes.fr fr(0.852379)
If the routing store is almost empty, groundwater exchange is low and near zero:
>>> states.r = 5.0 >>> model.calc_fr_v1() >>> fluxes.fr fr(0.000029)
- class hydpy.models.gland.gland_model.Calc_FR_V2[source]¶
Bases:
Method
Calculate the groundwater exchange affecting the routing store according to GR5 and GR6.
- Requires the control parameters:
- Updates the state sequence:
- Calculates the flux sequence:
Basic equation:
\(FR = X2 \cdot \left( \frac{R}{X3} - X5 \right)\)
Example:
>>> from hydpy.models.gland import * >>> simulationstep("1d") >>> parameterstep("1d") >>> x2(-0.163) >>> x3(100.0) >>> x5(0.104) >>> states.r = 95.0 >>> model.calc_fr_v2() >>> fluxes.fr fr(-0.137898)
- class hydpy.models.gland.gland_model.Update_R_V1[source]¶
Bases:
Method
Update the level of the non-linear routing store by adding its inflows according to GR4 and GR5.
Basic equation:
\(R_{new} = R_{old} + Q9 + FR\)
Examples:
>>> from hydpy.models.gland import * >>> parameterstep()
In case of sufficient content of the routing store, the basic equation applies without modification:
>>> states.r = 4.0 >>> fluxes.q9 = 1.0 >>> fluxes.fr = -2.0 >>> model.update_r_v1() >>> states.r r(3.0) >>> fluxes.fr fr(-2.0)
For insufficient content, groundwater loss (negative groundwater exchange) becomes restricted:
>>> fluxes.fr = -5.0 >>> model.update_r_v1() >>> states.r r(0.0) >>> fluxes.fr fr(-4.0)
- class hydpy.models.gland.gland_model.Update_R_V2[source]¶
Bases:
Method
Update the level of the non-linear routing store by adding its inflows according to GR6.
Basic equation:
\(R_{new} = R_{old} + 0.6 \cdot Q9 + FR\)
Examples:
>>> from hydpy.models.gland import * >>> from hydpy import pub >>> parameterstep()
In case of sufficient content of the routing store, the basic equation applies without modification:
>>> states.r = 4.0 >>> fluxes.q9 = 1.0 / 0.6 >>> fluxes.fr = -2.0 >>> model.update_r_v2() >>> states.r r(3.0) >>> fluxes.fr fr(-2.0)
For insufficient content, groundwater loss (negative groundwater exchange) becomes restricted:
>>> fluxes.fr = -5.0 >>> model.update_r_v2() >>> states.r r(0.0) >>> fluxes.fr fr(-4.0)
- class hydpy.models.gland.gland_model.Calc_QR_V1[source]¶
Bases:
Method
Calculate the outflow of the routing store.
Basic equation:
\(QR = R \cdot \left( 1 - \left[1 + \left( \frac{R}{X3} \right)^{4} \right]^{-1/4} \right)\)
Example:
>>> from hydpy.models.gland import * >>> from hydpy import pub >>> parameterstep("1d") >>> simulationstep("1d") >>> x3(100.0) >>> states.r = 115.852379 >>> model.calc_qr_v1() >>> fluxes.qr qr(26.30361)
- class hydpy.models.gland.gland_model.Update_R_V3[source]¶
Bases:
Method
Update the non-linear routing store by subtracting its outflow.
Basic equation:
\(R_{new} = R_{old} - QR\)
Example:
>>> from hydpy.models.gland import * >>> parameterstep() >>> fluxes.qr = 2.0 >>> states.r = 20.0 >>> model.update_r_v3() >>> states.r r(18.0)
- class hydpy.models.gland.gland_model.Calc_FR2_V1[source]¶
Bases:
Method
Calculate the groundwater exchange affecting the exponential routing store.
Basic equation:
\(FR2 = FR\)
Examples:
>>> from hydpy.models.gland import * >>> parameterstep() >>> fluxes.fr = -0.5 >>> model.calc_fr2_v1() >>> fluxes.fr2 fr2(-0.5)
- class hydpy.models.gland.gland_model.Update_R2_V1[source]¶
Bases:
Method
Update the exponential routing store by adding its inflows.
Basic equation:
\(R2_{new} = R2_{new} + 0.4 \cdot Q9 + FR2\)
Examples:
>>> from hydpy.models.gland import * >>> parameterstep() >>> fluxes.q9 = 10.0 >>> fluxes.fr2 = -0.5 >>> states.r2 = 40.0 >>> model.update_r2_v1() >>> states.r2 r2(43.5)
- class hydpy.models.gland.gland_model.Calc_QR2_R2_V1[source]¶
Bases:
Method
Calculate the outflow of the exponential routing store and update its content.
Basic equations:
\[\begin{split}QR = \begin{cases} X6 \cdot exp(ar) &|\ ar < -7 \\ X6 \cdot log(exp(ar) + 1) &|\ -7 \leq ar \leq 7 \\ R2 + X6 / exp(ar) &|\ ar > 7 \end{cases} \\ ar = min(max(R2 / X6, \, -33), \, 33)\end{split}\]Examples:
>>> from hydpy.models.gland import * >>> parameterstep() >>> x6(4.5)
For large negative exponential store levels, its outflow is almost zero:
>>> states.r2 = -50.0 >>> model.calc_qr2_r2_v1() >>> fluxes.qr2 qr2(0.000067) >>> states.r2 r2(-50.000067)
For exponential store levels around zero, there is a significant outflow:
>>> states.r2 = 0.0 >>> model.calc_qr2_r2_v1() >>> fluxes.qr2 qr2(3.119162) >>> states.r2 r2(-3.119162)
For large positive exponential store levels, its outflow is highest:
>>> states.r2 = 40.0 >>> model.calc_qr2_r2_v1() >>> fluxes.qr2 qr2(40.000621) >>> states.r2 r2(-0.000621)
- class hydpy.models.gland.gland_model.Calc_FD_V1[source]¶
Bases:
Method
Calculate the groundwater exchange affecting the direct runoff.
Basic equation:
\[\begin{split}FD = \begin{cases} - Q1 &|\ (Q1 + FR) \leq 0 \\ FR &|\ (Q1 + FR) > 0 \end{cases}\end{split}\]Examples:
>>> from hydpy.models.gland import * >>> parameterstep()
>>> fluxes.q1 = 10.0 >>> fluxes.fr = -0.5 >>> model.calc_fd_v1() >>> fluxes.fd fd(-0.5)
>>> fluxes.q1 = 1.0 >>> fluxes.fr = -1.5 >>> model.calc_fd_v1() >>> fluxes.fd fd(-1.0)
- class hydpy.models.gland.gland_model.Calc_QD_V1[source]¶
Bases:
Method
Calculate the direct runoff.
Basic equation:
\(QD = max(Q1 + FD, \, 0)\)
Examples:
>>> from hydpy.models.gland import * >>> parameterstep() >>> fluxes.q1 = 2.0
>>> fluxes.fd = -1.0 >>> model.calc_qd_v1() >>> fluxes.qd qd(1.0)
>>> fluxes.fd = -3.0 >>> model.calc_qd_v1() >>> fluxes.qd qd(0.0)
- class hydpy.models.gland.gland_model.Calc_QH_V1[source]¶
Bases:
Method
Calculate the total runoff according to GR4 and GR5.
Basic equation:
\(QH = QR + QD\)
Example:
>>> from hydpy.models.gland import * >>> parameterstep() >>> fluxes.qr = 2.0 >>> fluxes.qd = 1.0 >>> model.calc_qh_v1() >>> fluxes.qh qh(3.0)
- class hydpy.models.gland.gland_model.Calc_QH_V2[source]¶
Bases:
Method
Calculate the total runoff according to GR6.
Basic equation:
\(QH = QR + QR2 + QD\)
Example:
>>> from hydpy.models.gland import * >>> parameterstep() >>> fluxes.qr = 1.0 >>> fluxes.qr2 = 2.0 >>> fluxes.qd = 3.0 >>> model.calc_qh_v2() >>> fluxes.qh qh(6.0)
- class hydpy.models.gland.gland_model.Calc_QV_V1[source]¶
Bases:
Method
Calculate total discharge in m³/s.
- Requires the derived parameter:
- Requires the flux sequence:
- Calculates the flux sequence:
Basic equation:
\(QV = QFactor \cdot QH\)
Example:
>>> from hydpy.models.gland import * >>> parameterstep() >>> derived.qfactor(2.0) >>> fluxes.qh = 3.0 >>> model.calc_qv_v1() >>> fluxes.qv qv(6.0)
- class hydpy.models.gland.gland_model.Pass_Q_V1[source]¶
Bases:
Method
Update the outlet link sequence.
Basic equation:
\(Q = QV\)
- class hydpy.models.gland.gland_model.Main_PETModel_V1[source]¶
Bases:
AdHocModel
Base class for HydPy-G models that use submodels that comply with the
PETModel_V1
interface.- petmodel: SubmodelProperty¶
- petmodel_is_mainmodel¶
- petmodel_typeid¶
- add_petmodel_v1¶
Initialise the given petmodel that follows the
PETModel_V1
interface.>>> from hydpy.models.gland_gr4 import * >>> parameterstep() >>> area(5.0) >>> with model.add_petmodel_v1("evap_ret_tw2002"): ... nmbhru ... hruarea ... evapotranspirationfactor(1.5) nmbhru(1) hruarea(5.0)
>>> etf = model.petmodel.parameters.control.evapotranspirationfactor >>> etf evapotranspirationfactor(1.5)
- REUSABLE_METHODS: ClassVar[tuple[type[ReusableMethod], ...]] = ()¶
- class hydpy.models.gland.gland_model.Main_RConcModel_V1[source]¶
Bases:
AdHocModel
Base class for HydPy-G models that use a single submodel that complies with the
RConcModel_V1
interface.- rconcmodel: SubmodelProperty¶
- rconcmodel_is_mainmodel¶
- rconcmodel_typeid¶
- add_rconcmodel_v1¶
Initialise the given submodel that follows the
RConcModel_V1
interface and is responsible for calculating runoff concentration.>>> from hydpy.models.gland_gr5 import * >>> simulationstep("1d") >>> parameterstep("1d") >>> with model.add_rconcmodel_v1("rconc_uh"): ... uh("gr_uh2", x4=3.0) >>> model.rconcmodel.parameters.control.uh uh("gr_uh2", x4=3.0)
- REUSABLE_METHODS: ClassVar[tuple[type[ReusableMethod], ...]] = ()¶
- class hydpy.models.gland.gland_model.Main_RConcModel_V2[source]¶
Bases:
AdHocModel
Base class for HydPy-G models that use two submodels that comply with the
RConcModel_V1
interface.- rconcmodel_routingstore: SubmodelProperty¶
- rconcmodel_routingstore_is_mainmodel¶
- rconcmodel_routingstore_typeid¶
- rconcmodel_directflow: SubmodelProperty¶
- rconcmodel_directflow_is_mainmodel¶
- rconcmodel_directflow_typeid¶
- add_rconcmodel_routingstore_v1¶
Initialise the given submodel that follows the
RConcModel_V1
interface and is responsible for calculating the runoff concentration related to the routing store.>>> from hydpy.models.gland_gr4 import * >>> simulationstep("1d") >>> parameterstep("1d") >>> with model.add_rconcmodel_routingstore_v1("rconc_uh"): ... uh("gr_uh1", x4=2.0) >>> model.rconcmodel_routingstore.parameters.control.uh uh("gr_uh1", x4=2.0)
- add_rconcmodel_directflow_v1¶
Initialise the given submodel that follows the
RConcModel_V1
interface and is responsible for calculating the runoff concentration related to the direct runoff.>>> from hydpy.models.gland_gr4 import * >>> simulationstep("1d") >>> parameterstep("1d") >>> with model.add_rconcmodel_directflow_v1("rconc_uh"): ... uh("gr_uh2", x4=3.0) >>> model.rconcmodel_directflow.parameters.control.uh uh("gr_uh2", x4=3.0)
- REUSABLE_METHODS: ClassVar[tuple[type[ReusableMethod], ...]] = ()¶
Parameter Features¶
Control parameters¶
- class hydpy.models.gland.ControlParameters(master: Parameters, cls_fastaccess: type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
SubParameters
Control parameters of model gland.
- The following classes are selected:
Area()
Subbasin area [km²].IMax()
Interception store capacity [mm].X1()
Maximum capacity of the production storage [mm].X2()
Groundwater exchange coefficient (positive for water imports, negative for exports) [mm/T].X3()
One timestep ahead maximum capacity of the routing store [mm].X5()
Intercatchment exchange threshold [-].X6()
Coefficient for emptying the exponential store [mm].
- class hydpy.models.gland.gland_control.Area(subvars: SubParameters)[source]¶
Bases:
Parameter
Subbasin area [km²].
- class hydpy.models.gland.gland_control.IMax(subvars: SubParameters)[source]¶
Bases:
Parameter
Interception store capacity [mm].
- Required by the method:
- class hydpy.models.gland.gland_control.X1(subvars: SubParameters)[source]¶
Bases:
Parameter
Maximum capacity of the production storage [mm].
- Required by the methods:
- class hydpy.models.gland.gland_control.X2(subvars: SubParameters)[source]¶
Bases:
Parameter
Groundwater exchange coefficient (positive for water imports, negative for exports) [mm/T].
- Required by the methods:
- classmethod get_timefactor() float [source]¶
Factor to adjust values of
X2
to differences betweenparameterstep()
andsimulationstep()
.Method
get_timefactor()
of classX2
extends methodget_timefactor()
of classParameter
according to \(x2_{sim} = x2_{par} \cdot (sim/par)^{0.125}\) (Ficchí, 2017):>>> from hydpy.models.gland import * >>> simulationstep("1h") >>> parameterstep("1d") >>> x2(7.0) >>> x2 x2(7.0) >>> from hydpy import round_ >>> round_(x2.value) 4.70513
- class hydpy.models.gland.gland_control.X3(subvars: SubParameters)[source]¶
Bases:
Parameter
One timestep ahead maximum capacity of the routing store [mm].
- Required by the methods:
- classmethod get_timefactor() float [source]¶
Factor to adjust values of
X3
to differences betweenparameterstep()
andsimulationstep()
.Method
get_timefactor()
of classX3
extends methodget_timefactor()
of classParameter
according to \(x3_{sim} = x3_{par} \cdot (sim/par)^{-0.25}\) (Ficchí, 2017):>>> from hydpy.models.gland import * >>> simulationstep("1h") >>> parameterstep("1d") >>> x3(30.0) >>> x3 x3(30.0) >>> from hydpy import round_ >>> round_(x3.value) 66.400915
- class hydpy.models.gland.gland_control.X5(subvars: SubParameters)[source]¶
Bases:
Parameter
Intercatchment exchange threshold [-].
- Required by the method:
- class hydpy.models.gland.gland_control.X6(subvars: SubParameters)[source]¶
Bases:
Parameter
Coefficient for emptying the exponential store [mm].
- Required by the method:
Derived parameters¶
- class hydpy.models.gland.DerivedParameters(master: Parameters, cls_fastaccess: type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
SubParameters
Derived parameters of model gland.
- class hydpy.models.gland.gland_derived.DOY(subvars: SubParameters)[source]¶
Bases:
DOYParameter
References the “global” month of the year index array [-].
- class hydpy.models.gland.gland_derived.Beta(subvars: SubParameters)[source]¶
Bases:
Parameter
Percolation factor [T].
- Required by the method:
- update() None [source]¶
Update
Beta
based on the equation \(5.25 \cdot (3600 / \Delta t)^{0.25}\) (Ficchí, 2017).>>> from hydpy.models.gland import * >>> from hydpy import pub >>> parameterstep()
For an hourly simulation step, the value of
Beta
agrees precisely with the given equation but is presented as a ratio:>>> simulationstep("1h") >>> derived.beta.update() >>> derived.beta beta(21/4)
For a daily simulation step, the given equation does not precisely result in the usual GR4J ratio. Hence, the nominator is rounded to an integer value:
>>> simulationstep("1d") >>> derived.beta.update() >>> derived.beta beta(9/4)
The values for intermediate or shorter simulation steps are modified in the same way:
>>> simulationstep("3h") >>> derived.beta.update() >>> derived.beta beta(16/4)
>>> simulationstep("15m") >>> derived.beta.update() >>> derived.beta beta(30/4)
For testing purposes, you can set arbitrary values that are not affected by rounding:
>>> derived.beta(8.0) >>> derived.beta beta(8.0)
- class hydpy.models.gland.gland_derived.QFactor(subvars: SubParameters)[source]¶
Bases:
Parameter
Factor for converting mm/stepsize to m³/s.
- Required by the method:
- update()[source]¶
Update
QFactor
based onArea
and the current simulation step size.>>> from hydpy.models.gland import * >>> from hydpy import pub >>> parameterstep('1d') >>> simulationstep('1d') >>> pub.options.reprdigits = 6 >>> area(50.0) >>> derived.qfactor.update() >>> derived.qfactor qfactor(0.578704)
change simulationstep to 1 h
>>> simulationstep('1h') >>> derived.qfactor.update() >>> derived.qfactor qfactor(13.888889)
Sequence Features¶
Input sequences¶
- class hydpy.models.gland.InputSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
InputSequences
Input sequences of model gland.
- The following classes are selected:
P()
Precipitation [mm/T].
- class hydpy.models.gland.gland_inputs.P(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
InputSequence
Precipitation [mm/T].
- Required by the methods:
- STANDARD_NAME: ClassVar[StandardInputNames] = 'precipitation'¶
Flux sequences¶
- class hydpy.models.gland.FluxSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
FluxSequences
Flux sequences of model gland.
- The following classes are selected:
E()
Potential evapotranspiration [mm/T].EN()
Net evapotranspiration capacity [mm/T].PN()
Net precipitation [mm/T].EI()
Actual evaporation from the interception store [mm/T].ES()
Actual evapotranspiration from the production store [mm/T].AE()
Total actual evapotranspiration [mm/T].PR()
Total inflow into the runoff concentration module [mm/T].Q10()
Total outflow of runoff concentration module [mm/T].Perc()
Percolation [mm/T].Q9()
Outflow of runoff concentration submodel receivingPR9
[mm/T].Q1()
Outflow of runoff concentration submodel receivingPR1
[mm/T].FD()
Groundwater exchange affecting the direct runoff [mm/T].FR()
Groundwater exchange affecting the routing store [mm/T].FR2()
Groundwater exchange affecting the exponential routing store [mm/T].QR()
Outflow of the routing store [mm/T].QR2()
Outflow of the exponential store [mm/T].QD()
Direct runoff [mm/T].QH()
Total runoff [mm/T].QV()
Total discharge [m³/s].
- class hydpy.models.gland.gland_fluxes.E(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Potential evapotranspiration [mm/T].
- Calculated by the methods:
- Required by the methods:
- class hydpy.models.gland.gland_fluxes.EN(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Net evapotranspiration capacity [mm/T].
- Calculated by the method:
- Required by the method:
- class hydpy.models.gland.gland_fluxes.PN(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Net precipitation [mm/T].
- Calculated by the method:
- Required by the methods:
- class hydpy.models.gland.gland_fluxes.PS(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Part of
PN
filling the production store [mm/T].- Calculated by the method:
- Required by the methods:
- class hydpy.models.gland.gland_fluxes.EI(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Actual evaporation from the interception store [mm/T].
- Calculated by the method:
- Required by the methods:
- class hydpy.models.gland.gland_fluxes.ES(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Actual evapotranspiration from the production store [mm/T].
- Calculated by the method:
- Required by the methods:
- class hydpy.models.gland.gland_fluxes.AE(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Total actual evapotranspiration [mm/T].
- Calculated by the method:
- class hydpy.models.gland.gland_fluxes.PR(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Total inflow into the runoff concentration module [mm/T].
- Calculated by the method:
- Required by the methods:
- class hydpy.models.gland.gland_fluxes.PR9(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
90% of
PR
[mm/T].- Calculated by the method:
- Required by the method:
- class hydpy.models.gland.gland_fluxes.PR1(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
10% of
PR
[mm/T].- Calculated by the method:
- Required by the method:
- class hydpy.models.gland.gland_fluxes.Q10(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Total outflow of runoff concentration module [mm/T].
- Calculated by the method:
- Required by the method:
- class hydpy.models.gland.gland_fluxes.Perc(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Percolation [mm/T].
- Calculated by the method:
- Required by the methods:
- class hydpy.models.gland.gland_fluxes.Q9(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Outflow of runoff concentration submodel receiving
PR9
[mm/T].- Calculated by the methods:
- Required by the methods:
- class hydpy.models.gland.gland_fluxes.Q1(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Outflow of runoff concentration submodel receiving
PR1
[mm/T].- Calculated by the methods:
- Required by the methods:
- class hydpy.models.gland.gland_fluxes.FD(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Groundwater exchange affecting the direct runoff [mm/T].
- Calculated by the method:
- Required by the method:
- class hydpy.models.gland.gland_fluxes.FR(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Groundwater exchange affecting the routing store [mm/T].
- Calculated by the methods:
- Required by the methods:
- class hydpy.models.gland.gland_fluxes.FR2(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Groundwater exchange affecting the exponential routing store [mm/T].
- Calculated by the method:
- Required by the method:
- class hydpy.models.gland.gland_fluxes.QR(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Outflow of the routing store [mm/T].
- Calculated by the method:
- Required by the methods:
- class hydpy.models.gland.gland_fluxes.QR2(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Outflow of the exponential store [mm/T].
- Calculated by the method:
- Required by the method:
- class hydpy.models.gland.gland_fluxes.QD(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Direct runoff [mm/T].
- Calculated by the method:
- Required by the methods:
- class hydpy.models.gland.gland_fluxes.QH(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Total runoff [mm/T].
- Calculated by the methods:
- Required by the method:
- class hydpy.models.gland.gland_fluxes.QV(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Total discharge [m³/s].
- Calculated by the method:
- Required by the method:
State sequences¶
- class hydpy.models.gland.StateSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
StateSequences
State sequences of model gland.
- class hydpy.models.gland.gland_states.I(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
StateSequence
Water content of the interception store [mm].
- Updated by the method:
- Required by the methods:
- class hydpy.models.gland.gland_states.S(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
StateSequence
Water content of the production store [mm].
- Updated by the methods:
- Required by the methods:
- class hydpy.models.gland.gland_states.R(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
StateSequence
Water content of the routing store [mm].
- Updated by the methods:
- Required by the methods:
- class hydpy.models.gland.gland_states.R2(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
StateSequence
Level of the exponential store [mm].
- Updated by the methods:
Outlet sequences¶
- class hydpy.models.gland.OutletSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
OutletSequences
Outlet sequences of model gland.
- The following classes are selected:
Q()
Runoff [m³/s].
- class hydpy.models.gland.gland_outlets.Q(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
OutletSequence
Runoff [m³/s].
- Calculated by the method:
- class hydpy.models.gland.ControlParameters(master: Parameters, cls_fastaccess: type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
SubParameters
Control parameters of model gland.
- The following classes are selected:
Area()
Subbasin area [km²].IMax()
Interception store capacity [mm].X1()
Maximum capacity of the production storage [mm].X2()
Groundwater exchange coefficient (positive for water imports, negative for exports) [mm/T].X3()
One timestep ahead maximum capacity of the routing store [mm].X5()
Intercatchment exchange threshold [-].X6()
Coefficient for emptying the exponential store [mm].
- class hydpy.models.gland.DerivedParameters(master: Parameters, cls_fastaccess: type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
SubParameters
Derived parameters of model gland.
- class hydpy.models.gland.FluxSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
FluxSequences
Flux sequences of model gland.
- The following classes are selected:
E()
Potential evapotranspiration [mm/T].EN()
Net evapotranspiration capacity [mm/T].PN()
Net precipitation [mm/T].EI()
Actual evaporation from the interception store [mm/T].ES()
Actual evapotranspiration from the production store [mm/T].AE()
Total actual evapotranspiration [mm/T].PR()
Total inflow into the runoff concentration module [mm/T].Q10()
Total outflow of runoff concentration module [mm/T].Perc()
Percolation [mm/T].Q9()
Outflow of runoff concentration submodel receivingPR9
[mm/T].Q1()
Outflow of runoff concentration submodel receivingPR1
[mm/T].FD()
Groundwater exchange affecting the direct runoff [mm/T].FR()
Groundwater exchange affecting the routing store [mm/T].FR2()
Groundwater exchange affecting the exponential routing store [mm/T].QR()
Outflow of the routing store [mm/T].QR2()
Outflow of the exponential store [mm/T].QD()
Direct runoff [mm/T].QH()
Total runoff [mm/T].QV()
Total discharge [m³/s].
- class hydpy.models.gland.InputSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
InputSequences
Input sequences of model gland.
- The following classes are selected:
P()
Precipitation [mm/T].
- class hydpy.models.gland.OutletSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
OutletSequences
Outlet sequences of model gland.
- The following classes are selected:
Q()
Runoff [m³/s].
- class hydpy.models.gland.StateSequences(master: Sequences, cls_fastaccess: type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
StateSequences
State sequences of model gland.