Skip to content

Commit

Permalink
fix(evt): add check to ensure pxdp is specified correctly
Browse files Browse the repository at this point in the history
* implementation assumes user specifies pxdp in order from low to high and that values are between zero and 1.0.
* Addresses MODFLOW-USGS#938 and MODFLOW-USGS#930
  • Loading branch information
langevin-usgs committed May 11, 2022
1 parent 2df8d6e commit 1d07fe2
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 15 deletions.
6 changes: 3 additions & 3 deletions doc/mf6io/mf6ivar/dfn/gwf-evt.dfn
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ type integer
reader urword
optional false
longname number of ET segments
description number of ET segments. Default is one. When NSEG is greater than 1, PXDP and PETM arrays must be specified NSEG - 1 times each, in order from the uppermost segment down. PXDP defines the extinction-depth proportion at the bottom of a segment. PETM defines the proportion of the maximum ET flux rate at the bottom of a segment.
description number of ET segments. Default is one. When NSEG is greater than 1, the PXDP and PETM arrays must be of size NSEG - 1 and be listed in order from the uppermost segment down. Values for PXDP must be listed first followed by the values for PETM. PXDP defines the extinction-depth proportion at the bottom of a segment. PETM defines the proportion of the maximum ET flux rate at the bottom of a segment.

# --------------------- gwf evt period ---------------------

Expand Down Expand Up @@ -237,7 +237,7 @@ in_record true
reader urword
time_series true
longname proportion of ET extinction depth
description is the proportion of the ET extinction depth at the bottom of a segment (dimensionless). If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value.
description is the proportion of the ET extinction depth at the bottom of a segment (dimensionless). pxdp is an array of size (nseg - 1). Values in pxdp must be greater than 0.0 and less than 1.0. pxdp values for a cell must increase monotonically. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value.

block period
name petm
Expand All @@ -248,7 +248,7 @@ in_record true
reader urword
time_series true
longname proportion of maximum ET rate
description is the proportion of the maximum ET flux rate at the bottom of a segment (dimensionless). If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value.
description is the proportion of the maximum ET flux rate at the bottom of a segment (dimensionless). petm is an array of size (nseg - 1). If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value.

