Skip to content

Commit

Permalink
HBV-EC emulator improvements (#404)
Browse files Browse the repository at this point in the history
<!-- Please ensure the PR fulfills the following requirements! -->
<!-- If this is your first PR, make sure to add your details to the
AUTHORS.rst! -->
### Pull Request Checklist:
- [ ] This PR addresses an already opened issue (for bug fixes /
features)
  - This PR fixes #xyz
- [ ] (If applicable) Documentation has been added / updated (for bug
fixes / features).
- [ ] (If applicable) Tests have been added.
- [X] CHANGELOG.rst has been updated (with summary of main changes).
- [ ] Link to issue (:issue:`number`) and pull request (:pull:`number`)
has been added.

### What kind of change does this PR introduce?

Improved the HBV-EC emulator by adding parameter information (name,
definition, and Raven default values) and fixed the variable name for
the adiabatic temperature lapse rate.

### Does this PR introduce a breaking change?

This should not introduce breaking changes, and any errors would be
captured by the tests already included in emulators.py.

### Other information:
  • Loading branch information
lou-a authored Oct 3, 2024
2 parents 7fe489f + 1a55521 commit ded382b
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 22 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Internal changes
* Many `numpydoc`-style docstrings have been adjusted for consistency.
* Added `setuptools` to the `gis` build recipe to ensure that the `gdal` bindings are built successfully. (PR #400)
* Modified the sub-basin and channel profile extraction functions to correctly set the river length to zero and set default values for reach attributes in sub-basins with no channel routing (i.e., sub-basins with lakes or headwater basins). (issue #354, PR #401)
* Improved the HBV-EC emulator by adding parameter information (name, definition, and Raven default values) and fixed the variable name for the adiabatic temperature lapse rate. (PR #404)

v0.15.0 (2024-06-20)
--------------------
Expand Down
86 changes: 64 additions & 22 deletions src/ravenpy/config/emulators/hbvec.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,69 @@

@dataclass(config=SymConfig)
class P(Params):
X01: Sym = Variable("X01")
X02: Sym = Variable("X02")
X03: Sym = Variable("X03")
X04: Sym = Variable("X04")
X05: Sym = Variable("X05")
X06: Sym = Variable("X06")
X07: Sym = Variable("X07")
X08: Sym = Variable("X08")
X09: Sym = Variable("X09")
X10: Sym = Variable("X10")
X11: Sym = Variable("X11")
X12: Sym = Variable("X12")
X13: Sym = Variable("X13")
X14: Sym = Variable("X14")
X15: Sym = Variable("X15")
X16: Sym = Variable("X16")
X17: Sym = Variable("X17")
X18: Sym = Variable("X18")
X19: Sym = Variable("X19")
X20: Sym = Variable("X20")
X21: Sym = Variable("X21")
X01: Sym = Variable(
"X01"
) # RAINSNOW_TEMP | rain/snow halfway transition temperature [◦C] | default=-0.15, min=-3.0, max=3.0
X02: Sym = Variable(
"X02"
) # MELT_FACTOR | maximum snow melt factor used in degree day models [mm/d/◦C] | default=5.04, min=-9999, max=-9999
X03: Sym = Variable(
"X03"
) # REFREEZE_FACTOR | maximum refreeze factor used in degree day models [mm/d/◦C] | default=5.04, min=0.0, max=10.0
X04: Sym = Variable(
"X04"
) # SNOW_SWI | water saturation fraction of snow [-] | default=0.05, min=0.0, max=0.5
X05: Sym = Variable(
"X05"
) # POROSITY | effective porosity of the soil [-] | default=0.4, min=0.0, max=1.0
X06: Sym = Variable(
"X06"
) # FIELD_CAPACITY | field capacity saturation of the soil [-] | default=0.0, min=0.0, max=1.0
X07: Sym = Variable(
"X07"
) # HBV_BETA | HBV infiltration exponent [-] | default=1, min=-9999, max=-9999
X08: Sym = Variable(
"X08"
) # MAX_PERC_RATE | VIC/ARNO/GAWSER percolation rate [mm/d] | default=-9999, min=-9999, max=-9999
X09: Sym = Variable(
"X09"
) # BASEFLOW_COEFF | linear baseflow storage/routing coeff (FAST_RES) [1/d] | default=0.1, min=0.0, max=9999
X10: Sym = Variable(
"X10"
) # BASEFLOW_COEFF | linear baseflow storage/routing coeff (SLOW_RES) [1/d] | default=0.1, min=0.0, max=9999
X11: Sym = Variable(
"X11"
) # TIME_CONC | the time of concentration of the unit hydrograph [d] | default=1, min=0, max=200
X12: Sym = Variable(
"X12"
) # PRECIP_LAPSE | precipitation lapse rate for orographic correction [mm/d/km] | default=-9999, min=0.0, max=-9999
X13: Sym = Variable(
"X13"
) # ADIABATIC_LAPSE | adiabatic temperature lapse rate [◦C/km] | default=6.4, min=5, max=8
X14: Sym = Variable(
"X14"
) # SAT_WILT | hydroscopic minimum saturation [-] | default=0.0, min=0.0, max=1.0
X15: Sym = Variable(
"X15"
) # BASEFLOW_N | VIC/ARNO baseflow exponent [-] | default=5, min=-9999, max=-9999
X16: Sym = Variable(
"X16"
) # MAX_CAP_RISE_RATE | HBV max capillary rise rate [mm/d] | default=0, min=-9999, max=-9999
X17: Sym = Variable(
"X17"
) # TOPSOIL THICKNESS | soil layer thickness (TOPSOIL) [m] |
X18: Sym = Variable(
"X18"
) # HBV_MELT_FOR_CORR | HBV snowmelt forest correction (MRF in HBV-EC) [-] | default=1, min=-9999, max=9999
X19: Sym = Variable(
"X19"
) # GLAC_STORAGE_COEFF | maximum linear storage coefficient for glacial melt [-] | default=0.1, min=0, max=1
X20: Sym = Variable(
"X20"
) # RAIN_CORR | rain correction factor for subbasin (multiplier) [-] | default=1.0, min=0.5, max=2.0
X21: Sym = Variable(
"X21"
) # SNOW_CORR | snow correction factor for subbasin (multiplier) [-] | default=1.0, min=0.5, max=2.0


class LandHRU(HRU):
Expand Down Expand Up @@ -161,7 +203,7 @@ class HBVEC(Config):
)
global_parameter: dict = Field(
{
"AdiabaticLapse": P.X13,
"ADIABATIC_LAPSE": P.X13,
"SNOW_SWI": P.X04,
"PRECIP_LAPSE": P.X12,
},
Expand Down

0 comments on commit ded382b

Please sign in to comment.