MODFLOW 6  version 6.7.0.dev0
USGS Modular Hydrologic Model
gwfstorageutilsmodule Module Reference

This module contains stateless storage subroutines and functions. More...

Functions/Subroutines

pure subroutine, public ssterms (iconvert, iorig_ss, iconf_ss, top, bot, rho1, rho1old, snnew, snold, hnew, hold, aterm, rhsterm, rate)
 Calculate the specific storage terms. More...
 
pure subroutine, public syterms (top, bot, rho2, rho2old, snnew, snold, aterm, rhsterm, rate)
 Calculate the specific yield storage terms. More...
 
pure real(dp) function, public sscapacity (istor_coef, top, bot, area, ss)
 Calculate the specific storage capacity. More...
 
pure real(dp) function, public sycapacity (area, sy)
 Calculate the specific yield capacity. More...
 

Detailed Description

This module contains the functions to calculate the specific storage (SC1) and specific yield (SC2) capacities that are used in the storage (STO) package. It also contains subroutines to calculate the amat and rhs terms for specific storage and specific yield. This module does not depend on the STO package.

Function/Subroutine Documentation

◆ sscapacity()

pure real(dp) function, public gwfstorageutilsmodule::sscapacity ( integer(i4b), intent(in)  istor_coef,
real(dp), intent(in)  top,
real(dp), intent(in)  bot,
real(dp), intent(in)  area,
real(dp), intent(in)  ss 
)

Function to calculate the specific storage capacity using the cell geometry and the specific storage or storage coefficient.

Returns
sc1 specific storage capacity
Parameters
[in]istor_coefflag indicating if ss is the storage coefficient
[in]toptop of cell
[in]botbottom of cell
[in]areahorizontal cell area
[in]ssspecific storage or storage coefficient

Definition at line 143 of file GwfStorageUtils.f90.

144  ! -- dummy variables
145  integer(I4B), intent(in) :: istor_coef !< flag indicating if ss is the storage coefficient
146  real(DP), intent(in) :: top !< top of cell
147  real(DP), intent(in) :: bot !< bottom of cell
148  real(DP), intent(in) :: area !< horizontal cell area
149  real(DP), intent(in) :: ss !< specific storage or storage coefficient
150  ! -- local variables
151  real(DP) :: sc1
152  real(DP) :: thick
153  ! -- calculate specific storage capacity
154  if (istor_coef == 0) then
155  thick = top - bot
156  else
157  thick = done
158  end if
159  sc1 = ss * thick * area
Here is the caller graph for this function:

◆ ssterms()

pure subroutine, public gwfstorageutilsmodule::ssterms ( integer(i4b), intent(in)  iconvert,
integer(i4b), intent(in)  iorig_ss,
integer(i4b), intent(in)  iconf_ss,
real(dp), intent(in)  top,
real(dp), intent(in)  bot,
real(dp), intent(in)  rho1,
real(dp), intent(in)  rho1old,
real(dp), intent(in)  snnew,
real(dp), intent(in)  snold,
real(dp), intent(in)  hnew,
real(dp), intent(in)  hold,
real(dp), intent(inout)  aterm,
real(dp), intent(inout)  rhsterm,
real(dp), intent(inout), optional  rate 
)

Subroutine to calculate the specific storage terms for a cell using the cell geometry, current and previous specific storage capacity, current and previous cell saturation, and the current and previous head. Subroutine can optionally return the flow rate from specific storage.

Parameters
[in]iconvertflag indicating if cell is convertible
[in]iorig_ssflag indicating if the original MODFLOW 6 specific storage formulation is being used
[in]iconf_ssflag indicating if specific storage only applies under confined conditions
[in]toptop of cell
[in]botbottom of cell
[in]rho1current specific storage capacity
[in]rho1oldprevious specific storage capacity
[in]snnewcurrent cell saturation
[in]snoldprevious cell saturation
[in]hnewcurrent head
[in]holdprevious head
[in,out]atermcoefficient matrix term
[in,out]rhstermright-hand side term
[in,out]ratecalculated specific storage rate

Definition at line 32 of file GwfStorageUtils.f90.

