Skip to content

Commit

Permalink
reverted back the formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
karnesh committed May 20, 2024
1 parent 8b5ac0f commit c81c2ce
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/troute-config/troute/config/output_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,6 @@ def validate_stream_output_internal_frequency(cls, value, values):
raise ValueError("stream_output_internal_frequency should be less than or equal to stream_output_time in minutes.")
return value


OutputParameters.update_forward_refs()
WrfHydroParityCheck.update_forward_refs()
17 changes: 10 additions & 7 deletions src/troute-nwm/src/nwm_routing/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def nwm_output_generator(
link_gage_df = None,
link_lake_crosswalk = None,
):

dt = run.get("dt")
nts = run.get("nts")
t0 = run.get("t0")
Expand Down Expand Up @@ -237,8 +238,9 @@ def nwm_output_generator(

# replace waterbody lake_ids with outlet link ids
if link_lake_crosswalk:

# (re) set the flowveldepth index
courant.set_index(fvdidxs, inplace=True)
courant.set_index(fvdidxs, inplace = True)

LOG.debug("Constructing the FVD DataFrame took %s seconds." % (time.time() - start))

Expand Down Expand Up @@ -268,7 +270,7 @@ def nwm_output_generator(
time_index, tmp_variable = map(list,zip(*i_df.columns.tolist()))
LOG.info("- writing t-route flow results to LAKEOUT files")
start = time.time()
for i in range(i_df.shape[1]):
for i in range(i_df.shape[1]):
nhd_io.write_waterbody_netcdf(
wbdyo,
i_df.iloc[:,[i]],
Expand Down Expand Up @@ -334,6 +336,7 @@ def nwm_output_generator(
)

if chrtout_read_folder:

chrtout_files = sorted(
Path(chrtout_read_folder) / f for f in run["qlat_files"]
)
Expand Down Expand Up @@ -451,9 +454,9 @@ def nwm_output_generator(
# rather than just printing at gages.
)

LOG.debug("writing flow data to CHANOBS took %s seconds." % (time.time() - start))
if lastobso:
LOG.debug("writing flow data to CHANOBS took %s seconds." % (time.time() - start))

if lastobso:
# Write out LastObs as netcdf when using main_v04 or troute_model with HYfeature.
# This is only needed if 1) streamflow nudging is ON and 2) a lastobs output
# folder is provided by the user.
Expand Down Expand Up @@ -497,9 +500,9 @@ def nwm_output_generator(
)

start_time = time.time()

parity_check(
parity_set, results,
)

LOG.debug("parity check complete in %s seconds." % (time.time() - start_time))

0 comments on commit c81c2ce

Please sign in to comment.