From 41460a2d9c74525cb74f3fa19faf285330bc0f6a Mon Sep 17 00:00:00 2001 From: Ryan Cabell Date: Wed, 23 Oct 2024 19:36:33 -0600 Subject: [PATCH] Calculate lake count correctly, update tests --- .github/workflows/test-pr.yml | 6 +++--- src/Routing/module_RT.F90 | 4 ++-- src/Routing/module_channel_routing.F90 | 2 +- tests/ctests/setup_cmake_testcase.sh | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index 973a5926e..fbcfd3b09 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -2,9 +2,9 @@ name: build on: push: - branches: [ main, v5.2.x ] + branches: [ main ] pull_request: - branches: [ main, v5.2.x ] + branches: [ main ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - configuration: [nwm_ana, nwm_long_range, gridded, reach] + configuration: [nwm_ana, nwm_long_range, gridded, reach, reach_lakes] runs-on: ubuntu-latest env: diff --git a/src/Routing/module_RT.F90 b/src/Routing/module_RT.F90 index 5ae1c46fb..aa137c5fa 100644 --- a/src/Routing/module_RT.F90 +++ b/src/Routing/module_RT.F90 @@ -559,7 +559,7 @@ subroutine getChanDim(did) rt_domain(did)%GNLINKSL = 1 rt_domain(did)%NLINKSL = 1 endif - if(nlst(did)%UDMP_OPT .eq. 1) & + if(nlst(did)%UDMP_OPT .eq. 1 .or. nlst(did)%channel_option .eq. 1 .or. nlst(did)%channel_option .eq. 2) & call read_NSIMLAKES(rt_domain(did)%NLAKES,nlst(did)%route_lake_f) call rt_allocate(did,rt_domain(did)%ix,rt_domain(did)%jx,& @@ -615,7 +615,7 @@ subroutine getChanDim(did) endif -if(nlst(did)%UDMP_OPT .eq. 1) then +if(nlst(did)%UDMP_OPT .eq. 1 .or. nlst(did)%channel_option .eq. 1 .or. nlst(did)%channel_option .eq. 2) then call read_NSIMLAKES(rt_domain(did)%NLAKES,nlst(did)%route_lake_f) endif diff --git a/src/Routing/module_channel_routing.F90 b/src/Routing/module_channel_routing.F90 index 454e4103e..c9d64962a 100644 --- a/src/Routing/module_channel_routing.F90 +++ b/src/Routing/module_channel_routing.F90 @@ -834,7 +834,7 @@ Subroutine drive_CHANNEL(did, latval,lonval,KT, IXRT,JXRT, SUBRTSWCRT, & if(TYPEL(k) == 1) then !--link is a reservoir l_idx = lake_lookup(k) if (l_idx >= 0) then !-- -999 if not a reservoir in the lookup table (belt-and-suspenders check) - call rt_domain(did)%reservoirs(lakeid)%ptr%run(Qup, Quc, 0.0, & + call rt_domain(did)%reservoirs(l_idx)%ptr%run(Qup, Quc, 0.0, & RESHT(l_idx), QLINK(k,2), DTRT_CH, rt_domain(did)%final_reservoir_type(l_idx), & rt_domain(did)%reservoir_assimilated_value(l_idx), rt_domain(did)%reservoir_assimilated_source_file(l_idx)) diff --git a/tests/ctests/setup_cmake_testcase.sh b/tests/ctests/setup_cmake_testcase.sh index 8b6aedeb6..0ac062da0 100644 --- a/tests/ctests/setup_cmake_testcase.sh +++ b/tests/ctests/setup_cmake_testcase.sh @@ -38,11 +38,11 @@ test_file_dir=${binary_dir}/tests run_dir=${binary_dir}/Run # download testcase if not present -croton_tarball=croton_NY_training_example_v5.2.tar.gz +croton_tarball=croton_NY_training_example_v5.3.tar.gz if [ ! -f ${test_file_dir}/${croton_tarball} ] then cd ${test_file_dir} - wget -nv https://github.com/NCAR/wrf_hydro_nwm_public/releases/download/v5.2.0/${croton_tarball} + wget -nv https://github.com/NCAR/wrf_hydro_nwm_public/releases/download/v5.3.0/${croton_tarball} fi # extract testcase