Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
28 changes: 28 additions & 0 deletions src/icefabric/modules/divide_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ class DivideAttributesNHF(enum.Enum):
NOV = "temp_delta_nov_mean"
DEC = "temp_delta_dec_mean"
QUARTZ = "quartz_mean"
THETA_R = "theta_r"
THETA_E = "theta_e"
ALPHA = "alpha"
N = "n"
KS = "Ks"


class ParametersToDivideAttributesNHF:
Expand Down Expand Up @@ -157,6 +162,11 @@ class ParametersToDivideAttributesNHF:
"max_gw_storage": DivideAttributesNHF.ZMAX.value,
"Cgw": DivideAttributesNHF.COEFF.value,
"expon": DivideAttributesNHF.EXPON.value,
"theta_r": DivideAttributesNHF.THETA_R.value,
"theta_e": DivideAttributesNHF.THETA_E.value,
"alpha": DivideAttributesNHF.ALPHA.value,
"n": DivideAttributesNHF.N.value,
"Ks": DivideAttributesNHF.KS.value,
}


Expand Down Expand Up @@ -190,4 +200,22 @@ class ParametersToDivideAttributesHF:
"max_gw_storage": DivideAttributesHF.ZMAX.value,
"Cgw": DivideAttributesHF.COEFF.value,
"expon": DivideAttributesHF.EXPON.value,
"theta_r": "theta_r",
"theta_e": "theta_e",
"alpha": "alpha",
"n": "n",
"Ks": "Ks",
}


class LASAMParameters:
"""LASAM paramters based on soil type (ISLTYP) from https://github.com/NOAA-OWP/LGAR-C/blob/master/data/vG_default_params.dat"""

lasam_params = {
"isltyp_mode": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
"theta_r": [0.05, 0.05, 0.04, 0.07, 0.05, 0.06, 0.06, 0.09, 0.08, 0.12, 0.11, 0.1],
"theta_e": [0.38, 0.39, 0.39, 0.44, 0.49, 0.4, 0.38, 0.48, 0.44, 0.39, 0.48, 0.46],
"alpha": [0.04, 0.03, 0.03, 0.01, 0.01, 0.01, 0.02, 0.01, 0.02, 0.03, 0.02, 0.01],
"n": [3.18, 1.75, 1.45, 1.66, 1.68, 1.47, 1.33, 1.52, 1.42, 1.21, 1.32, 1.25],
"Ks": [26.64, 4.32, 1.584, 0.756, 1.836, 0.504, 0.54, 0.468, 0.3348, 0.468, 0.432, 0.612],
}
10 changes: 10 additions & 0 deletions src/icefabric/modules/get_parameter_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from icefabric.modules.create_ipes import get_subset
from icefabric.modules.divide_attributes import (
LASAMParameters,
ParametersToDivideAttributesHF,
ParametersToDivideAttributesNHF,
)
Expand Down Expand Up @@ -90,6 +91,15 @@ def get_parameter_metadata(
else:
divide_attrs = pd.DataFrame(gauge["divides"])

if gage_id is not None and "lasam" in modules:
lasam_params = pd.DataFrame(LASAMParameters.lasam_params)

# For HF 2.2, the ISLTYP column name differs from NHF's "isltyp_mode"
if not domain.is_nhf and "mode.ISLTYP" in divide_attrs.columns:
divide_attrs = divide_attrs.rename(columns={"mode.ISLTYP": "isltyp_mode"})

divide_attrs = pd.merge(divide_attrs, lasam_params, on="isltyp_mode", how="outer")

output_list = []

for module in modules:
Expand Down
Loading