Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finalized implementation of new lake shape options in the levelpool simulations #508

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
adjustments made to levelpool physics and also reading the new variab…
…les from LAKEPARM file
Bahram Khazaei committed Jul 24, 2020
commit 5a708d2d1665738cacb5d0ea04974cfef63c3bee
2 changes: 1 addition & 1 deletion trunk/NDHMS/Data_Rec/module_namelist.F
Original file line number Diff line number Diff line change
@@ -807,7 +807,7 @@ subroutine rt_nlst_check(nlst)
if (.not. fileExists) call hydro_stop('hydro.namelist ERROR: reservoir_parameter_file not found.')
endif
end if
if( (nlst%lake_shape_option .lt. 0 ) .or. (nlst%lake_shape_option .gt. 5) ) then
if( (nlst%lake_shape_option .lt. 0 ) .or. (nlst%lake_shape_option .gt. 3) ) then
call hydro_stop('hydro.namelist ERROR: Invalid lake_shape_option specified')
endif
if(nlst%reservoir_persistence_usgs) then
2 changes: 1 addition & 1 deletion trunk/NDHMS/OrchestratorLayer/config.f90
Original file line number Diff line number Diff line change
@@ -414,7 +414,7 @@ subroutine rt_nlst_check(self)
if (.not. fileExists) call hydro_stop('hydro.namelist ERROR: reservoir_parameter_file not found.')
endif
end if
if( (self%lake_shape_option .lt. 0 ) .or. (self%lake_shape_option .gt. 5) ) then
if( (self%lake_shape_option .lt. 0 ) .or. (self%lake_shape_option .gt. 3) ) then
call hydro_stop('hydro.namelist ERROR: Invalid lake_shape_option specified')
endif
if(self%reservoir_persistence_usgs) then
85 changes: 38 additions & 47 deletions trunk/NDHMS/Routing/Reservoirs/Level_Pool/module_levelpool.F
Original file line number Diff line number Diff line change
@@ -259,11 +259,9 @@ subroutine LEVELPOOL_PHYSICS(ln,qi0,qi1,qo1,ql,dt,H,ar,we,maxh,wc,wl,dl,oe,oc,oa
! lake_shape_option options:
! -1 ---> Simple pass through scheme
! 0 ---> BOX shape with depth based on active reservoir depth (NWM v1.x - v2.1)
! 1 ---> BOX shape with depth based on full lake depth
! 2 ---> CONIC shape with depth based on full lake depth
! 3 ---> RECTANGLUAR PRISM shape with depth based on full lake depth
! 4 ---> ELLIPSOID shape with depth based on full lake depth
! 5 ---> H-A-V RELATIONSHIP depth based on full lake depth
! 1 ---> CONIC shape with depth based on full lake depth
! 2 ---> RECTANGLUAR PRISM shape with depth based on full lake depth
! 3 ---> H-A-V RELATIONSHIP based on full lake depth

!! ---------------------------- local variables
real :: Htmp ! Temporary assign of incoming lake el. (m)
@@ -273,8 +271,11 @@ subroutine LEVELPOOL_PHYSICS(ln,qi0,qi1,qo1,ql,dt,H,ar,we,maxh,wc,wl,dl,oe,oc,oa
real :: tmp1, tmp2
real :: dh, dh1, dh2, dh3 ! Depth in weir, and height function for 3 order RK
real :: It, Itdt_3, Itdt_2_3 ! inflow hydrographs
real :: maxWeirDepth !maximum capacity of weir
!real :: hdiff_vol, qdiff_vol ! water balance check variables
real :: maxWeirDepth ! maximum capacity of weir
real :: hin ! initial depth in storage from lake bottom (m)
real :: Dactivepool ! active depth in storage (m)
real :: LkBottom ! lake bottom elevation ASL (m)
!real :: hdiff_vol, qdiff_vol ! water balance check variables
!! ---------------------------- subroutine body: from chow, mad mays. pg. 252
!! -- determine from inflow hydrograph

@@ -294,14 +295,12 @@ subroutine LEVELPOOL_PHYSICS(ln,qi0,qi1,qo1,ql,dt,H,ar,we,maxh,wc,wl,dl,oe,oc,oa

else ! If-block for Chow et al level pool scheme

! Define reservoir max depth and rescale orifice and weir elevation
! if using lake_shape_option >= 1:
if (lake_shape_option == 0) then ! define max depth based on active reservoir depth (NWM v1.x - v2.1)
! ADD ADJUSTENTS FOR LAKE_SHAPE_OPT = 0 HERE!
else ! define max depth based on full lake depth
! ADD ADJUSTENTS FOR LAKE_SHAPE_OPT > 0 HERE!
endif
! Water depth in reservoir from lake bottom:
Dactivepool = (maxh - oe) * 3.
LkBottom = maxh - Dactivepool
hin = maxdepth - Dactivepool + (H - LkBottom)

! Inflow calculations:
It = qi0
Itdt_3 = qi0 + ((qi1 + ql - qi0) * 0.33)
Itdt_2_3 = qi0 + ((qi1 + ql - qi0) * 0.67)
@@ -334,7 +333,7 @@ subroutine LEVELPOOL_PHYSICS(ln,qi0,qi1,qo1,ql,dt,H,ar,we,maxh,wc,wl,dl,oe,oc,oa

if (sap > 0) then
!dh1 = ((It - discharge)/sap)*dt
call STAGE_STORAGE(dh1,maxdepth,H,It,discharge,sap,vtp,dt,lake_shape_option,polya,polya)
call STAGE_STORAGE(dh1,maxdepth,hin,It,discharge,sap,vtp,dt,lake_shape_option,polya,polyb)
else
dh1 = 0.0
endif
@@ -363,7 +362,7 @@ subroutine LEVELPOOL_PHYSICS(ln,qi0,qi1,qo1,ql,dt,H,ar,we,maxh,wc,wl,dl,oe,oc,oa

if (sap > 0.0) then
!dh2 = ((Itdt_3 - discharge)/sap)*dt
call STAGE_STORAGE(dh2,maxdepth,H,Itdt_3,discharge,sap,vtp,dt,lake_shape_option,polya,polya)
call STAGE_STORAGE(dh2,maxdepth,hin,Itdt_3,discharge,sap,vtp,dt,lake_shape_option,polya,polyb)
else
dh2 = 0.0
endif
@@ -391,7 +390,7 @@ subroutine LEVELPOOL_PHYSICS(ln,qi0,qi1,qo1,ql,dt,H,ar,we,maxh,wc,wl,dl,oe,oc,oa

if (sap > 0.0) then
!dh3 = ((Itdt_2_3 - discharge)/sap)*dt
call STAGE_STORAGE(dh3,maxdepth,H,Itdt_2_3,discharge,sap,vtp,dt,lake_shape_option,polya,polya)
call STAGE_STORAGE(dh3,maxdepth,hin,Itdt_2_3,discharge,sap,vtp,dt,lake_shape_option,polya,polyb)
else
dh3 = 0.0
endif
@@ -439,9 +438,7 @@ subroutine LEVELPOOL_PHYSICS(ln,qi0,qi1,qo1,ql,dt,H,ar,we,maxh,wc,wl,dl,oe,oc,oa
!24 format('ofonl H dh sap Q ',f8.4,2x,f8.4,2x,f8.0,2x,f8.2)

endif ! ENDIF for lake_shape_option....
!print *, "TEST STAGE_STORAGE..."
!print *, dh, dh1, dh2, dh3
!print *, dh, dh1_test, dh2_test, dh3_test

return

! ----------------------------------------------------------------
@@ -453,15 +450,14 @@ end subroutine LEVELPOOL_PHYSICS
! ------------------------------------------------
! This subroutine calculates change in sotrage water level (Deltah) given the initial water level (h1),
! reservoir shape option (lake_shape_option), inflow (Inflow_dt), and discharge (res_discharge), and surface area (surf_area)
subroutine STAGE_STORAGE(Deltah,Dmax,h1,Inflow_dt,res_discharge,surf_area,total_vol, &
subroutine STAGE_STORAGE(Deltah,Dmax, h1,Inflow_dt,res_discharge,surf_area,total_vol, &
Deltat,LAKE_SHAPE_OPT, polyhV_a, polyhV_b)

!! ---------------------------- argument variables
!! All elevations should be relative to a common base (often belev(k))

real, intent(OUT) :: Deltah ! change in sotrage water level (m)
real, intent(IN) :: Dmax ! Maximum depth of reservoir (m)
real, intent(IN) :: h1 ! initial water level (m)
real, intent(IN) :: Inflow_dt ! inflow (m^3/s)
real, intent(IN) :: res_discharge ! storage discharge (m^3/s)
real, intent(IN) :: surf_area ! surface area (m2)
@@ -471,50 +467,45 @@ subroutine STAGE_STORAGE(Deltah,Dmax,h1,Inflow_dt,res_discharge,surf_area,total_
real, intent(IN) :: polyhV_b ! coefficient b in polynomial function V=a*h^b
integer, intent(IN) :: LAKE_SHAPE_OPT ! LAKE_SHAPE_OPT (lake_shape_option) options from namelist:
! 0 ---> BOX shape with depth based on active reservoir depth (NWM v1.x - v2.1)
! 1 ---> BOX shape with depth based on full lake depth
! 2 ---> CONIC shape with depth based on full lake depth
! 3 ---> RECTANGLUAR PRISM shape with depth based on full lake depth
! 4 ---> ELLIPSOID shape with depth based on full lake depth
! 5 ---> H-A-V RELATIONSHIP depth based on full lake depth
! 1 ---> CONIC shape with depth based on full lake depth
! 2 ---> RECTANGLUAR PRISM shape with depth based on full lake depth
! 3 ---> H-A-V RELATIONSHIP based on full lake depth

!! ---------------------------- local variables
real, parameter :: pi = 3.14159265
real :: R_cone ! cone base radius (m)
real :: S1 ! initial reservoir storage (m3)
real :: S2 ! reservoir storage after change (m3)
real :: dS ! change in reservoir storage (m3)
real :: h2 ! cone base radius (m)
real :: h1 ! initial depth in storage (m)
real :: h2 ! final depth in storage (m)
!! ----------------------------

! change in storage (m3)
dS = (Inflow_dt - res_discharge)*Deltat

if ( (LAKE_SHAPE_OPT == 0) .OR. (LAKE_SHAPE_OPT == 1) ) then ! BOX shape
if (LAKE_SHAPE_OPT == 0) then ! BOX shape
h2 = (dS / surf_area) + h1

elseif (LAKE_SHAPE_OPT == 2) then ! CONIC shape
R_cone = (surf_area/pi)**0.5 ! cone base radius (m)
S1 = (pi/3.) * (R_cone/Dmax)**2. * (h1**3.) ! storage before change in volume (m3)
S2 = MAX(S1 + dS, 0.0) ! storage after change in volume (m3)
h2 = (3.*S2/pi*(Dmax/R_cone)**2.)**(1./3.) ! elevation after change in storage in (m)

elseif (LAKE_SHAPE_OPT == 3) then ! RECTANGLUAR PRISM shape
S1 = (surf_area/2./Dmax)*(h1**2.) ! storage before change in volume (m3)
elseif (LAKE_SHAPE_OPT == 1) then ! CONIC shape
!R_cone = (surf_area/pi)**0.5 ! cone base radius (m)
R_cone = (3.*total_vol/(pi*Dmax))**0.5 ! cone base radius (m)
S1 = (pi/3.) * (h1**3.) * (R_cone/Dmax)**2. ! storage before change in volume (m3)
S2 = MAX(S1 + dS, 0.0) ! storage after change in volume (m3)
h2 = (2.*S2*Dmax/surf_area)**0.5 ! elevation after change in storage in (m)
h2 = (3.*S2/pi*(Dmax/R_cone)**2.)**(1./3.) ! elevation after change in storage in (m)

elseif (LAKE_SHAPE_OPT == 4) then ! ELLIPSOID shape
!S1 = (surf_area/2/Dmax)*(h1**2) ! storage before change in volume (m3)
!S2 = S1 + dS ! storage after change in volume (m3)
!h2 = (2*S2*Dmax/surf_area)**0.5 ! elevation after change in storage in (m)
elseif (LAKE_SHAPE_OPT == 2) then ! RECTANGLUAR PRISM shape
S1 = (surf_area/2./Dmax)*(h1**2.) ! storage before change in volume (m3)
S2 = MAX(S1 + dS, 0.0) ! storage after change in volume (m3)
h2 = (2.*S2*Dmax/surf_area)**0.5 ! elevation after change in storage in (m)

elseif (LAKE_SHAPE_OPT == 5) then ! H-A-V RELATIONSHIP
S1 = polyhV_a*(h1**polyhV_b) * 1.0E9 ! storage before change in volume (m3)
S2 = MAX(S1 + dS, 0.0) ! storage after change in volume (m3)
h2 = (S2/1.0E9/polyhV_a)**(1./polyhV_a) ! elevation after change in storage in (m)
elseif (LAKE_SHAPE_OPT == 3) then ! H-A-V RELATIONSHIP
!S1 = 1000000000.0*(1.5175592E-08)*(h1**3.516952) ! storage before change in volume (m3)
S1 = 1.0E9*polyhV_a*(h1**polyhV_b)
S2 = MAX(S1 + dS, 0.0) ! storage after change in volume (m3)
h2 = (S2/1.0E9/polyhV_a)**(1./polyhV_b) ! elevation after change in storage in (m)
endif

Deltah = h2-h1 ! change in sotrage water level (m)
return

! ----------------------------------------------------------------
28 changes: 21 additions & 7 deletions trunk/NDHMS/Routing/module_HYDRO_io.F
Original file line number Diff line number Diff line change
@@ -8183,6 +8183,7 @@ subroutine read_routelink(&
n_CC, LAKEIDA, HRZAREA, &
LAKEMAXH, WEIRH, WEIRC, WEIRL, DAML, &
ORIFICEC, ORIFICEA, ORIFICEE, &
LAKEMAXDEPTH, LAKEVOL, LAKEPOLYA, LAKEPOLYB, &
reservoir_type_specified, reservoir_type, &
reservoir_parameter_file, LATLAKE, &
LONLAKE, ELEVLAKE, LAKEIDM, LAKEIDX, &
@@ -8202,6 +8203,7 @@ subroutine read_routelink(&
real, intent(INOUT), dimension(:) :: HRZAREA
real, intent(INOUT), dimension(:) :: LAKEMAXH, WEIRH, WEIRC, WEIRL, DAML
real, intent(INOUT), dimension(:) :: ORIFICEC, ORIFICEA, ORIFICEE
real, intent(INOUT), dimension(:) :: LAKEMAXDEPTH, LAKEVOL, LAKEPOLYA, LAKEPOLYB
logical, intent(IN) :: reservoir_type_specified
integer, intent(INOUT), dimension(:) :: reservoir_type
character(len=*), intent(in) :: reservoir_parameter_file
@@ -8229,7 +8231,8 @@ subroutine read_routelink(&
MannN, So, ChSSlp, Bw, Tw, Tw_CC, n_CC, LAKEIDA, HRZAREA, &
LAKEMAXH, WEIRH, WEIRC, WEIRL, DAML, ORIFICEC, &
ORIFICEA, ORIFICEE, reservoir_type_specified, reservoir_type, reservoir_parameter_file, &
gages, gageMiss, LAKEIDM, NLAKES, latlake, lonlake,ELEVLAKE)
gages, gageMiss, LAKEIDM, NLAKES, latlake, lonlake,ELEVLAKE, &
LAKEMAXDEPTH, LAKEVOL, LAKEPOLYA, LAKEPOLYB)
!--- get the lake configuration here.
#ifdef MPP_LAND
@@ -8254,6 +8257,10 @@ subroutine read_routelink(&
call mpp_land_bcast_real(NLAKES,ORIFICEC)
call mpp_land_bcast_real(NLAKES,ORIFICEA)
call mpp_land_bcast_real(NLAKES,ORIFICEE)
call mpp_land_bcast_real(NLAKES,LAKEMAXDEPTH)
call mpp_land_bcast_real(NLAKES,LAKEVOL)
call mpp_land_bcast_real(NLAKES,LAKEPOLYA)
call mpp_land_bcast_real(NLAKES,LAKEPOLYB)
call mpp_land_bcast_real(NLAKES,LATLAKE )
call mpp_land_bcast_real(NLAKES,LONLAKE )
call mpp_land_bcast_real(NLAKES,ELEVLAKE)
@@ -8271,7 +8278,8 @@ subroutine readLinkSL( GNLINKSL,NLINKSL,route_link_f, route_lake_f, maxorder, &
MannN, So, ChSSlp, Bw, Tw, Tw_CC, n_CC, LAKEIDA, HRZAREA, &
LAKEMAXH,WEIRH, WEIRC, WEIRL, DAML, ORIFICEC, &
ORIFICEA, ORIFICEE, reservoir_type_specified, reservoir_type, reservoir_parameter_file, &
gages, gageMiss, LAKEIDM,NLAKES, latlake, lonlake, ELEVLAKE)
gages, gageMiss, LAKEIDM,NLAKES, latlake, lonlake, ELEVLAKE, &
LAKEMAXDEPTH, LAKEVOL, LAKEPOLYA, LAKEPOLYB)
implicit none
character(len=*) :: route_link_f,route_lake_f
@@ -8293,7 +8301,7 @@ subroutine readLinkSL( GNLINKSL,NLINKSL,route_link_f, route_lake_f, maxorder, &
character(len=*), intent(in) :: reservoir_parameter_file
REAL, intent(out), dimension(:) :: HRZAREA,LAKEMAXH, WEIRC, WEIRL, DAML, ORIFICEC, WEIRH, &
ORIFICEA, ORIFICEE, ELEVLAKE
real, allocatable, dimension(:) :: LAKEMAXDEPTH, LAKEVOL, LAKEPOLYA, LAKEPOLYB
real, intent(out), dimension(:) :: LAKEMAXDEPTH, LAKEVOL, LAKEPOLYA, LAKEPOLYB
!end NLAKES
INTEGER, dimension(GNLINKSL) :: tmpLAKEIDA, tmpLINKID, tmpTO_NODE, tmpTYPEL, tmpORDER
@@ -8438,6 +8446,10 @@ subroutine readLinkSL( GNLINKSL,NLINKSL,route_link_f, route_lake_f, maxorder, &
call mpp_land_bcast_real(NLAKES, ORIFICEC)
call mpp_land_bcast_real(NLAKES, ORIFICEA)
call mpp_land_bcast_real(NLAKES, ORIFICEE)
call mpp_land_bcast_real(NLAKES, LAKEMAXDEPTH)
call mpp_land_bcast_real(NLAKES, LAKEVOL)
call mpp_land_bcast_real(NLAKES, LAKEPOLYA)
call mpp_land_bcast_real(NLAKES, LAKEPOLYB)
call mpp_land_bcast_int(NLAKES, LAKEIDM)
call mpp_land_bcast_real(NLAKES, ELEVLAKE)
call mpp_land_bcast_int(NLAKES, reservoir_type)
@@ -8919,7 +8931,7 @@ subroutine read_route_lake_netcdf(route_lake_file, &
ORIFICEC, ORIFICEA, ORIFICEE, reservoir_type_specified, &
reservoir_type, reservoir_parameter_file, &
LAKEIDM, lakelat, lakelon, &
LAKEMAXDEPTH, LAKEVOL, LAKE_POLYA, LAKE_POLYB, &
LAKEMAXDEPTH, LAKEVOL, LAKEPOLYA, LAKEPOLYB, &
ELEVLAKE, NLAKES)

implicit none
@@ -8930,7 +8942,7 @@ subroutine read_route_lake_netcdf(route_lake_file, &
integer, dimension(:), intent(out) :: LAKEIDM
real, dimension(:), intent(out) :: HRZAREA, LAKEMAXH, WEIRC, WEIRL, WEIRH, DAML
real, dimension(:), intent(out) :: ORIFICEC, ORIFICEA, ORIFICEE, lakelat, lakelon
real, dimension(:), intent(out) :: LAKEVOL, LAKEMAXDEPTH, LAKE_POLYA, LAKE_POLYB
real, dimension(:), intent(out) :: LAKEVOL, LAKEMAXDEPTH, LAKEPOLYA, LAKEPOLYB
real, dimension(:), intent(out) :: ELEVLAKE
integer, dimension(:), intent(out) :: reservoir_type

@@ -8964,8 +8976,8 @@ subroutine read_route_lake_netcdf(route_lake_file, &
call get_1d_netcdf_real(ncid, 'lon', lakelon, 'read_route_lake_netcdf', .TRUE.)
call get_1d_netcdf_real(ncid, 'LkVol', LAKEVOL, 'read_route_lake_netcdf', .TRUE.)
call get_1d_netcdf_real(ncid, 'LkMxDepth', LAKEMAXDEPTH, 'read_route_lake_netcdf', .TRUE.)
call get_1d_netcdf_real(ncid, 'poly_a', LAKE_POLYA, 'read_route_lake_netcdf', .TRUE.)
call get_1d_netcdf_real(ncid, 'poly_b', LAKE_POLYB, 'read_route_lake_netcdf', .TRUE.)
call get_1d_netcdf_real(ncid, 'poly_a', LAKEPOLYA, 'read_route_lake_netcdf', .TRUE.)
call get_1d_netcdf_real(ncid, 'poly_b', LAKEPOLYB, 'read_route_lake_netcdf', .TRUE.)
!remove the alt var. and add initial fractional depth var. LKR/DY
call get_1d_netcdf_real(ncid, 'ifd', ELEVLAKE, 'read_route_lake_netcdf', .FALSE.)

@@ -8987,6 +8999,8 @@ subroutine read_route_lake_netcdf(route_lake_file, &
print*,'HRZAREA', HRZAREA(ii)
print*,'LAKEMAXH', LAKEMAXH(ii), 'WEIRC', WEIRC(ii), 'WEIRL', WEIRL(ii), 'DAML', DAML(ii)
print*,'ORIFICEC', ORIFICEC(ii), 'ORIFICEA', ORIFICEA(ii), 'ORIFICEE', ORIFICEE(ii)
print*,'LAKEMAXDEPTH', LAKEMAXDEPTH(ii), 'LAKEVOL', LAKEVOL(ii)
print*,'LAKEPOLYA', LAKEPOLYA(ii), 'LAKEPOLYB', LAKEPOLYB(ii)
print*,"finish read_route_lake_netcdf"
#endif

2 changes: 2 additions & 0 deletions trunk/NDHMS/Routing/module_RT.F
Original file line number Diff line number Diff line change
@@ -787,6 +787,8 @@ subroutine LandRT_ini(did)
rt_domain(did)%DAML, &
rt_domain(did)%ORIFICEC, rt_domain(did)%ORIFICEA, &
rt_domain(did)%ORIFICEE, &
rt_domain(did)%LAKEMAXDEPTH, rt_domain(did)%LAKEVOL, &
rt_domain(did)%LAKEPOLYA, rt_domain(did)%LAKEPOLYB, &
nlst(did)%reservoir_type_specified, &
rt_domain(did)%reservoir_type, &
nlst(did)%reservoir_parameter_file, &
265 changes: 265 additions & 0 deletions trunk/NDHMS/Run/hydro.namelist
Original file line number Diff line number Diff line change
@@ -0,0 +1,265 @@
&HYDRO_nlist
!!!! ---------------------- SYSTEM COUPLING ----------------------- !!!!

! Specify what is being coupled: 1=HRLDAS (offline Noah-LSM), 2=WRF, 3=NASA/LIS, 4=CLM
sys_cpl = 1

!!!! ------------------- MODEL INPUT DATA FILES ------------------- !!!!

! Specify land surface model gridded input data file (e.g.: "geo_em.d01.nc")
GEO_STATIC_FLNM = "./DOMAIN/geo_em.d01.nc"

! Specify the high-resolution routing terrain input data file (e.g.: "Fulldom_hires.nc")
GEO_FINEGRID_FLNM = "./DOMAIN/Fulldom_hires.nc"

! Specify the spatial hydro parameters file (e.g.: "hydro2dtbl.nc")
! If you specify a filename and the file does not exist, it will be created for you.
HYDROTBL_F = "./DOMAIN/hydro2dtbl.nc"

! Specify spatial metadata file for land surface grid. (e.g.: "GEOGRID_LDASOUT_Spatial_Metadata.nc")
LAND_SPATIAL_META_FLNM = "./DOMAIN/GEOGRID_LDASOUT_Spatial_Metadata.nc"

! Specify the name of the restart file if starting from restart...comment out with '!' if not...
RESTART_FILE = 'RESTART/HYDRO_RST.2011-08-26_00:00_DOMAIN1'

!!!! --------------------- MODEL SETUP OPTIONS -------------------- !!!!

! Specify the domain or nest number identifier...(integer)
IGRID = 1

! Specify the restart file write frequency...(minutes)
! A value of -99999 will output restarts on the first day of the month only.
rst_dt = 120

! Reset the LSM soil states from the high-res routing restart file (1=overwrite, 0=no overwrite)
! NOTE: Only turn this option on if overland or subsurface rotuing is active!
rst_typ = 1

! Restart file format control
rst_bi_in = 0 !0: use netcdf input restart file (default)
!1: use parallel io for reading multiple restart files, 1 per core
rst_bi_out = 0 !0: use netcdf output restart file (default)
!1: use parallel io for outputting multiple restart files, 1 per core

! Restart switch to set restart accumulation variables to 0 (0=no reset, 1=yes reset to 0.0)
RSTRT_SWC = 0

! Specify baseflow/bucket model initialization...(0=cold start from table, 1=restart file)
GW_RESTART = 1

!!!! -------------------- MODEL OUTPUT CONTROL -------------------- !!!!

! Specify the output file write frequency...(minutes)
out_dt = 60

! Specify the number of output times to be contained within each output history file...(integer)
! SET = 1 WHEN RUNNING CHANNEL ROUTING ONLY/CALIBRATION SIMS!!!
! SET = 1 WHEN RUNNING COUPLED TO WRF!!!
SPLIT_OUTPUT_COUNT = 1

! Specify the minimum stream order to output to netcdf point file...(integer)
! Note: lower value of stream order produces more output.
order_to_write = 1

! Flag to turn on/off new I/O routines: 0 = deprecated output routines (use when running with Noah LSM),
! 1 = with scale/offset/compression, ! 2 = with scale/offset/NO compression,
! 3 = compression only, 4 = no scale/offset/compression (default)
io_form_outputs = 4

! Realtime run configuration option:
! 0=all (default), 1=analysis, 2=short-range, 3=medium-range, 4=long-range, 5=retrospective,
! 6=diagnostic (includes all of 1-4 outputs combined)
io_config_outputs = 0

! Option to write output files at time 0 (restart cold start time): 0=no, 1=yes (default)
t0OutputFlag = 1

! Options to output channel & bucket influxes. Only active for UDMP_OPT=1.
! Nonzero choice requires that out_dt above matches NOAH_TIMESTEP in namelist.hrldas.
! 0=None (default), 1=channel influxes (qSfcLatRunoff, qBucket)
! 2=channel+bucket fluxes (qSfcLatRunoff, qBucket, qBtmVertRunoff_toBucket)
! 3=channel accumulations (accSfcLatRunoff, accBucket) *** NOT TESTED ***
output_channelBucket_influx = 0

! Output netcdf file control
CHRTOUT_DOMAIN = 1 ! Netcdf point timeseries output at all channel points (1d)
! 0 = no output, 1 = output
CHANOBS_DOMAIN = 0 ! Netcdf point timeseries at forecast points or gage points (defined in Routelink)
! 0 = no output, 1 = output at forecast points or gage points.
CHRTOUT_GRID = 0 ! Netcdf grid of channel streamflow values (2d)
! 0 = no output, 1 = output
! NOTE: Not available with reach-based routing
LSMOUT_DOMAIN = 0 ! Netcdf grid of variables passed between LSM and routing components (2d)
! 0 = no output, 1 = output
! NOTE: No scale_factor/add_offset available
RTOUT_DOMAIN = 1 ! Netcdf grid of terrain routing variables on routing grid (2d)
! 0 = no output, 1 = output
output_gw = 1 ! Netcdf GW output
! 0 = no output, 1 = output
outlake = 1 ! Netcdf grid of lake values (1d)
! 0 = no output, 1 = output
frxst_pts_out = 0 ! ASCII text file of forecast points or gage points (defined in Routelink)
! 0 = no output, 1 = output

!!!! ------------ PHYSICS OPTIONS AND RELATED SETTINGS ------------ !!!!

! Specify the number of soil layers (integer) and the depth of the bottom of each layer... (meters)
! Notes: In Version 1 of WRF-Hydro these must be the same as in the namelist.input file.
! Future versions will permit this to be different.
NSOIL=4
ZSOIL8(1) = -0.10
ZSOIL8(2) = -0.40
ZSOIL8(3) = -1.00
ZSOIL8(4) = -2.00

! Specify the grid spacing of the terrain routing grid...(meters)
DXRT = 250.0

! Specify the integer multiple between the land model grid and the terrain routing grid...(integer)
AGGFACTRT = 4

! Specify the channel routing model timestep...(seconds)
DTRT_CH = 10

! Specify the terrain routing model timestep...(seconds)
DTRT_TER = 10

! Switch to activate subsurface routing...(0=no, 1=yes)
SUBRTSWCRT = 1

! Switch to activate surface overland flow routing...(0=no, 1=yes)
OVRTSWCRT = 1

! Specify overland flow routing option: 1=Seepest Descent (D8) 2=CASC2D (not active)
! NOTE: Currently subsurface flow is only steepest descent
rt_option = 1

! Switch to activate channel routing...(0=no, 1=yes)
CHANRTSWCRT = 1

! Specify channel routing option: 1=Muskingam-reach, 2=Musk.-Cunge-reach, 3=Diff.Wave-gridded
channel_option = 3

! Specify the reach file for reach-based routing options (e.g.: "Route_Link.nc")
!route_link_f = "./DOMAIN/Route_Link.nc"

! If using channel_option=2, activate the compound channel formulation? (Default=.FALSE.)
! This option is currently only supported if using reach-based routing with UDMP=1.
compound_channel = .FALSE.

! Specify the lake parameter file (e.g.: "LAKEPARM.nc").
! Note REQUIRED if lakes are on.
route_lake_f = "./DOMAIN/LAKEPARM.nc"

! Specify the reservoir parameter file
reservoir_parameter_file = "./DOMAIN/persistence_parm.nc"

! If using USGS persistence reservoirs, set to True. (default=.FALSE.)
reservoir_persistence_usgs = .FALSE.

! Specify the path to the timeslice files to be used by USGS reservoirs
reservoir_usgs_timeslice_path = "./usgs_timeslices/"

! If using USACE persistence reservoirs, set to True. (default=.FALSE.)
reservoir_persistence_usace = .FALSE.

! Specify the path to the timeslice files to be used by USACE reservoirs
reservoir_usace_timeslice_path = "./usace_timeslices/"

! Specify lookback hours to read reservoir observation data
reservoir_observation_lookback_hours = 24

! Specify update time interval in seconds to read new reservoir observation data
! The default is 86400 (seconds per day). Set to 3600 for standard and extended AnA simulations.
! Set to 1000000000 for short range and medium range forecasts.
reservoir_observation_update_time_interval_seconds = 3600

! If using RFC forecast reservoirs, set to True. (default=.FALSE.)
reservoir_rfc_forecasts = .FALSE.

! Specify the path to the RFC time series files to be used by reservoirs
reservoir_rfc_forecasts_time_series_path = "./rfc_timeseries/"

! Specify lookback hours to read reservoir RFC forecasts
reservoir_rfc_forecasts_lookback_hours = 28

! Switch to activate baseflow bucket model...(0=none, 1=exp. bucket, 2=pass-through,
! 4=exp. bucket with area normalized parameters)
! Option 4 is currently only supported if using reach-based routing with UDMP=1.
GWBASESWCRT = 1

! Switch to activate bucket model loss (0=no, 1=yes)
! This option is currently only supported if using reach-based routing with UDMP=1.
bucket_loss = 0

! Groundwater/baseflow 2d mask specified on land surface model grid (e.g.: "GWBASINS.nc")
! Note: Only required if baseflow model is active (1 or 2) and UDMP_OPT=0.
gwbasmskfil = "./DOMAIN/GWBASINS.nc"

! Groundwater bucket parameter file (e.g.: "GWBUCKPARM.nc")
GWBUCKPARM_file = "./DOMAIN/GWBUCKPARM.nc"

! User defined mapping, such as NHDPlus: 0=no (default), 1=yes
UDMP_OPT = 0

! If on, specify the user-defined mapping file (e.g.: "spatialweights.nc")
!udmap_file = "./DOMAIN/spatialweights.nc"

/

&NUDGING_nlist

! Path to the "timeslice" observation files.
timeSlicePath = "./nudgingTimeSliceObs/"

nudgingParamFile = "DOMAIN/nudgingParams.nc"

! Nudging restart file = "nudgingLastObsFile"
! nudgingLastObsFile defaults to '', which will look for nudgingLastObs.YYYY-mm-dd_HH:MM:SS.nc
! **AT THE INITALIZATION TIME OF THE RUN**. Set to a missing file to use no restart.
!nudgingLastObsFile = '/a/nonexistent/file/gives/nudging/cold/start'

!! Parallel input of nudging timeslice observation files?
readTimesliceParallel = .TRUE.

! temporalPersistence defaults to true, only runs if necessary params present.
temporalPersistence = .FALSE.

! The total number of last (obs, modeled) pairs to save in nudgingLastObs for
! removal of bias. This is the maximum array length. (This option is active when persistBias=FALSE)
! (Default=960=10days @15min obs resolution, if all the obs are present and longer if not.)
nLastObs = 960

! If using temporalPersistence the last observation persists by default.
! This option instead persists the bias after the last observation.
persistBias = .FALSE.

! AnA (FALSE) vs Forecast (TRUE) bias persistence.
! If persistBias: Does the window for calculating the bias end at
! model init time (=t0)?
! FALSE = window ends at model time (moving),
! TRUE = window ends at init=t0(fcst) time.
! (If commented out, Default=FALSE)
! Note: Perfect restart tests require this option to be .FALSE.
biasWindowBeforeT0 = .FALSE.

! If persistBias: Only use this many last (obs, modeled) pairs. (If Commented out, Default=-1*nLastObs)
! > 0: apply an age-based filter, units=hours.
! = 0: apply no additional filter, use all available/usable obs.
! < 0: apply an count-based filter, units=count
maxAgePairsBiasPersist = -960

! If persistBias: The minimum number of last (obs, modeled) pairs, with age less than
! maxAgePairsBiasPersist, required to apply a bias correction. (default=8)
minNumPairsBiasPersist = 8

! If persistBias: give more weight to observations closer in time? (default=FALSE)
invDistTimeWeightBias = .TRUE.

! If persistBias: "No constructive interference in bias correction?", Reduce the bias adjustment
! when the model and the bias adjustment have the same sign relative to the modeled flow at t0?
! (default=FALSE)
! Note: Perfect restart tests require this option to be .FALSE.
noConstInterfBias = .FALSE.

/