Skip to content

Commit

Permalink
Fixed broken diffusive routing in Lower Colorado example (NOAA-OWP#805)
Browse files Browse the repository at this point in the history
* Fixed broken diffusive routing in Lower Colorado example

* Fixed bug: link_lake_crosswalk issue

* Fixed missing argument for duplicate_ids_df in V3
  • Loading branch information
JurgenZach-NOAA authored Jul 19, 2024
1 parent a9537c4 commit 4e17d80
Show file tree
Hide file tree
Showing 33 changed files with 14 additions and 11 deletions.
3 changes: 3 additions & 0 deletions src/troute-nwm/src/nwm_routing/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1789,6 +1789,8 @@ def main_v03(argv):
if (not kernelTalks):
logFileName = 'NONE'

duplicate_ids_df = pd.DataFrame()

nwm_output_generator(
run,
run_results,
Expand All @@ -1802,6 +1804,7 @@ def main_v03(argv):
cpu_pool,
waterbodies_df,
waterbody_types_df,
duplicate_ids_df,
data_assimilation_parameters,
lastobs_df,
link_gage_df,
Expand Down
4 changes: 2 additions & 2 deletions src/troute-nwm/src/nwm_routing/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def nwm_output_generator(
d_df = flow_df.iloc[:,2::3]

# replace waterbody lake_ids with outlet link ids
if link_lake_crosswalk:
if (link_lake_crosswalk):
flowveldepth = _reindex_lake_to_link_id(flowveldepth, link_lake_crosswalk)

# todo: create a unit test by saving FVD array to disk and then checking that
Expand Down Expand Up @@ -391,7 +391,7 @@ def nwm_output_generator(
# usgs_df_filtered.to_csv(output_path.joinpath("usgs_df.csv"))

if chano:

LOG.info("- writing t-route flow results at gage locations to CHANOBS file")
start = time.time()

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified test/LowerColorado_TX/domain/LAKEPARM.nc
Binary file not shown.
Binary file modified test/LowerColorado_TX/domain/RouteLink.nc
Binary file not shown.
18 changes: 9 additions & 9 deletions test/LowerColorado_TX/test_AnA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ compute_parameters:
restart_parameters:
#----------
start_datetime: 2021-08-23_13:00
wrf_hydro_channel_restart_file : restart/HYDRO_RST.2021-08-23_12:00_DOMAIN1
#wrf_hydro_channel_restart_file : restart/HYDRO_RST.2021-08-23_12:00_DOMAIN1
#lite_channel_restart_file : restart/RESTART.2020082600_DOMAIN1
wrf_hydro_channel_ID_crosswalk_file : domain/RouteLink.nc
wrf_hydro_waterbody_restart_file : restart/HYDRO_RST.2021-08-23_12:00_DOMAIN1
#wrf_hydro_waterbody_restart_file : restart/HYDRO_RST.2021-08-23_12:00_DOMAIN1
#lite_waterbody_restart_file : restart/waterbody_restart_202006011200
wrf_hydro_waterbody_ID_crosswalk_file : domain/LAKEPARM.nc
wrf_hydro_waterbody_crosswalk_filter_file: domain/RouteLink.nc
hybrid_parameters:
run_hybrid_routing: False
run_hybrid_routing: True
diffusive_domain : domain/coastal_domain_subset.yaml
use_natl_xsections: False
topobathy_domain : domain/final_diffusive_natural_xs.nc
Expand Down Expand Up @@ -80,7 +80,7 @@ compute_parameters:
reservoir_persistence_usace : True
gage_lakeID_crosswalk_file : domain/reservoir_index_AnA.nc
#--------------------------------------------------------------------------------
# output_parameters:
output_parameters:
# #----------
# test_output: output/lcr_flowveldepth.pkl
# lite_restart:
Expand All @@ -94,9 +94,9 @@ compute_parameters:
# chanobs_output_directory: output/
# chanobs_filepath : lcr_chanobs.nc
# lakeout_output: lakeout/
# stream_output:
# stream_output_directory: output/
# stream_output_time: 1 #[hr]
# stream_output_type: '.nc' #please select only between netcdf '.nc' or '.csv' or '.pkl'
# stream_output_internal_frequency: 60 #[min] it should be order of 5 minutes. For instance if you want to output every hour put 60
stream_output:
stream_output_directory: output/
stream_output_time: 1 #[hr]
stream_output_type: '.nc' #please select only between netcdf '.nc' or '.csv' or '.pkl'
stream_output_internal_frequency: 60 #[min] it should be order of 5 minutes. For instance if you want to output every hour put 60

0 comments on commit 4e17d80

Please sign in to comment.