Skip to content

Commit f142696

Browse files
Add support for Total Runoff (RNF) output variable
1 parent f0fa3f3 commit f142696

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

rubem/_dynamic_model.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def __getEnabledOutputVars(self):
6767
"rec": self.config.output_variables.rec,
6868
"smc": self.config.output_variables.smc,
6969
"rnf": self.config.output_variables.rnf,
70+
"arn": self.config.output_variables.arn,
7071
}
7172

7273
def __stepUpdateOutputVars(self):
@@ -78,7 +79,8 @@ def __stepUpdateOutputVars(self):
7879
"lfw": self.LF,
7980
"rec": self.REC,
8081
"smc": self.TUr,
81-
"rnf": self.runoff,
82+
"rnf": self.Qtot,
83+
"arn": self.runoff,
8284
}
8385

8486
def __stepReport(self):
@@ -129,6 +131,12 @@ def __setupTimeoutputTimeseries(self):
129131
self.config.raster_files.sample_locations,
130132
noHeader=True,
131133
)
134+
self.TssFileAccRun = pcrfw.TimeoutputTimeseries(
135+
"tss_arn",
136+
self,
137+
self.config.raster_files.sample_locations,
138+
noHeader=True,
139+
)
132140
self.TssFileInt = pcrfw.TimeoutputTimeseries(
133141
"tss_itp",
134142
self,
@@ -181,6 +189,7 @@ def __setupTimeoutputTimeseries(self):
181189
"rec": self.TssFileRec.sample,
182190
"smc": self.TssFileSsat.sample,
183191
"rnf": self.TssFileRun.sample,
192+
"arn": self.TssFileAccRun.sample,
184193
}
185194
# Information for output, get sample location numbers - integer,
186195
# from 1 to n

rubem/configuration/model_configuration.py

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ def __init__(
110110
rec=str_to_bool(self.__get_setting("GENERATE_FILE", "rec")),
111111
smc=str_to_bool(self.__get_setting("GENERATE_FILE", "smc")),
112112
rnf=str_to_bool(self.__get_setting("GENERATE_FILE", "rnf")),
113+
arn=str_to_bool(self.__get_setting("GENERATE_FILE", "arn")),
113114
tss=str_to_bool(self.__get_setting("GENERATE_FILE", "tss")),
114115
output_format=(
115116
OutputFileFormat.PCRASTER

rubem/configuration/output_variables.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ class OutputVariables:
2828
:param smc: Enable or disable Soil Moisture Content (SMC). Defaults to `False`.
2929
:type smc: bool, optional
3030
31-
:param rnf: Enable or disable Accumulated Total Runoff (RNF). Defaults to `False`.
31+
:param rnf: Enable or disable Total Runoff (RNF). Defaults to `False`.
32+
:type rnf: bool, optional
33+
34+
:param rnf: Enable or disable Accumulated Total Runoff (ARN). Defaults to `False`.
3235
:type rnf: bool, optional
3336
3437
:param tss: Enable or disable Create time output time series (TSS). Defaults to `False`.
@@ -48,6 +51,7 @@ def __init__(
4851
rec: bool = False,
4952
smc: bool = False,
5053
rnf: bool = False,
54+
arn: bool = False,
5155
tss: bool = False,
5256
output_format: OutputFileFormat = OutputFileFormat.PCRASTER,
5357
) -> None:
@@ -60,6 +64,7 @@ def __init__(
6064
self.rec = rec
6165
self.smc = smc
6266
self.rnf = rnf
67+
self.arn = arn
6368
self.tss = tss
6469
self.file_format = output_format
6570

@@ -72,6 +77,7 @@ def __init__(
7277
and not self.rec
7378
and not self.smc
7479
and not self.rnf
80+
and not self.arn
7581
):
7682
self.logger.warning("No output variables selected.")
7783

@@ -84,6 +90,7 @@ def __str__(self) -> str:
8490
f"Lateral Flow (LFW): {'Enabled' if self.lfw else 'Disabled'}\n"
8591
f"Recharge (REC): {'Enabled' if self.rec else 'Disabled'}\n"
8692
f"Soil Moisture Content (SMC): {'Enabled' if self.smc else 'Disabled'}\n"
93+
f"Total Runoff (RNF): {'Enabled' if self.rnf else 'Disabled'}\n"
8794
f"Accumulated Total Runoff (RNF): {'Enabled' if self.rnf else 'Disabled'}\n"
8895
f"Create time output time series (TSS): {'Enabled' if self.tss else 'Disabled'}\n"
8996
f"Output format: {self.file_format}"

0 commit comments

Comments
 (0)