Skip to content

Commit

Permalink
Calculate lake count correctly, update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rcabell committed Oct 24, 2024
1 parent 2030921 commit 41460a2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/Routing/module_RT.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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,&
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/Routing/module_channel_routing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
4 changes: 2 additions & 2 deletions tests/ctests/setup_cmake_testcase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 41460a2

Please sign in to comment.