Skip to content

Commit

Permalink
refactor(sfr): convert storage_weight to dev variable (MODFLOW-USGS#2032
Browse files Browse the repository at this point in the history
)

* Add PinderSauer example to ReleaseNotes develop.tex with associated references
* update test_gwf_sfr_kinematic01.py to use revised dev_storage_weight variable name
  • Loading branch information
jdhughes-usgs authored Oct 10, 2024
1 parent 1da1394 commit f7e8c71
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 23 deletions.
2 changes: 1 addition & 1 deletion autotest/test_gwf_sfr_kinematic01.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def build_models(idx, test):
gwf,
print_flows=True,
storage=True,
storage_weight=storage_weights[idx],
dev_storage_weight=storage_weights[idx],
nreaches=nreaches,
packagedata=pak_data,
connectiondata=[(0,)],
Expand Down
20 changes: 20 additions & 0 deletions doc/MODFLOW6References.bib
Original file line number Diff line number Diff line change
Expand Up @@ -3054,3 +3054,23 @@ @book{flopysoftware
Title = {FloPy v3.7.0dev0 (preliminary)},
Year = {2024},
Url = {https://doi.org/10.5066/F7BK19FH}}

@article{lal2001modification,
author = {Lal, AM Wasantha},
journal = {Journal of Hydraulic Engineering},
number = {7},
pages = {567--576},
publisher = {American Society of Civil Engineers},
title = {Modification of canal flow due to stream-aquifer interaction},
volume = {127},
year = {2001}}

@article{pinder1971numerical,
author = {Pinder, George F and Sauer, Stanley P},
journal = {Water Resources Research},
number = {1},
pages = {63--70},
publisher = {Wiley Online Library},
title = {Numerical simulation of flood wave modification due to bank storage effects},
volume = {7},
year = {1971}}
11 changes: 10 additions & 1 deletion doc/ReleaseNotes/ReleaseNotes.bbl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
\begin{thebibliography}{15}
\begin{thebibliography}{17}
\providecommand{\natexlab}[1]{#1}
\expandafter\ifx\csname urlstyle\endcsname\relax
\providecommand{\doiagency}[1]{doi:\discretionary{}{}{}#1}\else
Expand Down Expand Up @@ -41,6 +41,10 @@ Hughes, J.D., Langevin, C.D., Paulinski, S.R., Larsen, J.D., and Brakenhoff,
{MODFLOW} models: Groundwater, v.~62, no.~1, p.~124--139,
\url{https://doi.org/10.1111/gwat.13327}.

\bibitem[{Lal(2001)}]{lal2001modification}
Lal, A.W., 2001, Modification of canal flow due to stream-aquifer interaction:
Journal of Hydraulic Engineering, v. 127, no.~7, p.~567--576.

\bibitem[{Langevin and others(2017)Langevin, Hughes, Provost, Banta, Niswonger,
and Panday}]{modflow6gwf}
Langevin, C.D., Hughes, J.D., Provost, A.M., Banta, E.R., Niswonger, R.G., and
Expand Down Expand Up @@ -96,6 +100,11 @@ Peckham, S.D., Hutton, E.W., and Norris, B., 2013, A component-based approach
\& Geosciences, v.~53, p.~3 -- 12, accessed March 24, 2020, at
\url{https://doi.org/https://doi.org/10.1016/j.cageo.2012.04.002}.

\bibitem[{Pinder and Sauer(1971)}]{pinder1971numerical}
Pinder, G.F., and Sauer, S.P., 1971, Numerical simulation of flood wave
modification due to bank storage effects: Water Resources Research, v.~7,
no.~1, p.~63--70.

\bibitem[{Provost and others(2017)Provost, Langevin, and Hughes}]{modflow6xt3d}
Provost, A.M., Langevin, C.D., and Hughes, J.D., 2017, Documentation for the
``XT3D'' Option in the Node Property Flow (NPF) Package of MODFLOW 6: {U.S.
Expand Down
2 changes: 1 addition & 1 deletion doc/ReleaseNotes/develop.tex
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
\underline{EXAMPLES}
\begin{itemize}
\item A new Toth example was added to show how the classic groundwater problem consisting of local, intermediate, and regional flow paths can be simulated with MODFLOW.
% \item xxx
\item A new Streamflow Routing (SFR) Package example based on the Pinder-Sauer problem \citep{pinder1971numerical} modified by \cite{lal2001modification} was added to demonstrate the capabilities of the kinematic-wave approximation option.
% \item xxx
\end{itemize}

Expand Down
16 changes: 8 additions & 8 deletions doc/mf6io/mf6ivar/dfn/gwf-sfr.dfn
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ optional true
longname activate reach storage
description keyword that activates storage contributions to the stream-flow routing package continuity equation.

block options
name storage_weight
type double precision
reader urword
optional true
longname reach storage time weighting
description real number value that defines the time weighting factor used to calculate the change in channel storage. STORAGE\_WEIGHT must have a value between 0.5 and 1. Default STORAGE\_WEIGHT value is 0.5.

block options
name auxiliary
type string
Expand Down Expand Up @@ -343,6 +335,14 @@ optional true
longname time conversion factor
description real value that is used to convert user-specified Manning's roughness coefficients from seconds to model time units. TIME\_CONVERSION should be set to 1.0, 60.0, 3,600.0, 86,400.0, and 31,557,600.0 when using time units (TIME\_UNITS) of seconds, minutes, hours, days, or years in the simulation, respectively. TIME\_CONVERSION does not need to be specified if TIME\_UNITS are seconds.

block options
name dev_storage_weight
type double precision
reader urword
optional true
longname reach storage time weighting
description real number value that defines the time weighting factor used to calculate the change in channel storage. STORAGE\_WEIGHT must have a value between 0.5 and 1. Default STORAGE\_WEIGHT value is 1.


# --------------------- gwf sfr dimensions ---------------------

Expand Down
24 changes: 12 additions & 12 deletions src/Model/GroundWaterFlow/gwf-sfr.f90
Original file line number Diff line number Diff line change
Expand Up @@ -752,17 +752,6 @@ subroutine sfr_options(this, option, found)
this%istorage = 1
write (this%iout, '(4x,a)') trim(adjustl(this%text))// &
' REACH STORAGE IS ACTIVE.'
case ('STORAGE_WEIGHT')
r = this%parser%GetDouble()
if (r < DHALF .or. r > DONE) then
write (errmsg, '(a,g0,a)') &
"STORAGE_WEIGHT SPECIFIED TO BE '", r, &
"' BUT CANNOT BE LESS THAN 0.5 OR GREATER THAN 1.0"
call store_error(errmsg)
else
this%storage_weight = r
write (this%iout, fmtstoweight) this%storage_weight
end if
case ('PRINT_STAGE')
this%iprhed = 1
write (this%iout, '(4x,a)') trim(adjustl(this%text))// &
Expand Down Expand Up @@ -867,6 +856,17 @@ subroutine sfr_options(this, option, found)
write (this%iout, '(4x,a)') &
'A FINAL CONVERGENCE CHECK OF THE CHANGE IN STREAM FLOW ROUTING &
&STAGES AND FLOWS WILL NOT BE MADE'
case ('DEV_STORAGE_WEIGHT')
r = this%parser%GetDouble()
if (r < DHALF .or. r > DONE) then
write (errmsg, '(a,g0,a)') &
"STORAGE_WEIGHT SPECIFIED TO BE '", r, &
"' BUT CANNOT BE LESS THAN 0.5 OR GREATER THAN 1.0"
call store_error(errmsg)
else
this%storage_weight = r
write (this%iout, fmtstoweight) this%storage_weight
end if
!
! -- no valid options found
case default
Expand Down Expand Up @@ -4411,7 +4411,7 @@ subroutine sfr_check_storage_weight(this)
! -- set storage weight if it has not been defined yet
if (this%istorage == 1) then
if (this%storage_weight == DNODATA) then
this%storage_weight = DHALF
this%storage_weight = DONE
write (this%iout, fmtweight) &
trim(adjustl(this%packName)), this%storage_weight
end if
Expand Down

0 comments on commit f7e8c71

Please sign in to comment.