MODFLOW 6  version 6.6.0.dev0
USGS Modular Hydrologic Model
GwfSfrCommon.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

real(dp) function kinematic_residual (qa, qb, qc, qd, aa, ab, ac, ad, qsrc, length, weight, delt, courant)
 Kinematic routing equation residual. More...
 
real(dp) function kinematic_storage (aa, ab, ac, ad, length, delt, courant)
 Kinematic routing equation storage term. More...
 

Function/Subroutine Documentation

◆ kinematic_residual()

real(dp) function kinematic_residual ( real(dp), intent(in)  qa,
real(dp), intent(in)  qb,
real(dp), intent(in)  qc,
real(dp), intent(in)  qd,
real(dp), intent(in)  aa,
real(dp), intent(in)  ab,
real(dp), intent(in)  ac,
real(dp), intent(in)  ad,
real(dp), intent(in)  qsrc,
real(dp), intent(in)  length,
real(dp), intent(in)  weight,
real(dp), intent(in)  delt,
real(dp), intent(in)  courant 
)

Method to calculate the kinematic-wave routing residual.

Returns
kinematic-wave residual
Parameters
[in]qaupstream flow at previous time
[in]qbdownstream flow at previous time
[in]qcupstream flow
[in]qddownstream flow
[in]aaupstream area at previous time
[in]abdownstream area at previous time
[in]acupstream area
[in]addownstream area
[in]qsrclateral flow term (L3T-1L-1)
[in]lengthreach length
[in]weighttemporal weight
[in]delttime step length
[in]courantcourant number

Definition at line 7 of file GwfSfrCommon.f90.

11  use kindmodule, only: dp
12  use constantsmodule, only: dzero, dhalf, done
13  ! -- return variable
14  real(DP) :: kinematic_residual !< kinematic-wave residual
15  ! -- dummy variables
16  real(DP), intent(in) :: qa !< upstream flow at previous time
17  real(DP), intent(in) :: qb !< downstream flow at previous time
18  real(DP), intent(in) :: qc !< upstream flow
19  real(DP), intent(in) :: qd !< downstream flow
20  real(DP), intent(in) :: aa !< upstream area at previous time
21  real(DP), intent(in) :: ab !< downstream area at previous time
22  real(DP), intent(in) :: ac !< upstream area
23  real(DP), intent(in) :: ad !< downstream area
24  real(DP), intent(in) :: qsrc !< lateral flow term (L3T-1L-1)
25  real(DP), intent(in) :: length !< reach length
26  real(DP), intent(in) :: weight !< temporal weight
27  real(DP), intent(in) :: delt !< time step length
28  real(DP), intent(in) :: courant !< courant number
29  ! --local variables
30  real(DP) :: f11
31  real(DP) :: f12
32 
33  if (courant > done) then
34  f11 = (qd - qc) / length
35  f12 = (ac - aa) / delt
36  else
37  f11 = (weight * (qd - qc) + (done - weight) * (qb - qa)) / length
38  f12 = dhalf * ((ad - ab) + (ac - aa)) / delt
39  end if
40  kinematic_residual = f11 + f12 - qsrc
41 
real(dp) function kinematic_residual(qa, qb, qc, qd, aa, ab, ac, ad, qsrc, length, weight, delt, courant)
Kinematic routing equation residual.
This module contains simulation constants.
Definition: Constants.f90:9
real(dp), parameter dhalf
real constant 1/2
Definition: Constants.f90:68
real(dp), parameter dzero
real constant zero
Definition: Constants.f90:65
real(dp), parameter done
real constant 1
Definition: Constants.f90:76
This module defines variable data types.
Definition: kind.f90:8

◆ kinematic_storage()

real(dp) function kinematic_storage ( real(dp), intent(in)  aa,
real(dp), intent(in)  ab,
real(dp), intent(in)  ac,
real(dp), intent(in)  ad,
real(dp), intent(in)  length,
real(dp), intent(in)  delt,
real(dp), intent(in)  courant 
)

Method to calculate the kinematic-wave routing storage term.

Returns
kinematic-wave storage change
Parameters
[in]aaupstream area at previous time
[in]abdownstream area at previous time
[in]acupstream area
[in]addownstream area
[in]lengthreach length
[in]delttime step length
[in]courantcourant number

Definition at line 50 of file GwfSfrCommon.f90.

51  use kindmodule, only: dp
52  use constantsmodule, only: dhalf
53 
54  real(DP) :: kinematic_storage !< kinematic-wave storage change
55 
56  real(DP), intent(in) :: aa !< upstream area at previous time
57  real(DP), intent(in) :: ab !< downstream area at previous time
58  real(DP), intent(in) :: ac !< upstream area
59  real(DP), intent(in) :: ad !< downstream area
60  real(DP), intent(in) :: length !< reach length
61  real(DP), intent(in) :: delt !< time step length
62  real(DP), intent(in) :: courant !< courant number
63 
64  if (courant > done) then
65  kinematic_storage = (aa - ac) * length / delt
66  else
67  kinematic_storage = dhalf * ((ac + ad) - (aa + ab)) * length / delt
68  end if
69 
real(dp) function kinematic_storage(aa, ab, ac, ad, length, delt, courant)
Kinematic routing equation storage term.