block period
name petm0
Expand Down
7 changes: 3 additions & 4 deletions doc/mf6io/mf6ivar/md/mf6ivar.md
Original file line number Diff line number Diff line change
Expand Up @@ -449,14 +449,14 @@
| GWF | EVT | OPTIONS | OBS6_FILENAME | STRING | name of input file to define observations for the Evapotranspiration package. See the ``Observation utility'' section for instructions for preparing observation input files. Tables \ref{table:gwf-obstypetable} and \ref{table:gwt-obstypetable} lists observation type(s) supported by the Evapotranspiration package. |
| GWF | EVT | OPTIONS | SURF_RATE_SPECIFIED | KEYWORD | indicates that the proportion of the evapotranspiration rate at the ET surface will be specified as PETM0 in list input. |
| GWF | EVT | DIMENSIONS | MAXBOUND | INTEGER | integer value specifying the maximum number of evapotranspiration cells cells that will be specified for use during any stress period. |
| GWF | EVT | DIMENSIONS | NSEG | INTEGER | number of ET segments. Default is one. When NSEG is greater than 1, PXDP and PETM arrays must be specified NSEG - 1 times each, in order from the uppermost segment down. PXDP defines the extinction-depth proportion at the bottom of a segment. PETM defines the proportion of the maximum ET flux rate at the bottom of a segment. |
| GWF | EVT | DIMENSIONS | NSEG | INTEGER | number of ET segments. Default is one. When NSEG is greater than 1, the PXDP and PETM arrays must be of size NSEG - 1 and be listed in order from the uppermost segment down. Values for PXDP must be listed first followed by the values for PETM. PXDP defines the extinction-depth proportion at the bottom of a segment. PETM defines the proportion of the maximum ET flux rate at the bottom of a segment. |
| GWF | EVT | PERIOD | IPER | INTEGER | integer value specifying the starting stress period number for which the data specified in the PERIOD block apply. IPER must be less than or equal to NPER in the TDIS Package and greater than zero. The IPER value assigned to a stress period block must be greater than the IPER value assigned for the previous PERIOD block. The information specified in the PERIOD block will continue to apply for all subsequent stress periods, unless the program encounters another PERIOD block. |
| GWF | EVT | PERIOD | CELLID | INTEGER (NCELLDIM) | is the cell identifier, and depends on the type of grid that is used for the simulation. For a structured grid that uses the DIS input file, CELLID is the layer, row, and column. For a grid that uses the DISV input file, CELLID is the layer and CELL2D number. If the model uses the unstructured discretization (DISU) input file, CELLID is the node number for the cell. |
| GWF | EVT | PERIOD | SURFACE | DOUBLE PRECISION | is the elevation of the ET surface ($L$). If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. |
| GWF | EVT | PERIOD | RATE | DOUBLE PRECISION | is the maximum ET flux rate ($LT^{-1}$). If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. |
| GWF | EVT | PERIOD | DEPTH | DOUBLE PRECISION | is the ET extinction depth ($L$). If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. |
| GWF | EVT | PERIOD | PXDP | DOUBLE PRECISION (NSEG-1) | is the proportion of the ET extinction depth at the bottom of a segment (dimensionless). If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. |
| GWF | EVT | PERIOD | PETM | DOUBLE PRECISION (NSEG-1) | is the proportion of the maximum ET flux rate at the bottom of a segment (dimensionless). If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. |
| GWF | EVT | PERIOD | PXDP | DOUBLE PRECISION (NSEG-1) | is the proportion of the ET extinction depth at the bottom of a segment (dimensionless). pxdp is an array of size (nseg - 1). Values in pxdp must be greater than 0.0 and less than 1.0. pxdp values for a cell must increase monotonically. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. |
| GWF | EVT | PERIOD | PETM | DOUBLE PRECISION (NSEG-1) | is the proportion of the maximum ET flux rate at the bottom of a segment (dimensionless). petm is an array of size (nseg - 1). If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. |
| GWF | EVT | PERIOD | PETM0 | DOUBLE PRECISION | is the proportion of the maximum ET flux rate that will apply when head is at or above the ET surface (dimensionless). PETM0 is read only when the SURF\_RATE\_SPECIFIED option is used. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. |
| GWF | EVT | PERIOD | AUX | DOUBLE PRECISION (NAUX) | represents the values of the auxiliary variables for each evapotranspiration. The values of auxiliary variables must be present for each evapotranspiration. The values must be specified in the order of the auxiliary variables specified in the OPTIONS block. If the package supports time series and the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. |
| GWF | EVT | PERIOD | BOUNDNAME | STRING | name of the evapotranspiration cell. BOUNDNAME is an ASCII character variable that can contain as many as 40 characters. If BOUNDNAME contains spaces in it, then the entire name must be enclosed within single quotes. |
Expand Down Expand Up @@ -497,7 +497,6 @@
| GWF | MAW | OPTIONS | SHUTDOWN_THETA | DOUBLE PRECISION | value that defines the weight applied to discharge rate for wells that limit the water level in a discharging well (defined using the HEAD\_LIMIT keyword in the stress period data). SHUTDOWN\_THETA is used to control discharge rate oscillations when the flow rate from the aquifer is less than the specified flow rate from the aquifer to the well. Values range between 0.0 and 1.0, and larger values increase the weight (decrease under-relaxation) applied to the well discharge rate. The HEAD\_LIMIT option has been included to facilitate backward compatibility with previous versions of MODFLOW but use of the RATE\_SCALING option instead of the HEAD\_LIMIT option is recommended. By default, SHUTDOWN\_THETA is 0.7. |
| GWF | MAW | OPTIONS | SHUTDOWN_KAPPA | DOUBLE PRECISION | value that defines the weight applied to discharge rate for wells that limit the water level in a discharging well (defined using the HEAD\_LIMIT keyword in the stress period data). SHUTDOWN\_KAPPA is used to control discharge rate oscillations when the flow rate from the aquifer is less than the specified flow rate from the aquifer to the well. Values range between 0.0 and 1.0, and larger values increase the weight applied to the well discharge rate. The HEAD\_LIMIT option has been included to facilitate backward compatibility with previous versions of MODFLOW but use of the RATE\_SCALING option instead of the HEAD\_LIMIT option is recommended. By default, SHUTDOWN\_KAPPA is 0.0001. |
| GWF | MAW | OPTIONS | MAW_FLOW_REDUCE_CSV | KEYWORD | keyword to specify that record corresponds to the output option in which a new record is written for each multi-aquifer well and for each time step in which the user-requested extraction or injection rate is reduced by the program. |
| GWF | MAW | OPTIONS | FILEOUT | KEYWORD | keyword to specify that an output filename is expected next. |
| GWF | MAW | OPTIONS | MFRCSVFILE | STRING | name of the comma-separated value (CSV) output file to write information about multi-aquifer well extraction or injection rates that have been reduced by the program. Entries are only written if the extraction or injection rates are reduced. |
| GWF | MAW | OPTIONS | TS6 | KEYWORD | keyword to specify that record corresponds to a time-series file. |
| GWF | MAW | OPTIONS | FILEIN | KEYWORD | keyword to specify that an input filename is expected next. |
Expand Down
6 changes: 3 additions & 3 deletions doc/mf6io/mf6ivar/tex/gwf-evt-desc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
\begin{description}
\item \texttt{maxbound}---integer value specifying the maximum number of evapotranspiration cells cells that will be specified for use during any stress period.

