Skip to content

Commit 7c663a9

Browse files
committed
Add lake_opt to namelist, reservoirs to own nlist
* Add `lake_option` (integer) to &hydro_nlist: 0 [lakes off], 1 [level pool], or 2 [passthrough], or 3 [reservoir DA] - turning lakes off (lake_option=0) will disable lakes even if route_lake_f is supplied, or outlake is turned on. - Reservoir DA will not be used unless lake_option=3, even if all other required namelist options are present * Reservoir options have been moved from &hydro_nlist to &reservoir_nlist - This will make it easier to isolate / compose namelist files - If lake_option is not equal to 3, &reservoir_nlist won't be read, meaning it can be completely removed for applications that don't need it
1 parent 3deb607 commit 7c663a9

File tree

8 files changed

+201
-120
lines changed

8 files changed

+201
-120
lines changed

src/OrchestratorLayer/config.f90

+147-79
Large diffs are not rendered by default.

src/Routing/Reservoirs/Level_Pool/module_levelpool.F

+14-13
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ module module_levelpool
5656
subroutine levelpool_init(this, water_elevation, &
5757
lake_area, weir_elevation, weir_coeffecient, &
5858
weir_length, dam_length, orifice_elevation, orifice_coefficient, &
59-
orifice_area, max_depth, lake_number)
59+
orifice_area, max_depth, lake_number, lake_opt)
60+
6061
implicit none
6162
class(levelpool), intent(inout) :: this ! object being initialized
6263
real, intent(inout) :: water_elevation ! meters AMSL
@@ -69,7 +70,9 @@ subroutine levelpool_init(this, water_elevation, &
6970
real, intent(in) :: orifice_coefficient ! orifice coefficient
7071
real, intent(in) :: orifice_area ! orifice area (meters^2)
7172
real, intent(in) :: max_depth ! max depth of reservoir before overtop (meters)
72-
integer(kind=int64), intent(in) :: lake_number ! lake number
73+
integer(kind=int64), intent(in) :: lake_number ! lake number
74+
integer, intent(in) :: lake_opt ! bypass lake physics (2 to use pass-through)
75+
7376
character(len=15) :: lake_number_string
7477

7578
#ifdef RESERVOIR_D
@@ -114,7 +117,7 @@ subroutine levelpool_init(this, water_elevation, &
114117
call this%properties%init( lake_area, &
115118
weir_elevation, weir_coeffecient, weir_length, dam_length, &
116119
orifice_elevation, orifice_coefficient, &
117-
orifice_area, max_depth, lake_number )
120+
orifice_area, max_depth, lake_number, lake_opt )
118121
end if
119122
this%pointer_allocation_guard = .true.
120123

@@ -169,6 +172,7 @@ subroutine run_levelpool_reservoir(this, previous_timestep_inflow, inflow, &
169172
this%state%water_elevation = water_elevation
170173

171174
call LEVELPOOL_PHYSICS(this%properties%lake_number, &
175+
this%properties%lake_opt, &
172176
previous_timestep_inflow, &
173177
this%input%inflow, &
174178
this%output%outflow, &
@@ -217,7 +221,7 @@ end subroutine run_levelpool_reservoir
217221
! SUBROUTINE LEVELPOOL
218222
! ------------------------------------------------
219223

220-
subroutine LEVELPOOL_PHYSICS(ln,qi0,qi1,qo1,ql,dt,H,ar,we,maxh,wc,wl,dl,oe,oc,oa)
224+
subroutine LEVELPOOL_PHYSICS(ln,lake_opt,qi0,qi1,qo1,ql,dt,H,ar,we,maxh,wc,wl,dl,oe,oc,oa)
221225

222226
!! ---------------------------- argument variables
223227
!! All elevations should be relative to a common base (often belev(k))
@@ -238,9 +242,8 @@ subroutine LEVELPOOL_PHYSICS(ln,qi0,qi1,qo1,ql,dt,H,ar,we,maxh,wc,wl,dl,oe,oc,oa
238242
real, intent(IN) :: oa ! orifice area (m^2)
239243
real, intent(IN) :: maxh ! max depth of reservoir before overtop (m)
240244
integer(kind=int64), intent(IN) :: ln ! lake number
245+
integer, intent(in) :: lake_opt ! reservoir physics options (1: levelpool, 2: passthrough)
241246

242-
!!DJG Add lake option switch here...move up to namelist in future versions...
243-
integer :: LAKE_OPT ! Lake model option (move to namelist later)
244247
real :: Htmp ! Temporary assign of incoming lake el. (m)
245248

246249
!! ---------------------------- local variables
@@ -254,22 +257,20 @@ subroutine LEVELPOOL_PHYSICS(ln,qi0,qi1,qo1,ql,dt,H,ar,we,maxh,wc,wl,dl,oe,oc,oa
254257
!! ---------------------------- subroutine body: from chow, mad mays. pg. 252
255258
!! -- determine from inflow hydrograph
256259

257-
258-
!!DJG Set hardwire for LAKE_OPT...move specification of this to namelist in
259-
!future versions...
260-
LAKE_OPT = 2
261260
Htmp = H !temporary set of incoming lake water elevation...
262261
!hdiff_vol = 0.0
263262
!qdiff_vol = 0.0
264263

265264
!!DJG IF-block for lake model option 1 - outflow=inflow, 2 - Chow et al level
266265
!pool, .....
267-
if (LAKE_OPT == 1) then ! If-block for simple pass through scheme....
268-
266+
if (LAKE_OPT == 2) then ! If-block for simple pass through scheme....
267+
#ifdef RESERVOIR_D
268+
write(6,*) "LEVELPOOL LAKE_OPT=2, using reservoir passthrough"
269+
#endif
269270
qo1 = qi1 ! Set outflow equal to inflow at current time
270271
H = Htmp ! Set new lake water elevation to incoming lake el.
271272

272-
else if (LAKE_OPT == 2) then ! If-block for Chow et al level pool scheme
273+
else if (LAKE_OPT == 1) then ! If-block for Chow et al level pool scheme
273274

274275
It = qi0
275276
Itdt_3 = qi0 + ((qi1 + ql - qi0) * 0.33)

src/Routing/Reservoirs/Level_Pool/module_levelpool_properties.F

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module module_levelpool_properties
2323
real :: orifice_area ! orifice area (meters^2)
2424
real :: max_depth ! max depth of reservoir before overtop (meters)
2525
integer(kind=int64) :: lake_number ! lake number
26+
integer :: lake_opt ! reservoir physics options (1: levelpool, 2: passthrough)
2627
2728
contains
2829
@@ -36,7 +37,7 @@ module module_levelpool_properties
3637
!Level Pool Properties Constructor
3738
subroutine levelpool_properties_init(this, lake_area, &
3839
weir_elevation, weir_coeffecient, weir_length, dam_length, orifice_elevation, &
39-
orifice_coefficient, orifice_area, max_depth, lake_number)
40+
orifice_coefficient, orifice_area, max_depth, lake_number, lake_opt)
4041
implicit none
4142
class(levelpool_properties_interface), intent(inout) :: this ! the type object being initialized
4243
real, intent(in) :: lake_area ! area of lake (km^2)
@@ -49,6 +50,7 @@ subroutine levelpool_properties_init(this, lake_area, &
4950
real, intent(in) :: orifice_area ! orifice area (meters^2)
5051
real, intent(in) :: max_depth ! max depth of reservoir before overtop (meters)
5152
integer(kind=int64), intent(in) :: lake_number ! lake number
53+
integer :: lake_opt ! reservoir physics options (1: levelpool, 2: passthrough)
5254
5355
! Assign the values passed in to a particular level pool reservoir
5456
! properties object's variables.
@@ -62,6 +64,7 @@ subroutine levelpool_properties_init(this, lake_area, &
6264
this%max_depth = max_depth
6365
this%lake_number = lake_number
6466
this%dam_length = dam_length
67+
this%lake_opt = lake_opt
6568

6669
end subroutine levelpool_properties_init
6770

src/Routing/Reservoirs/Persistence_Level_Pool_Hybrid/module_persistence_levelpool_hybrid.F

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ subroutine hybrid_init(this, water_elevation, &
201201
! Initialize level pool reservoir
202202
call this%state%levelpool_ptr%init(water_elevation, lake_area, &
203203
weir_elevation, weir_coeffecient, weir_length, dam_length, orifice_elevation, &
204-
orifice_coefficient, orifice_area, lake_max_water_elevation, lake_number)
204+
orifice_coefficient, orifice_area, lake_max_water_elevation, lake_number, 1)
205205

206206
end if
207207
end subroutine hybrid_init

src/Routing/Reservoirs/RFC_Forecasts/module_rfc_forecasts.F

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ subroutine rfc_forecasts_init(this, water_elevation, &
156156
! Initialize level pool reservoir
157157
call this%state%levelpool_ptr%init(water_elevation, lake_area, &
158158
weir_elevation, weir_coeffecient, weir_length, dam_length, orifice_elevation, &
159-
orifice_coefficient, orifice_area, lake_max_water_elevation, lake_number)
159+
orifice_coefficient, orifice_area, lake_max_water_elevation, lake_number, 1)
160160

161161
! Call to initialize time series data object
162162
call time_series_data%init(start_date, time_series_path, forecast_lookback_hours, &

src/Routing/module_HYDRO_io.F

+2-2
Original file line numberDiff line numberDiff line change
@@ -10358,8 +10358,8 @@ subroutine read_NSIMLAKES(NLAKES,route_lake_f)
1035810358
endif
1035910359
else
1036010360
!yw for IOC reach based routing, if netcdf lake file is not set from the hydro.namelist,
10361-
! we will assume that no lake will be assimulated.
10362-
write(6,*) "No lake nectdf file defined. NLAKES is set to be zero."
10361+
! we will assume that no lake will be assimilated.
10362+
write(6,*) "Lakes have been disabled -- NLAKES will be set to zero."
1036310363
NLAKES = 0
1036410364
endif
1036510365
#ifdef MPP_LAND

src/Routing/module_RT.F

+2-1
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,8 @@ subroutine LandRT_ini(did)
853853
rt_domain(did)%ORIFICEC(lake_index), &
854854
rt_domain(did)%ORIFICEA(lake_index), &
855855
rt_domain(did)%LAKEMAXH(lake_index), &
856-
rt_domain(did)%LAKEIDM(lake_index) )
856+
rt_domain(did)%LAKEIDM(lake_index), &
857+
nlst(did)%lake_option)
857858

858859
type is (persistence_levelpool_hybrid)
859860
call reservoir%init( &

src/template/HYDRO/hydro.namelist

+30-22
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,40 @@ compound_channel = .FALSE.
154154
! Switch to activate channel-loss option (0=no, 1=yes) [Requires Kchan in RouteLink]
155155
! channel_loss_option = 0
156156

157+
! Lake / Reservoir options (0=lakes off, 1=level pool (typical default),
158+
! 2=passthrough, 3=reservoir DA [see &reservoir_nlist below])
159+
lake_option = 1
160+
157161
! Specify the lake parameter file (e.g.: "LAKEPARM.nc").
158162
! Note REQUIRED if lakes are on.
159163
route_lake_f = "./DOMAIN/LAKEPARM.nc"
160164

165+
! Switch to activate baseflow bucket model...(0=none, 1=exp. bucket, 2=pass-through,
166+
! 4=exp. bucket with area normalized parameters)
167+
! Option 4 is currently only supported if using reach-based routing with UDMP=1.
168+
GWBASESWCRT = 1
169+
170+
! Switch to activate bucket model loss (0=no, 1=yes)
171+
! This option is currently only supported if using reach-based routing with UDMP=1.
172+
bucket_loss = 0
173+
174+
! Groundwater/baseflow 2d mask specified on land surface model grid (e.g.: "GWBASINS.nc")
175+
! Note: Only required if baseflow model is active (1 or 2) and UDMP_OPT=0.
176+
gwbasmskfil = "./DOMAIN/GWBASINS.nc"
177+
178+
! Groundwater bucket parameter file (e.g.: "GWBUCKPARM.nc")
179+
GWBUCKPARM_file = "./DOMAIN/GWBUCKPARM.nc"
180+
181+
! User defined mapping, such as NHDPlus: 0=no (default), 1=yes
182+
UDMP_OPT = 0
183+
184+
! If on, specify the user-defined mapping file (e.g.: "spatialweights.nc")
185+
!udmap_file = "./DOMAIN/spatialweights.nc"
186+
187+
/
188+
189+
&reservoir_nlist
190+
161191
! Specify the reservoir parameter file
162192
reservoir_parameter_file = "./DOMAIN/persistence_parm.nc"
163193

@@ -190,28 +220,6 @@ reservoir_rfc_forecasts_time_series_path = "./rfc_timeseries/"
190220
! Specify lookback hours to read reservoir RFC forecasts
191221
reservoir_rfc_forecasts_lookback_hours = 28
192222

193-
! Switch to activate baseflow bucket model...(0=none, 1=exp. bucket, 2=pass-through,
194-
! 4=exp. bucket with area normalized parameters)
195-
! Option 4 is currently only supported if using reach-based routing with UDMP=1.
196-
GWBASESWCRT = 1
197-
198-
! Switch to activate bucket model loss (0=no, 1=yes)
199-
! This option is currently only supported if using reach-based routing with UDMP=1.
200-
bucket_loss = 0
201-
202-
! Groundwater/baseflow 2d mask specified on land surface model grid (e.g.: "GWBASINS.nc")
203-
! Note: Only required if baseflow model is active (1 or 2) and UDMP_OPT=0.
204-
gwbasmskfil = "./DOMAIN/GWBASINS.nc"
205-
206-
! Groundwater bucket parameter file (e.g.: "GWBUCKPARM.nc")
207-
GWBUCKPARM_file = "./DOMAIN/GWBUCKPARM.nc"
208-
209-
! User defined mapping, such as NHDPlus: 0=no (default), 1=yes
210-
UDMP_OPT = 0
211-
212-
! If on, specify the user-defined mapping file (e.g.: "spatialweights.nc")
213-
!udmap_file = "./DOMAIN/spatialweights.nc"
214-
215223
/
216224

217225
&NUDGING_nlist

0 commit comments

Comments
 (0)