Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cfe, topmodel, and lgar calibratable parmeters; ngen.cal python < 3.9 pin fiona<1.10.0 #187

Merged
merged 5 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions python/ngen_cal/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ install_requires =
pydantic<2
pandas>=1.1.2
geopandas
fiona<1.10.0; python_version < "3.9"
matplotlib
hydrotools.metrics
hydrotools.nwis_client
Expand Down
60 changes: 55 additions & 5 deletions python/ngen_conf/src/ngen/config/cfe.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,65 @@

from .bmi_formulation import BMIC


class CFEParams(BaseModel):
"""Class for validating CFE Parameters
"""
maxsmc: Optional[float]
"""Class for validating CFE Parameters"""

b: Optional[float]
"""Pore size distribution index"""
satdk: Optional[float]
"""Saturated hydraulic conductivity"""
satpsi: Optional[float]
"""saturated capillary head"""
slope: Optional[float]
bb: Optional[float]
multiplier: Optional[float]
"""Linear scaling of "openness" of bottom drainage boundary"""
maxsmc: Optional[float]
"""saturated soil moisture content"""
wltsmc: Optional[float]
"""wilting point soil moisture content"""
refkdt: Optional[float]
"""
Surface runoff parameter; REFKDT is a tuneable parameter that significantly
impacts surface infiltration and hence the partitioning of total runoff into
surface and subsurface runoff. Increasing REFKDT decreases surface runoff
"""
aaraney marked this conversation as resolved.
Show resolved Hide resolved
expon: Optional[float]
"""soil primary outlet coefficient"""
max_gw_storage: Optional[float]
"""Maximum groundwater storage"""
cgw: Optional[float]
"""Coefficent for the groundwater equation"""
alpha_fc: Optional[float]
"""field_capacity_atm_press_fraction (alpha_fc)"""
kn: Optional[float]
"""Nash coefficient for subsurface lateral flow through Nash cascade"""
klf: Optional[float]
"""Nash coefficient that determines the volume of lateral flow"""
kinf_nash_surface: Optional[float]
"""Storage fraction per hour that moves from Nash surface reservoirs to soil"""
aaraney marked this conversation as resolved.
Show resolved Hide resolved
retention_depth_nash_surface: Optional[float]
"""Water retention depth threshold (only applied to the first reservoir)"""
aaraney marked this conversation as resolved.
Show resolved Hide resolved
a_xinanjiang_inflection_point_parameter: Optional[float]
"""Contributing area curve inflection point"""
b_xinanjiang_shape_parameter: Optional[float]
"""Contributing area curve shape parameter"""
x_xinanjiang_shape_parameter: Optional[float]
"""Contributing area curve shape parameter"""

class Config(BaseModel.Config):
allow_population_by_field_name = True
fields = {
"cgw": {"alias": "Cgw"},
"kn": {"alias": "Kn"},
"klf": {"alias": "Klf"},
"kinf_nash_surface": {"alias": "Kinf_nash_surface"},
"a_xinanjiang_inflection_point_parameter": {
"alias": "a_Xinanjiang_inflection_point_parameter"
},
"b_xinanjiang_shape_parameter": {"alias": "b_Xinanjiang_shape_parameter"},
"x_xinanjiang_shape_parameter": {"alias": "x_Xinanjiang_shape_parameter"},
}


class CFE(BMIC):
"""A BMIC implementation for the CFE ngen module
Expand Down
47 changes: 46 additions & 1 deletion python/ngen_conf/src/ngen/config/lgar.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,58 @@
from __future__ import annotations

from pydantic import Field
from typing import Optional
from pydantic import BaseModel, Field

from .bmi_formulation import BMICxx


class LgarParams(BaseModel):
smcmin: Optional[float]
"""
residual volumetric water content
Unit: cm3/cm3
"""
smcmax: Optional[float]
"""
water content of the soil at natural saturation;
Unit: cm3/cm3
"""
van_genuchten_alpha: Optional[float]
"""
van Genuchten parameter related to inverse of air entry pressure
Unit: 1/cm
"""
van_genuchten_n: Optional[float]
"""
van Genuchten parameter related to pore size distribution
Unit: -
"""
hydraulic_conductivity: Optional[float]
"""
saturated hydraulic conductivity of the soil
Unit: cm/h
"""
soil_depth_layers: Optional[float]
"""
soil layer thickness
Unit: cm
"""
ponded_depth_max: Optional[float]
"""
maximum allowed ponded water depth
Unit: cm
"""
field_capacity: Optional[float]
"""
negative capillary head representing field capacity, used in reduction of PET to AET
Unit: cm
"""


class LGAR(BMICxx):
"""A BMIC++ implementation for LGAR module"""

model_params: Optional[LgarParams]
registration_function: str = "none"
main_output_variable: str = "precipitation_rate"
model_name: str = Field("LGAR", const=True, alias="model_type_name")
Expand Down
36 changes: 33 additions & 3 deletions python/ngen_conf/src/ngen/config/topmod.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,44 @@

from .bmi_formulation import BMIC


class TopmodParams(BaseModel):
"""Class for validating Topmod Parameters
"""Class for validating Topmod Parameters"""
szm: Optional[float]
"""
Exponential scaling parameter for decline of transmissivity with increase in storage deficit
Unit: meters (m)
"""
sr0: Optional[float]
"""
initial root zone storage deficit
Unit: meters (m)
"""
srmax: Optional[float]
szm: Optional[float]
t0: Optional[float]
"""
Maximum capacity of the root zone (Available water capacity to plants)
Unit: meters (m)
"""
td: Optional[float]
"""
Time delay for recharge to the saturated zone per unit of deficit
Unit: hours (h)
"""
t0: Optional[float]
"""
natural log of downslope transmissivity when the soil is just saturated to the surface (corresponds to transmissivities of 0.000335 and 2980.96 m/h)
Unit: meters per hour (m/h)
"""
chv: Optional[float]
"""
Average channel flow velocity
Unit: meters per hour (m/h)
"""
rv: Optional[float]
"""
Internal overland flow routing velocity
Unit: meters per hour (m/h)
"""

class Topmod(BMIC):
"""A BMIC implementation for the Topmod ngen module
Expand Down
Loading