35  ! -- dummy variables
36  integer(I4B), intent(in) :: iconvert !< flag indicating if cell is convertible
37  integer(I4B), intent(in) :: iorig_ss !< flag indicating if the original MODFLOW 6 specific storage formulation is being used
38  integer(I4B), intent(in) :: iconf_ss !< flag indicating if specific storage only applies under confined conditions
39  real(DP), intent(in) :: top !< top of cell
40  real(DP), intent(in) :: bot !< bottom of cell
41  real(DP), intent(in) :: rho1 !< current specific storage capacity
42  real(DP), intent(in) :: rho1old !< previous specific storage capacity
43  real(DP), intent(in) :: snnew !< current cell saturation
44  real(DP), intent(in) :: snold !< previous cell saturation
45  real(DP), intent(in) :: hnew !< current head
46  real(DP), intent(in) :: hold !< previous head
47  real(DP), intent(inout) :: aterm !< coefficient matrix term
48  real(DP), intent(inout) :: rhsterm !< right-hand side term
49  real(DP), intent(inout), optional :: rate !< calculated specific storage rate
50  ! -- local variables
51  real(DP) :: tthk
52  real(DP) :: zold
53  real(DP) :: znew
54  !
55  ! -- initialize terms
56  aterm = -rho1 * snnew
57  rhsterm = dzero
58  !
59  ! -- calculate specific storage terms
60  if (iconvert /= 0) then
61  if (iorig_ss == 0) then
62  if (iconf_ss == 0) then
63  tthk = top - bot
64  zold = bot + dhalf * tthk * snold
65  znew = bot + dhalf * tthk * snnew
66  rhsterm = -rho1old * snold * (hold - zold) - rho1 * snnew * znew
67  else
68  if (snold == done) then
69  rhsterm = rhsterm - rho1old * (hold - top)
70  end if
71  if (snnew == done) then
72  rhsterm = rhsterm - rho1 * top
73  else
74  aterm = dzero
75  end if
76  end if
77  else
78  rhsterm = -rho1old * snold * hold
79  end if
80  else
81  rhsterm = -rho1old * snold * hold
82  end if
83  !
84  ! -- calculate rate
85  if (present(rate)) then
86  rate = aterm * hnew - rhsterm
87  end if
Here is the caller graph for this function:

◆ sycapacity()

pure real(dp) function, public gwfstorageutilsmodule::sycapacity ( real(dp), intent(in)  area,
real(dp), intent(in)  sy 
)

Function to calculate the specific yield capacity using the cell area and the specific yield.

Returns
sc2 specific yield capacity
Parameters
[in]areahorizontal cell area
[in]syspecific yield

Definition at line 169 of file GwfStorageUtils.f90.

170  ! -- dummy variables
171  real(DP), intent(in) :: area !< horizontal cell area
172  real(DP), intent(in) :: sy !< specific yield
173  ! -- local variables
174  real(DP) :: sc2
175  ! -- calculate specific yield capacity
176  sc2 = sy * area
Here is the caller graph for this function:

◆ syterms()

pure subroutine, public gwfstorageutilsmodule::syterms ( real(dp), intent(in)  top,
real(dp), intent(in)  bot,
real(dp), intent(in)  rho2,
real(dp), intent(in)  rho2old,
real(dp), intent(in)  snnew,
real(dp), intent(in)  snold,
real(dp), intent(inout)  aterm,
real(dp), intent(inout)  rhsterm,
real(dp), intent(inout), optional  rate 
)

Subroutine to calculate the specific yield storage terms for a cell using the cell geometry, current and previous specific yield storage capacity, and the current and previous cell saturation. Subroutine can optionally return the flow rate from specific yield.

Parameters
[in]toptop of cell
[in]botbottom of cell
[in]rho2current specific yield storage capacity
[in]rho2oldprevious specific yield storage capacity
[in]snnewcurrent cell saturation
[in]snoldprevious cell saturation
[in,out]atermcoefficient matrix term
[in,out]rhstermright-hand side term
[in,out]ratecalculated specific yield rate

Definition at line 98 of file GwfStorageUtils.f90.

100  ! -- dummy variables
101  real(DP), intent(in) :: top !< top of cell
102  real(DP), intent(in) :: bot !< bottom of cell
103  real(DP), intent(in) :: rho2 !< current specific yield storage capacity
104  real(DP), intent(in) :: rho2old !< previous specific yield storage capacity
105  real(DP), intent(in) :: snnew !< current cell saturation
106  real(DP), intent(in) :: snold !< previous cell saturation
107  real(DP), intent(inout) :: aterm !< coefficient matrix term
108  real(DP), intent(inout) :: rhsterm !< right-hand side term
109  real(DP), intent(inout), optional :: rate !< calculated specific yield rate
110  ! -- local variables
111  real(DP) :: tthk
112  !
113  ! -- initialize terms
114  aterm = dzero
115  tthk = top - bot
116  !
117  ! -- calculate specific yield storage terms
118  if (snnew < done) then
119  if (snnew > dzero) then
120  aterm = -rho2
121  rhsterm = -rho2old * tthk * snold - rho2 * bot
122  else
123  rhsterm = tthk * (dzero - rho2old * snold)
124  end if
125  ! -- known flow from specific yield
126  else
127  rhsterm = tthk * (rho2 * snnew - rho2old * snold)
128  end if
129  !
130  ! -- calculate rate
131  if (present(rate)) then
132  rate = rho2old * tthk * snold - rho2 * tthk * snnew
133  end if
Here is the caller graph for this function: