Skip to content

Commit

Permalink
Reset lake_opt from 3 to 1 after setting DA flag
Browse files Browse the repository at this point in the history
  • Loading branch information
rcabell authored and scrasmussen committed Nov 6, 2024
1 parent e6b1cb6 commit f958e17
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/OrchestratorLayer/config.F90
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,8 @@ subroutine init_namelist_rt_field(did)
integer, intent(in) :: did

integer ierr
character(len=512) :: msg

integer:: RT_OPTION, CHANRTSWCRT, channel_option, &
SUBRTSWCRT,OVRTSWCRT,AGGFACTRT, &
GWBASESWCRT, GW_RESTART,RSTRT_SWC,TERADJ_SOLAR, &
Expand Down Expand Up @@ -702,17 +704,17 @@ subroutine init_namelist_rt_field(did)
#else
open(12, form="FORMATTED")
#endif
read(12, HYDRO_nlist, iostat=ierr)
if(ierr .ne. 0) call hydro_stop("HYDRO_nlst namelist error in read_rt_nlst")
read(12, HYDRO_nlist, iostat=ierr, iomsg=msg)
if(ierr .ne. 0) call hydro_stop("HYDRO_nlst namelist error in read_rt_nlst: " // trim(msg))

if (lake_option == 3) then
read(12, reservoir_nlist, iostat=ierr)
if (ierr /= 0) call hydro_stop("reservoir_nlist namelist error in read_rt_nlst")
read(12, reservoir_nlist, iostat=ierr, iomsg=msg)
if (ierr /= 0) call hydro_stop("reservoir_nlist namelist error in read_rt_nlst: " // trim(msg))
end if

#ifdef WRF_HYDRO_NUDGING
read(12, NUDGING_nlist, iostat=ierr)
if(ierr .ne. 0) call hydro_stop("NUDGING_nlst namelist error in read_rt_nlst")
read(12, NUDGING_nlist, iostat=ierr, iomsg=msg)
if(ierr .ne. 0) call hydro_stop("NUDGING_nlst namelist error in read_rt_nlst: " // trim(msg))
!! Conditional default values for nuding_nlist
if(maxAgePairsBiasPersist .eq. -99999) maxAgePairsBiasPersist = -1*nLastObs
#endif
Expand Down Expand Up @@ -756,6 +758,11 @@ subroutine init_namelist_rt_field(did)
nlst(did)%SOLVEG_INITSWC = SOLVEG_INITSWC
nlst(did)%reservoir_obs_dir = "testDirectory"

if ((lake_option == 3) .and. (reservoir_persistence_usgs .or. reservoir_persistence_usace .or. reservoir_rfc_forecasts)) then
reservoir_type_specified = .TRUE.
lake_option = 1
end if

nlst(did)%lake_option = lake_option
nlst(did)%reservoir_persistence_usgs = reservoir_persistence_usgs
nlst(did)%reservoir_persistence_usace = reservoir_persistence_usace
Expand All @@ -768,10 +775,6 @@ subroutine init_namelist_rt_field(did)
nlst(did)%reservoir_rfc_forecasts_time_series_path = reservoir_rfc_forecasts_time_series_path
nlst(did)%reservoir_rfc_forecasts_lookback_hours = reservoir_rfc_forecasts_lookback_hours

if ((lake_option == 3) .and. (reservoir_persistence_usgs .or. reservoir_persistence_usace .or. reservoir_rfc_forecasts)) then
reservoir_type_specified = .TRUE.
end if

nlst(did)%reservoir_type_specified = reservoir_type_specified

write(nlst(did)%hgrid,'(I1)') igrid
Expand Down
1 change: 1 addition & 0 deletions src/Routing/Reservoirs/Level_Pool/module_levelpool.F90
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ subroutine LEVELPOOL_PHYSICS(ln,lake_opt,qi0,qi1,qo1,ql,dt,H,ar,we,maxh,wc,wl,dl


else ! ELSE for LAKE_OPT....
call hydro_stop("Invalid lake option supplied to LEVELPOOL_PHYSICS()")
endif ! ENDIF for LAKE_OPT....

return
Expand Down

0 comments on commit f958e17

Please sign in to comment.