\item \texttt{nseg}---number of ET segments. Default is one. When NSEG is greater than 1, PXDP and PETM arrays must be specified NSEG - 1 times each, in order from the uppermost segment down. PXDP defines the extinction-depth proportion at the bottom of a segment. PETM defines the proportion of the maximum ET flux rate at the bottom of a segment.
\item \texttt{nseg}---number of ET segments. Default is one. When NSEG is greater than 1, the PXDP and PETM arrays must be of size NSEG - 1 and be listed in order from the uppermost segment down. Values for PXDP must be listed first followed by the values for PETM. PXDP defines the extinction-depth proportion at the bottom of a segment. PETM defines the proportion of the maximum ET flux rate at the bottom of a segment.

\end{description}
\item \textbf{Block: PERIOD}
Expand All @@ -51,9 +51,9 @@

\item \textcolor{blue}{\texttt{depth}---is the ET extinction depth ($L$). If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value.}

\item \textcolor{blue}{\texttt{pxdp}---is the proportion of the ET extinction depth at the bottom of a segment (dimensionless). If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value.}
\item \textcolor{blue}{\texttt{pxdp}---is the proportion of the ET extinction depth at the bottom of a segment (dimensionless). pxdp is an array of size (nseg - 1). Values in pxdp must be greater than 0.0 and less than 1.0. pxdp values for a cell must increase monotonically. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value.}

\item \textcolor{blue}{\texttt{petm}---is the proportion of the maximum ET flux rate at the bottom of a segment (dimensionless). If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value.}
\item \textcolor{blue}{\texttt{petm}---is the proportion of the maximum ET flux rate at the bottom of a segment (dimensionless). petm is an array of size (nseg - 1). If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value.}

\item \textcolor{blue}{\texttt{petm0}---is the proportion of the maximum ET flux rate that will apply when head is at or above the ET surface (dimensionless). PETM0 is read only when the SURF\_RATE\_SPECIFIED option is used. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value.}

Expand Down
2 changes: 0 additions & 2 deletions doc/mf6io/mf6ivar/tex/gwf-maw-desc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@

\item \texttt{MAW\_FLOW\_REDUCE\_CSV}---keyword to specify that record corresponds to the output option in which a new record is written for each multi-aquifer well and for each time step in which the user-requested extraction or injection rate is reduced by the program.

\item \texttt{FILEOUT}---keyword to specify that an output filename is expected next.

\item \texttt{mfrcsvfile}---name of the comma-separated value (CSV) output file to write information about multi-aquifer well extraction or injection rates that have been reduced by the program. Entries are only written if the extraction or injection rates are reduced.

