Skip to content

Commit

Permalink
refactor(dsp): issue with xt3d for mt3d problem 8 (#307)
Browse files Browse the repository at this point in the history
* fix(uzf): fix indexing error in UZF (#274)

* Error introduced as part of recent UZF refactoring
* Closes #273

* fix(memory): some variables not deallocated (#278)

Implemented new check in develop mode so code bombs with error if memory manager variable not deallocated

* refactor(budobj): new budget object for advanced packages (#279)

* single code base for writing binary budget files for advanced packages
* single code base for creating and writing budget tables to list file for advanced packages
* implemented for MAW, UZF, LAK, SFR, and MVR
* closes #277
* update mf6exes from 2.0 to 3.0
* will allow generalized transport calculations for advanced packages

* refactor(advanced packages): read static data as part of df() (#281)

* refactor(advanced packages): modify advanced packages to read all static data as part of df()
* modify setup_budobj to include the connectivity so that it is available to other models

* fix(budterm): initialize nlist to zero (#283)

* initialize nlist to zero (#284)

* fix(lak): initialize chdratin and chdratout to zero (#286)

* fix(lak): added sign checks for user specified lak flow terms (#288)

* User-specified values for RAINFALL, EVAPORATION, RUNOFF, INFLOW, and WITHDRAWAL must be positive.  The program worked if these values were negative, but that doesn't necessarily make sense and is probably an input error.
* Updated definition file to reflect these changes
* Corrected minor typo in lake definition file
* Updated release notes to reflect this change
* Close #287

* feat(sfr): add storage term to sfr budget (#293)

* 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

* * fix(csub): Fix CSUB binary budget data saved as IMETH=6 datatype

closes #290

* refactor(sfr): Refactor SFR Package to remove use of Geometry objects (#296)

* refactor(sfr): Refactor SFR Package to remove use of Geometry objects

* doc(pak-ts): update description of package timeseries variables. 

* ci(yml): update yml to clone shallow copy of flopy and pymake repos

* doc(release): Update release notes

* Closes #276, and #289

* fix(dsp): xt3d having problems with mt3d test problem 8

* refactor(xt3d): accumulate flowja instead of set (#306)

This change is required for transport, which accumulates terms in flowja

* fix bug in writing of ssm budget

Co-authored-by: Hughes, J.D. <jdhughes@usgs.gov>
  • Loading branch information
langevin-usgs and jdhughes-usgs committed Feb 12, 2020
1 parent 1a4ca0b commit ab912e9
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 34 deletions.
3 changes: 0 additions & 3 deletions doc/ReleaseNotes/ReleaseNotes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,11 @@ \section{History}
\underline{BASIC FUNCTIONALITY}

\underline{STRESS PACKAGES}
<<<<<<< HEAD
=======
\begin{itemize}
\item Fixed a bug in binary budget file header for CSUB Package budget data written using IMETH=6 (CSUB-ELASTIC and CSUB-INELASTIC) .
\item Added information on the CSUB Package budget terms and compaction data written the the Input/Output document in the `Description of Groundwater Flow (GWF) Model Binary Output Files' section.
\item Refactored the SFR Package to remove use of RectangularChGeometry objects and added required functionality as private methods in the SFR module.
\end{itemize}
>>>>>>> develop

\underline{ADVANCED STRESS PACKAGES}
\begin{itemize}
Expand Down
4 changes: 0 additions & 4 deletions doc/mf6io/gwf/binaryoutput.tex
Original file line number Diff line number Diff line change
Expand Up @@ -547,11 +547,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}). \\
<<<<<<< HEAD
\texttt{STORAGE} & 6 & 2 / \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{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}). \\
>>>>>>> develop
\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
3 changes: 3 additions & 0 deletions src/Model/GroundWaterTransport/gwt1dsp.f90
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ subroutine dsp_cf(this, kiter)
nodeloop: do n = 1, this%dis%nodes
do ipos = this%dis%con%ia(n) + 1, this%dis%con%ia(n + 1) - 1
fd = abs(this%gwfflowjaold(ipos) - this%fmi%gwfflowja(ipos))
!
! -- todo: this check is not robust. Should find a better way
! to determine if flow has changed.
if(fd > 1.D-8) then
iflwchng = 1
exit nodeloop
Expand Down
5 changes: 3 additions & 2 deletions src/Model/GroundWaterTransport/gwt1fmi1.f90
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ subroutine fmi_ad(this, cnew)
real(DP) :: crewet, tflow, flownm
character (len=15) :: nodestr
character(len=*), parameter :: fmtdry = &
&"(/1X,'WARNING: DRY CELL ENCOUNTERED AT ',a,'; RESET AS INACTIVE')"
&"(/1X,'WARNING: DRY CELL ENCOUNTERED AT ',a,'; RESET AS INACTIVE &
&WITH DRY CONCENTRATION = ', G13.5)"
character(len=*), parameter :: fmtrewet = &
&"(/1X,'DRY CELL REACTIVATED AT ', a,&
&' WITH STARTING CONCENTRATION =',G13.5)"
Expand All @@ -244,7 +245,7 @@ subroutine fmi_ad(this, cnew)
this%ibound(n) = 0
cnew(n) = DHDRY
call this%dis%noder_to_string(n, nodestr)
write(this%iout, fmtdry) trim(nodestr)
write(this%iout, fmtdry) trim(nodestr), DHDRY
endif
endif
!
Expand Down
47 changes: 24 additions & 23 deletions src/Model/GroundWaterTransport/gwt1ssm1.f90
Original file line number Diff line number Diff line change
Expand Up @@ -396,29 +396,30 @@ subroutine ssm_bdsav(this, icbcfl, ibudfl, icbcun, iprobs, &
n = this%fmi%gwfpackages(ip)%nodelist(i)
rrate = DZERO
!
! -- skip if transport cell is inactive or constant concentration
if (this%ibound(n) <= 0) cycle
!
! -- Calculate the volumetric flow rate
qbnd = this%fmi%gwfpackages(ip)%get_flow(i)
!
! -- get the first auxiliary variable
iauxpos = this%iauxpak(ip)
if(iauxpos > 0) then
cbnd = this%fmi%gwfpackages(ip)%auxvar(iauxpos, i)
else
cbnd = DZERO
endif
!
! -- Add terms based on qbnd sign
if(qbnd <= DZERO) then
ctmp = this%cnew(n)
else
ctmp = cbnd
endif
!
! -- Rate is now a mass flux
rrate = qbnd * ctmp
! -- skip calc if transport cell is inactive or constant concentration
if (this%ibound(n) > 0) then
!
! -- Calculate the volumetric flow rate
qbnd = this%fmi%gwfpackages(ip)%get_flow(i)
!
! -- get the first auxiliary variable
iauxpos = this%iauxpak(ip)
if(iauxpos > 0) then
cbnd = this%fmi%gwfpackages(ip)%auxvar(iauxpos, i)
else
cbnd = DZERO
endif
!
! -- Add terms based on qbnd sign
if(qbnd <= DZERO) then
ctmp = this%cnew(n)
else
ctmp = cbnd
endif
!
! -- Rate is now a mass flux
rrate = qbnd * ctmp
end if
!
! -- Print the individual rates if the budget is being printed
! and PRINT_FLOWS was specified (this%iprflow<0)
Expand Down
4 changes: 2 additions & 2 deletions src/Model/ModelUtilities/Xt3dInterface.f90
Original file line number Diff line number Diff line change
Expand Up @@ -879,8 +879,8 @@ subroutine xt3d_flowja(this, hnew, flowja)
call this%xt3d_qnbrs(nodes, m, n, nnbr1, inbr1, chat1j, hnew, qnbrs)
qnm = qnm - qnbrs
ipos = ii01
flowja(ipos) = qnm
flowja(this%dis%con%isym(ipos)) = -qnm
flowja(ipos) = flowja(ipos) + qnm
flowja(this%dis%con%isym(ipos)) = flowja(this%dis%con%isym(ipos)) - qnm
enddo
enddo
!
Expand Down

0 comments on commit ab912e9

Please sign in to comment.