Skip to content

Commit

Permalink
add support for new processes and methods added in v3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
huard committed Jan 10, 2024
1 parent 89c356c commit 99d8557
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
4 changes: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
History
=======

0.14 (unreleased)
-----------------
* Add support for new processes and methods added in Raven v3.8.

0.13 (2023-01-10)
-----------------
* Fixed problem with scalar elevation in netCDF files parsed with `nc_specs` (issue #279, PR #323)
Expand Down
17 changes: 17 additions & 0 deletions ravenpy/config/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@
"TFSNOW",
"RELATIVE_HT",
"RELATIVE_LAI",
"CAP_LAI_RATIO",
"SNOCAP_LAI_RATIO",
]


Expand Down Expand Up @@ -276,6 +278,7 @@ class EvaluationMetrics(Enum):
RCOEFF = "RCOEFF"
NSC = "NSC"
KLING_GUPTA = "KLING_GUPTA"
DIAG_SPEARMAN = "DIAG_SPEARMAN"


evaluation_metrics_multiplier = dict(
Expand All @@ -290,6 +293,7 @@ class EvaluationMetrics(Enum):
RCOEFF=-1,
NSC=1,
KLING_GUPTA=1,
DIAG_SPEARMAN=1,
)


Expand All @@ -308,6 +312,15 @@ class Evaporation(Enum):
MONTHLY_FACTOR = "PET_MONTHLY_FACTOR"
MOHYSE = "PET_MOHYSE"
OUDIN = "PET_OUDIN"
VAP_DEFICIT = "PET_VAPDEFICIT"


class LWIncomingMethod(Enum):
DATA = "LW_INC_DATA"
DEFAULT = "LW_INC_DEFAULT"
SICART = "LW_INC_SICART"
SKYVIEW = "LW_INC_SKYVIEW"
DINGMAN = "LW_INC_DINGMAN"


class LWRadiationMethod(Enum):
Expand Down Expand Up @@ -379,12 +392,16 @@ class RainSnowFraction(Enum):
HBV = "RAINSNOW_HBV"
HARDER = "RAINSNOW_HARDER"
HSPF = "RAINSNOW_HSPF"
WANG = "RAINSNOW_WANG"
SNTHERM89 = "RAINSNOW_SNTHERM89"


class RelativeHumidityMethod(Enum):
CONSTANT = "RELHUM_CONSTANT"
DATA = "RELHUM_DATA"
MINDEWPT = "RELHUM_MINDEWPT"
CORR = "RELHUM_CORR"
WINDVEL = "WINDVEL_CORR"


class Routing(Enum):
Expand Down
5 changes: 5 additions & 0 deletions ravenpy/config/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,18 @@ class SoilEvaporation(Process):
"SOILEVAP_ALL",
"SOILEVAP_LINEAR",
"SOILEVAP_SACSMA",
"SOILEVAP_HYMOD2",
]


class LakeEvaporation(Process):
algo: Literal["LAKE_EVAP_BASIC"]


class LakeFreeze(Process):
algo: Literal["LFREEZE_BASIC", "LFREEZE_THERMAL"]


class OpenWaterEvaporation(Process):
algo: Literal["OPEN_WATER_EVAP", "OPEN_WATER_RIPARIAN"]

Expand Down
8 changes: 8 additions & 0 deletions ravenpy/config/rvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ class RVI(RV):
alias="MonthlyInterpolationMethod"
)
soil_model: Optional[rc.SoilModel] = optfield(alias="SoilModel")
temperature_correction: Optional[bool] = optfield(
alias="TemperatureCorrection",
description="Gridded or gauged temperature bias correction.",
)
lake_storage: Optional[o.StateVariables] = optfield(alias="LakeStorage")

define_hru_groups: Optional[Sequence[str]] = optfield(alias="DefineHRUGroups")
Expand Down Expand Up @@ -108,6 +112,10 @@ class RVI(RV):
write_subbasin_file: Optional[bool] = optfield(
alias="WriteSubbasinFile"
) # Undocumented
write_local_flows: Optional[bool] = optfield(
alias="WriteLocalFlows",
description="Write local contribution to hydrograph in hydrograph.csv",
)

@field_validator("soil_model", mode="before")
@classmethod
Expand Down

0 comments on commit 99d8557

Please sign in to comment.