\item \texttt{TS6}---keyword to specify that record corresponds to a time-series file.
Expand Down
80 changes: 77 additions & 3 deletions src/Model/GroundWaterFlow/gwf3evt8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module EvtModule
use ConstantsModule, only: DZERO, DONE, LENFTYPE, LENPACKAGENAME, MAXCHARLEN
use MemoryHelperModule, only: create_mem_path
use BndModule, only: BndType
use SimModule, only: store_error, store_error_unit
use SimModule, only: store_error, store_error_unit, count_errors
use SimVariablesModule, only: errmsg
use ObsModule, only: DefaultObsIdProcessor
use TimeArraySeriesLinkModule, only: TimeArraySeriesLinkType
use TimeSeriesLinkModule, only: TimeSeriesLinkType, &
Expand Down Expand Up @@ -45,6 +46,7 @@ module EvtModule
procedure, private :: evt_rp_array
procedure, private :: evt_rp_list
procedure, private :: default_nodelist
procedure, private :: check_pxdp
! -- for observations
procedure, public :: bnd_obs_supported => evt_obs_supported
procedure, public :: bnd_df_obs => evt_df_obs
Expand Down Expand Up @@ -234,7 +236,7 @@ subroutine evt_read_dimensions(this)
! -- dummy
class(EvtType),intent(inout) :: this
! -- local
character(len=LINELENGTH) :: errmsg, keyword
character(len=LINELENGTH) :: keyword
integer(I4B) :: ierr
logical :: isfound, endOfBlock
! -- format
Expand Down Expand Up @@ -363,7 +365,7 @@ subroutine evt_rp(this)
integer(I4B) :: inievt, inrate, insurf, indepth
integer(I4B) :: kpxdp, kpetm
logical :: isfound, supportopenclose
character(len=LINELENGTH) :: line, msg, errmsg
character(len=LINELENGTH) :: line, msg
! -- formats
character(len=*),parameter :: fmtblkerr = &
"('Error. Looking for BEGIN PERIOD iper. Found ', a, ' instead.')"
Expand Down Expand Up @@ -462,11 +464,83 @@ subroutine evt_rp(this)
this%bound(2, n) = this%bound(2, n) * this%dis%get_area(node)
end if
enddo
!
! -- ensure pxdp is monotonically increasing
if (this%nseg > 1) then
call this%check_pxdp()
end if
endif
!
! -- return
return
end subroutine evt_rp

!> @brief Subroutine to check pxdp
!!
!! If the number of EVT segments (nseg) is greater than one, then
!! pxdp must be monotically increasing from zero to one. Check
!! to make sure this is the case.
!!
!<
subroutine check_pxdp(this)
! -- dummy
class(EvtType),intent(inout) :: this !< EvtType
! -- local
integer(I4B) :: n
integer(I4B) :: node
integer(I4B) :: i
integer(I4B) :: ierrmono
real(DP) :: pxdp1
real(DP) :: pxdp2
character(len=15) :: nodestr
! -- formats
character(len=*), parameter :: fmtpxdp0 = &
"('PXDP must be between 0 and 1. Found ', G0, ' for cell ', A)"
character(len=*), parameter :: fmtpxdp = &
"('PXDP is not monotonically increasing for cell ', A)"
!
! -- check and make sure that pxdp is monotonically increasing and
! that pxdp values are between 0 and 1
do n = 1, this%nbound
node = this%nodelist(n)
pxdp1 = DZERO
ierrmono = 0
segloop: do i = 1, this%nseg
!
! -- set and check pxdp2
if (i < this%nseg) then
pxdp2 = this%bound(i + 3, n)
if (pxdp2 <= DZERO .or. pxdp2 >= DONE) then
call this%dis%noder_to_string(node, nodestr)
write(errmsg, fmtpxdp0) pxdp2, trim(nodestr)
call store_error(errmsg)
end if
else
pxdp2 = DONE
end if
!
! -- check for monotonically increasing condition
if (pxdp2 - pxdp1 < DZERO) then
if (ierrmono == 0) then
! -- only store mono error once for each node
call this%dis%noder_to_string(node, nodestr)
write(errmsg, fmtpxdp) trim(nodestr)
call store_error(errmsg)
end if
ierrmono = 1
end if
pxdp1 = pxdp2
end do segloop
end do
!
! -- terminate if errors encountered
if (count_errors() > 0) then
call this%parser%StoreErrorUnit()
end if
!
! -- return
return
end subroutine check_pxdp

subroutine set_nodesontop(this)
! ******************************************************************************
Expand Down

0 comments on commit 1d07fe2

Please sign in to comment.