Skip to content

Commit

Permalink
feat(sfr): add storage term to sfr budget (#293)
Browse files Browse the repository at this point in the history
* Also includes a reach volume term written as an aux variable.  This is needed for transport.
* initialize str so non-ascii characters don't show up in output files
* updated notes for these changes
  • Loading branch information
langevin-usgs authored Jan 27, 2020
1 parent 10c4ada commit 5f6e70c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
2 changes: 2 additions & 0 deletions doc/ReleaseNotes/ReleaseNotes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ \section{History}

\underline{ADVANCED STRESS PACKAGES}
\begin{itemize}
\item The code for saving the budget terms for the advanced packages was refactored to use common routines. These changes should have no affect on simulation results.
\item The LAK Package would accept negative user-input values for RAINFALL, EVAPORATION, RUNOFF, INFLOW, and WITHDRAWAL even though the user guide mentioned that negative values are not allowed for these flow terms. Error checks were added to ensure these values are specified as positive.
\item Added a storage term to the SFR Package binary output file. This term is always zero with the present implementation. An auxiliary variable, called VOLUME, is also written with the storage budget term. This term contains the calculated water volume in the reach.
\end{itemize}

\underline{SOLUTION}
Expand Down
1 change: 1 addition & 0 deletions doc/mf6io/gwf/binaryoutput.tex
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ \subsubsection{LAK, MAW, SFR, and UZF Packages}
\texttt{RAIN} & 6 & 1 / \texttt{maxbound} & Specified rainfall on reach. The reach number is written to (\texttt{ID1}) and (\texttt{ID2}). \\
\texttt{EVAPORATION} & 6 & 1 / \texttt{maxbound} & Calculated evaporation from reach. The reach number is written to (\texttt{ID1}) and (\texttt{ID2}). \\
\texttt{EXT-OUTFLOW} & 6 & 1 / \texttt{maxbound} & Calculated outflow to external boundaries (is nonzero for reaches with no downstream connections). The reach number is written to (\texttt{ID1}) and (\texttt{ID2}). \\
\texttt{STORAGE} & 6 & 1 / \texttt{maxbound} & Calculated storage changes for each reach. This value is always zero for the present implementation. The water volume in the reach (\texttt{VOLUME}) is saved as an auxiliary data item for this flow term. The reach number is written to (\texttt{ID1}) and (\texttt{ID2}). \\
\texttt{FROM-MVR} & 6 & 1 / \texttt{maxbound} & Calculated flow to reach from the MVR Package. Only saved if MVR Package is used in the SFR Package. The reach number is written to (\texttt{ID1}) and (\texttt{ID2}). \\
\texttt{TO-MVR} & 6 & 1 / \texttt{maxbound} & Calculated flow from reach to the MVR Package. Only saved if MVR Package is used in the SFR Package. The reach number is written to (\texttt{ID1}) and (\texttt{ID2}). \\
\texttt{AUXILIARY} & 6 & \texttt{naux}+1 / \texttt{maxbound} & Auxiliary variables, if specified in the SFR Package, are saved to this flow term. The first entry of the \texttt{DATA2D} column has a value of zero. The reach number is written to (\texttt{ID1}) and (\texttt{ID2}).
Expand Down
26 changes: 25 additions & 1 deletion src/Model/GroundWaterFlow/gwf3sfr8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4226,7 +4226,7 @@ subroutine sfr_setup_budobj(this)
! the simulation and cannot change. This includes FLOW-JA-FACE
! so they can be written to the binary budget files, but these internal
! flows are not included as part of the budget table.
nbudterm = 7
nbudterm = 8
if (this%imover == 1) nbudterm = nbudterm + 2
if (this%naux > 0) nbudterm = nbudterm + 1
!
Expand Down Expand Up @@ -4346,6 +4346,20 @@ subroutine sfr_setup_budobj(this)
naux)
!
! --
text = ' STORAGE'
idx = idx + 1
maxlist = this%maxbound
naux = 1
auxtxt(1) = ' VOLUME'
call this%budobj%budterm(idx)%initialize(text, &
this%name_model, &
this%name, &
this%name_model, &
this%name, &
maxlist, .false., .false., &
naux, auxtxt)
!
! --
if (this%imover == 1) then
!
! --
Expand Down Expand Up @@ -4516,6 +4530,16 @@ subroutine sfr_fill_budobj(this)
call this%budobj%budterm(idx)%update_term(n, n, q)
end do

! -- STORAGE
idx = idx + 1
call this%budobj%budterm(idx)%reset(this%maxbound)
do n = 1, this%maxbound
q = DZERO
d = this%depth(n)
a = this%width(n) * this%length(n)
this%qauxcbc(1) = a * d
call this%budobj%budterm(idx)%update_term(n, n, q, this%qauxcbc)
end do

! -- MOVER
if (this%imover == 1) then
Expand Down
1 change: 1 addition & 0 deletions src/Solution/NumericalSolution.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2621,6 +2621,7 @@ subroutine sln_get_loc(this, nodesln, str)
!
! -- calculate and set offsets
noder = 0
str = ''
do i = 1, this%modellist%Count()
mp => GetNumericalModelFromList(this%modellist, i)
call mp%get_mrange(istart, iend)
Expand Down

0 comments on commit 5f6e70c

Please sign in to comment.