-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Finish the implementation of GR4J and friends #134
Comments
This suggestion is taken from the PR. There seems to be no fundamental difference between the model versions for daily and hourly simulation steps. Hence, committing the "j" is reasonable. Then, the "x" is not required as a placeholder anymore. However, we only took the first letters from HBV96, LARSIM, and WALRUS ( |
I would prefer gr_land as model group name.
…-----Ursprüngliche Nachricht-----
Von: Christoph Tyralla ***@***.***>
Gesendet: Dienstag, 16. April 2024 09:39
An: hydpy-dev/hydpy ***@***.***>
Cc: Klein, Bastian, M2, B40 ***@***.***>; Mention ***@***.***>
Betreff: Re: [hydpy-dev/hydpy] Finish the implementation of GR4J and friends (Issue #134)
* Rename grxj_land. I propose to rename the model group grxjland to gr_land (gr for genie rurale).
This suggestion is taken from the PR <#112 (comment)> . There seems to be no fundamental difference between the model versions for daily and hourly simulation steps. Hence, committing the "j" is reasonable. Then, the "x" is not required as a placeholder anymore. However, we only took the first letters from HBV96, LARSIM, and WALRUS (hland, lland, and wland) to make clearer distinctions between the original and the HydPy implementations. So, the alternative suggestion is gland. However, note that a suggested name for one of the evap models is currently evap_pet_hbv96. What do others think?
—
Reply to this email directly, view it on GitHub <#134 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AOZHFRAEQ55RNJ7DO7EGKLLY5TISXAVCNFSM6AAAAABGIY2EBKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJYGQZTQMRYGU> .
You are receiving this because you were mentioned. <https://github.com/notifications/beacon/AOZHFRA7K26YJBMCCGOUNTDY5TISXA5CNFSM6AAAAABGIY2EBKWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTT2WFDI2.gif> Message ID: ***@***.***>
|
@sivogel also raised the question (in an offline discussion) of whether to extract the unit hydrograph into a submodel (see #130). Currently, @parvumflumen implements a suitable submodel family in #133. I see no reason against this (except about one or two days of additional work). Please note the related discussion in #130. |
@sivogel: When (or if) you apply this name, could you please carefully check if the underscore does not cause any problems? Code sections might assume an application model's family name to be the first substring before the underscore. I would most likely expect such assumptions in the code that generates the documentation. |
The current proposal suggests three application models with limited differences. Can we reduce the number of application models without losing functionality? This could help remove some redundancies (especially in testing). However, we should refrain from such refactoring if it affects comprehensibility (too much). |
I remembered one place where this name could cause problems: autodoc_applicationmodel (see the split operation; I guess we explain the "conventional way" somewhere else) |
In an offline discussion, we decided on |
Currently we have 3 different gland application models gland_gr4, gland_gr5 and gland_gr6. @tyralla asked if it is possible to merge these 3 application models into one application model. In my opinion we should stay with 3 application models because I do not see a way to merge Calc_F_V1 and Calc_F_V2 into 1 application model without having meaningless parameters.
But maybe we can combine the snow model with hysteresis effect with the one without. To do this, we would need to introduce GLocalMax into the model without hysteresis effect. This would be an overhead in the simpler application model, but would save us two application models.
|
The method Calc_PLayer_V1 calculates the precipitation for each height level of the snow module. In airGR it is assumed that above 4000m precipitation is no longer height dependent. This assumption was not found in any other publication. Should we keep the airGR assumption?
|
I could not find any differences between the hourly and the daily gr4j airGR model. The Fortran scripts on airGR differ only in the parameter NH, which specifies the length of the unit hydrograph outflow. However, this is later truncated to the parameter x4 (unless x4 is greater than 20 days (480h), in which case it is truncated to 20 days (480h)). Therefore, in my current opinion, no separate implementation of GR4H is necessary.
|
The actual evaporation is calculated from the potential evaporation using equation: Calc_Es_V1 based on the filling of the production store. In contrast to the previous evaporation approaches, the net evaporation (i.e. pet - p) is used in the calculation instead of the potential evaporation, for which a suitable submodel interface would first have to be created that also passes on the precipitation or only the net evaporation to the submodel. This should not be too difficult to implement, but requires a little programming effort
|
For equation Calc_SolidFraction_V1 the literature Turcotte2007 is referenced, but no page is given. The document has over 400 pages and no specific page is given so we cannot prove the correctness of this method.
|
Currently all variable names are taken from the airGR package. Should we adjust them. Should we find more descriptive names or leave then as they are.
|
The equation
|
We assume (similarly to the implementation of hland) that zinputs is not the station height, but always the mean height of the catchment area. Therefore the zinputs parameter is no longer necessary and can be calculated by zlayers and layerarea. We decided to remove the hypsodata option from zlayers and add a pre-processing method to the model to calculate layerarea and zlayers from hypsodata, as layerarea should not be set independently of hypsodata. |
I have updated my comments with the results of our discussions yesterday and today. |
In the current HydPy-gland version we have a mixture of parameter and series names from:
In the following I want to give an overview which can help us to
Feel free to comment and make suggestions |
Shouldn't we use for input Sequences like Precipitation the standard HydPy names? I can't find the issue mentioning these names. Is there a standard name for potential evaporation? |
We discussed this in #75. We now support multiple naming conventions. The actual implementation of an The current list of the standard names is here. We added no "Mean_" prefixes to the names (so far) because reading averages is the standard case while, for example, reading maximums is special. |
The potential evapotranspiration standard name is defined here (I overlooked it at first sight. We should better sort all names in strict alphabetical order.) |
We still have problems in making our model available in different time steps. Ficchi 2019 (doi:10.1016/j.jhydrol.2019.05.084 ) describes in Table A.1 that the equations for
|
The GR community seems to have put some effort into changing the simulation time step without changing the simulation result (too much). This even includes writing GR versions in a continuous state-space form (which would be relatively simple to implement in HydPy but is currently not on our target list). I find it relatively hard to find all relevant information, partly because I am unfamiliar with French. However, as our current goal is "only" to achieve an implementation that is functionally similar to airGR, we probably do not need to understand all the details of the underlying assumptions. As far as I can see, all equations of these GR versions rely on the analytical integration of individual fluxes (operator splitting). Also, there is always the problem with the assumed temporal distribution of meteorological input, especially precipitation, when dealing with long simulation steps. So, we cannot expect that equivalent daily and hourly parameters result in equivalent daily and hourly simulation results (the same holds, e.g., for HydPy-H and HydPy-L). In my opinion, it is sufficient if our GR implementations are as good as those of arGR, except that we should ideally support arbitrary simulation step widths, not only daily and hourly ones. I try to adjust the relevant equations of our current GR code accordingly and note my assumptions here. |
percolationIn Ficchi (2017), I found the following equation for calculating the percolation constant: For The following examples demonstrate that the above equation is correct (identical simulation results when applying the percolation equation on a daily and an hourly basis): def perc(*, s: float, x1: float, v: float) -> float:
return s * (1.0 - (1.0 + (v * s / x1) ** 4.0) ** (-0.25))
s0 = 10.0
x1 = 30.0
perc_1d = perc(s=s0, x1=x1, v=4.0 / 9.0)
assert round(perc_1d, 8) == 0.00120391, perc_1d
perc_1d = perc(s=s0, x1=x1, v=1.0 / (5.25 * (1.0 / 24.0) ** (1.0 / 4.0)))
assert round(perc_1d, 8) == 0.00097482, perc_1d
s = s0
perc_1h_cum = 0.0
for _ in range(24):
perc_1h_now = perc(s=s, x1=x1, v=4.0 / 21.0)
s -= perc_1h_now
perc_1h_cum += perc_1h_now
assert round(perc_1h_cum, 8) == 0.00097482, perc_1h_cum Unfortunately, we cannot apply the above equation without losing consistency with GRxJ. I am only speculating, but the ratio def calc_beta(dt: float) -> None:
print(f"{round(4.0 * (5.25 * (1.0 / dt) ** 0.25))} / 4")
for hours in (0.25, 0.5, 1.0, 3.0, 6.0, 12.0, 24.0):
calc_beta(dt=hours)
# 30 / 4
# 25 / 4
# 21 / 4
# 16 / 4
# 13 / 4
# 11 / 4
# 9 / 4 |
groundwater exchange and outflow of the nonlinear routing storeRegarding the outflow term def calc_qr(*, r: float, x3: float) -> float:
return r * (1.0 - (1.0 + (r / x3) ** 4.0) ** -0.25)
def calc_fr(*, r: float, x2: float, x3: float) -> float:
return x2 * (r / x3) ** 3.5
x2_1d = 7.0
x3_1d = 30.0
x2_1h = x2_1d * (1.0 / 24.0) ** 0.125
x3_1h = x3_1d * (1.0 / 24.0) ** -0.25
r0 = 10.0
qr_1d = calc_qr(r=r0, x3=x3_1d)
assert round(qr_1d, 8) == 0.03062823, qr_1d
r = r0
qr_1h_cum = 0.0
for _ in range(24):
qr_1h_now = calc_qr(r=r, x3=x3_1h)
r -= qr_1h_now
qr_1h_cum += qr_1h_now
assert round(qr_1h_cum, 8) == 0.03062823, qr_1h_cum # okay
fr_1d = calc_fr(r=r0, x2=x2_1d, x3=x3_1d)
assert round(fr_1d, 8) == 0.14968340, fr_1d
r = r0
fr_1h_cum = 0.0
for _ in range(24):
fr_1h_now = calc_fr(r=r, x2=x2_1h, x3=x3_1h)
r -= fr_1h_now
fr_1h_cum += fr_1h_now
assert round(fr_1h_cum, 8) == 0.14602887, fr_1h_cum # ??? For the groundwater exchange Additionally, for GRx5 and GRx6, the calculation of However, the given equation (and our current understanding) is the best we have, so I will implement the transformation for |
Regarding
I am unsure if we ever need such functionality, so I will ignore it for now but post it as a reminder for potential later discussions. |
Reviewing all the GR methods (equations) again, I found two water balance mistakes. I remember there was one place in the documentation where one exchange term was said to be "potential". I removed this word because it was not consistent with other descriptions. If If |
While fixing the above problems, I noticed one more thing. It appears to me that when switching from GR5 to GR6, the routing storage-related groundwater exchange doubles: And later it is, for example, I will leave it like this, but someone more familiar with GR6 may reconsider this. |
It may be okay because the routing store receives less input. So, it is usually less filled and |
I created a new branch, removed all files related to So, This is the branch for finishing |
@BGWKlein implemented prototypes for GR4J and some related models a long time ago, and @sivogel did some polishing a year ago in #112 and recently updated her PR to account for the new submodel concept (regarding evaporation.
It might be a little late, but I open this issue as a notebook to keep track of the final discussions.
The text was updated successfully, but these errors were encountered: