MODFLOW 6  version 6.9.0.dev0
USGS Modular Hydrologic Model
gwesfemodule Module Reference

Data Types

type  gwesfetype
 

Functions/Subroutines

subroutine, public sfe_create (packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath, fmi, eqnsclfac, gwecommon, dvt, dvu, dvua)
 Create a new sfe package. More...
 
subroutine find_sfe_package (this)
 Find corresponding sfe package. More...
 
real(dp) function sfe_setting_value (this, itemno, key)
 Value for a package-specific PERIOD setting. More...
 
subroutine sfe_fc_expanded (this, rhs, ia, idxglo, matrix_sln)
 Add matrix terms related to SFE. More...
 
subroutine sfe_solve (this)
 @ brief Add terms specific to sfr to the explicit sfe solve More...
 
integer(i4b) function sfe_get_nbudterms (this)
 Function to return the number of budget terms just for this package. More...
 
subroutine sfe_setup_budobj (this, idx)
 Set up the budget object that stores all the sfe flows. More...
 
subroutine sfe_fill_budobj (this, idx, x, flowja, ccratin, ccratout)
 Copy flow terms into thisbudobj. More...
 
subroutine allocate_scalars (this)
 Allocate scalars specific to the streamflow energy transport (SFE) package. More...
 
subroutine sfe_allocate_arrays (this)
 Allocate arrays specific to the streamflow energy transport (SFE) package. More...
 
subroutine sfe_ad (this)
 Advance sfe package routine. More...
 
subroutine sfe_da (this)
 Deallocate memory. More...
 
subroutine sfe_rain_term (this, ientry, n1, n2, rrate, rhsval, hcofval)
 Rain term. More...
 
subroutine sfe_evap_term (this, ientry, n1, n2, rrate, rhsval, hcofval)
 Evaporative term. More...
 
subroutine sfe_roff_term (this, ientry, n1, n2, rrate, rhsval, hcofval)
 Runoff term. More...
 
subroutine sfe_iflw_term (this, ientry, n1, n2, rrate, rhsval, hcofval)
 Inflow Term. More...
 
subroutine sfe_outf_term (this, ientry, n1, n2, rrate, rhsval, hcofval)
 Outflow term. More...
 
subroutine sfe_sbcd_term (this, ientry, n1, igwfnode, rrate, rhsval, hcofval)
 Streambed conduction term. More...
 
subroutine sfe_df_obs (this)
 Observations. More...
 
subroutine sfe_rp_obs (this, obsrv, found)
 Process package specific obs. More...
 
subroutine sfe_bd_obs (this, obstypeid, jj, v, found)
 Calculate observation value and pass it back to APT. More...
 
subroutine sfe_read_cvs (this)
 Source SFE PACKAGEDATA, including thermal conduction fields. More...
 
subroutine sfe_get_volumes (this, icv, vnew, vold, delt)
 Return the sfr new volume and old volume. More...
 

Variables

character(len= *), parameter ftype = 'SFE'
 
character(len= *), parameter flowtype = 'SFR'
 
character(len=16) text = ' SFE'
 

Function/Subroutine Documentation

◆ allocate_scalars()

subroutine gwesfemodule::allocate_scalars ( class(gwesfetype)  this)
private

Definition at line 681 of file gwe-sfe.f90.

682  ! -- modules
684  ! -- dummy
685  class(GweSfeType) :: this
686  !
687  ! -- Allocate scalars in TspAptType
688  call this%TspAptType%allocate_scalars()
689  !
690  ! -- Allocate
691  call mem_allocate(this%idxbudrain, 'IDXBUDRAIN', this%memoryPath)
692  call mem_allocate(this%idxbudevap, 'IDXBUDEVAP', this%memoryPath)
693  call mem_allocate(this%idxbudroff, 'IDXBUDROFF', this%memoryPath)
694  call mem_allocate(this%idxbudiflw, 'IDXBUDIFLW', this%memoryPath)
695  call mem_allocate(this%idxbudoutf, 'IDXBUDOUTF', this%memoryPath)
696  !
697  ! -- Initialize
698  this%idxbudrain = 0
699  this%idxbudevap = 0
700  this%idxbudroff = 0
701  this%idxbudiflw = 0
702  this%idxbudoutf = 0

◆ find_sfe_package()

subroutine gwesfemodule::find_sfe_package ( class(gwesfetype)  this)
private

Definition at line 177 of file gwe-sfe.f90.

178  ! -- modules
180  ! -- dummy
181  class(GweSfeType) :: this
182  ! -- local
183  character(len=LINELENGTH) :: errmsg
184  class(BndType), pointer :: packobj
185  integer(I4B) :: ip, icount
186  integer(I4B) :: nbudterm
187  logical :: found
188  !
189  ! -- Initialize found to false, and error later if flow package cannot
190  ! be found
191  found = .false.
192  !
193  ! -- If user is specifying flows in a binary budget file, then set up
194  ! the budget file reader, otherwise set a pointer to the flow package
195  ! budobj
196  if (this%fmi%flows_from_file) then
197  call this%fmi%set_aptbudobj_pointer(this%flowpackagename, this%flowbudptr)
198  if (associated(this%flowbudptr)) found = .true.
199  !
200  else
201  if (associated(this%fmi%gwfbndlist)) then
202  ! -- Look through gwfbndlist for a flow package with the same name as
203  ! this transport package name
204  do ip = 1, this%fmi%gwfbndlist%Count()
205  packobj => getbndfromlist(this%fmi%gwfbndlist, ip)
206  if (packobj%packName == this%flowpackagename) then
207  found = .true.
208  !
209  ! -- Store BndType pointer to packobj, and then
210  ! use the select type to point to the budobj in flow package
211  this%flowpackagebnd => packobj
212  select type (packobj)
213  type is (sfrtype)
214  this%flowbudptr => packobj%budobj
215  end select
216  end if
217  if (found) exit
218  end do
219  end if
220  end if
221  !
222  ! -- Error if flow package not found
223  if (.not. found) then
224  write (errmsg, '(a)') 'Could not find flow package with name '&
225  &//trim(adjustl(this%flowpackagename))//'.'
226  call store_error(errmsg)
227  call store_error_filename(this%input_fname)
228  end if
229  !
230  ! -- Allocate space for idxbudssm, which indicates whether this is a
231  ! special budget term or one that is a general source and sink
232  nbudterm = this%flowbudptr%nbudterm
233  call mem_allocate(this%idxbudssm, nbudterm, 'IDXBUDSSM', this%memoryPath)
234  !
235  ! -- Process budget terms and identify special budget terms
236  write (this%iout, '(/, a, a)') &
237  'PROCESSING '//ftype//' INFORMATION FOR ', this%packName
238  write (this%iout, '(a)') ' IDENTIFYING FLOW TERMS IN '//flowtype//' PACKAGE'
239  write (this%iout, '(a, i0)') &
240  ' NUMBER OF '//flowtype//' = ', this%flowbudptr%ncv
241  icount = 1
242  do ip = 1, this%flowbudptr%nbudterm
243  select case (trim(adjustl(this%flowbudptr%budterm(ip)%flowtype)))
244  case ('FLOW-JA-FACE')
245  this%idxbudfjf = ip
246  this%idxbudssm(ip) = 0
247  case ('GWF')
248  this%idxbudgwf = ip
249  this%idxbudssm(ip) = 0
250  case ('STORAGE')
251  this%idxbudsto = ip
252  this%idxbudssm(ip) = 0
253  case ('RAINFALL')
254  this%idxbudrain = ip
255  this%idxbudssm(ip) = 0
256  case ('EVAPORATION')
257  this%idxbudevap = ip
258  this%idxbudssm(ip) = 0
259  case ('RUNOFF')
260  this%idxbudroff = ip
261  this%idxbudssm(ip) = 0
262  case ('EXT-INFLOW')
263  this%idxbudiflw = ip
264  this%idxbudssm(ip) = 0
265  case ('EXT-OUTFLOW')
266  this%idxbudoutf = ip
267  this%idxbudssm(ip) = 0
268  case ('TO-MVR')
269  this%idxbudtmvr = ip
270  this%idxbudssm(ip) = 0
271  case ('FROM-MVR')
272  this%idxbudfmvr = ip
273  this%idxbudssm(ip) = 0
274  case ('AUXILIARY')
275  this%idxbudaux = ip
276  this%idxbudssm(ip) = 0
277  case default
278  !
279  ! -- Set idxbudssm equal to a column index for where the temperatures
280  ! are stored in the concbud(nbudssm, ncv) array
281  this%idxbudssm(ip) = icount
282  icount = icount + 1
283  end select
284  write (this%iout, '(a, i0, " = ", a,/, a, i0)') &
285  ' TERM ', ip, trim(adjustl(this%flowbudptr%budterm(ip)%flowtype)), &
286  ' MAX NO. OF ENTRIES = ', this%flowbudptr%budterm(ip)%maxlist
287  end do
288  write (this%iout, '(a, //)') 'DONE PROCESSING '//ftype//' INFORMATION'
Here is the call graph for this function:

◆ sfe_ad()

subroutine gwesfemodule::sfe_ad ( class(gwesfetype)  this)

Definition at line 738 of file gwe-sfe.f90.

739  ! -- dummy
740  class(GweSfeType) :: this
741  ! -- local
742  integer(I4B) :: n
743  !
744  ! -- call base bnd_ad and run the per-timestep resync directly
745  ! (see apt_ad_resync)
746  call this%BndExtType%bnd_ad()
747  call this%apt_ad_resync()
748  !
749  ! -- update vold
750  do n = 1, this%ncv
751  this%vold(n) = this%vnew(n)
752  end do
753 

◆ sfe_allocate_arrays()

subroutine gwesfemodule::sfe_allocate_arrays ( class(gwesfetype), intent(inout)  this)

Definition at line 708 of file gwe-sfe.f90.

709  ! -- modules
711  ! -- dummy
712  class(GweSfeType), intent(inout) :: this
713  ! -- local
714  integer(I4B) :: n
715  !
716  ! -- alias into the input context's permanent, feature-indexed arrays
717  ! (allocated and DZERO-initialized by the input context)
718  call mem_setptr(this%temprain, 'RAINFALL', this%input_mempath)
719  call mem_setptr(this%tempevap, 'EVAPORATION', this%input_mempath)
720  call mem_setptr(this%temproff, 'RUNOFF', this%input_mempath)
721  call mem_setptr(this%tempiflw, 'INFLOW', this%input_mempath)
722  !
723  call mem_allocate(this%vnew, this%ncv, 'VNEW', this%memoryPath)
724  call mem_allocate(this%vold, this%ncv, 'VOLD', this%memoryPath)
725  !
726  ! -- Call standard TspAptType allocate arrays
727  call this%TspAptType%apt_allocate_arrays()
728  !
729  ! -- Initialize
730  do n = 1, this%ncv
731  this%vnew(n) = dzero
732  this%vold(n) = dzero
733  end do

◆ sfe_bd_obs()

subroutine gwesfemodule::sfe_bd_obs ( class(gwesfetype), intent(inout)  this,
character(len=*), intent(in)  obstypeid,
integer(i4b), intent(in)  jj,
real(dp), intent(inout)  v,
logical, intent(inout)  found 
)
private

Definition at line 1067 of file gwe-sfe.f90.

1068  ! -- dummy
1069  class(GweSfeType), intent(inout) :: this
1070  character(len=*), intent(in) :: obstypeid
1071  real(DP), intent(inout) :: v
1072  integer(I4B), intent(in) :: jj
1073  logical, intent(inout) :: found
1074  ! -- local
1075  integer(I4B) :: n1, n2
1076  !
1077  found = .true.
1078  select case (obstypeid)
1079  case ('RAINFALL')
1080  if (this%iboundpak(jj) /= 0) then
1081  call this%sfe_rain_term(jj, n1, n2, v)
1082  end if
1083  case ('EVAPORATION')
1084  if (this%iboundpak(jj) /= 0) then
1085  call this%sfe_evap_term(jj, n1, n2, v)
1086  end if
1087  case ('RUNOFF')
1088  if (this%iboundpak(jj) /= 0) then
1089  call this%sfe_roff_term(jj, n1, n2, v)
1090  end if
1091  case ('EXT-INFLOW')
1092  if (this%iboundpak(jj) /= 0) then
1093  call this%sfe_iflw_term(jj, n1, n2, v)
1094  end if
1095  case ('EXT-OUTFLOW')
1096  if (this%iboundpak(jj) /= 0) then
1097  call this%sfe_outf_term(jj, n1, n2, v)
1098  end if
1099  case ('STRMBD-COND')
1100  if (this%iboundpak(jj) /= 0) then
1101  call this%sfe_sbcd_term(jj, n1, n2, v)
1102  end if
1103  case default
1104  found = .false.
1105  end select

◆ sfe_create()

subroutine, public gwesfemodule::sfe_create ( class(bndtype), pointer  packobj,
integer(i4b), intent(in)  id,
integer(i4b), intent(in)  ibcnum,
integer(i4b), intent(in)  inunit,
integer(i4b), intent(in)  iout,
character(len=*), intent(in)  namemodel,
character(len=*), intent(in)  pakname,
character(len=*), intent(in)  mempath,
type(tspfmitype), pointer  fmi,
real(dp), intent(in), pointer  eqnsclfac,
type(gweinputdatatype), intent(in), target  gwecommon,
character(len=*), intent(in)  dvt,
character(len=*), intent(in)  dvu,
character(len=*), intent(in)  dvua 
)
Parameters
[in]mempathinput memory path
[in]eqnsclfacGoverning equation scale factor
[in]gwecommonShared data container for use by multiple GWE packages
[in]dvtFor GWE, set to "TEMPERATURE" in TspAptType
[in]dvuFor GWE, set to "energy" in TspAptType
[in]dvuaFor GWE, set to "E" in TspAptType

Definition at line 114 of file gwe-sfe.f90.

116  ! -- dummy
117  class(BndType), pointer :: packobj
118  integer(I4B), intent(in) :: id
119  integer(I4B), intent(in) :: ibcnum
120  integer(I4B), intent(in) :: inunit
121  integer(I4B), intent(in) :: iout
122  character(len=*), intent(in) :: namemodel
123  character(len=*), intent(in) :: pakname
124  character(len=*), intent(in) :: mempath !< input memory path
125  type(TspFmiType), pointer :: fmi
126  real(DP), intent(in), pointer :: eqnsclfac !< Governing equation scale factor
127  type(GweInputDataType), intent(in), target :: gwecommon !< Shared data container for use by multiple GWE packages
128  character(len=*), intent(in) :: dvt !< For GWE, set to "TEMPERATURE" in TspAptType
129  character(len=*), intent(in) :: dvu !< For GWE, set to "energy" in TspAptType
130  character(len=*), intent(in) :: dvua !< For GWE, set to "E" in TspAptType
131  ! -- local
132  type(GweSfeType), pointer :: sfeobj
133  !
134  ! -- Allocate the object and assign values to object variables
135  allocate (sfeobj)
136  packobj => sfeobj
137  !
138  ! -- Create name and memory path
139  call packobj%set_names(ibcnum, namemodel, pakname, ftype, mempath)
140  packobj%text = text
141  !
142  ! -- Allocate scalars
143  call sfeobj%allocate_scalars()
144  !
145  ! -- Initialize package
146  call packobj%pack_initialize()
147  !
148  packobj%inunit = inunit
149  packobj%iout = iout
150  packobj%id = id
151  packobj%ibcnum = ibcnum
152  packobj%ncolbnd = 1
153  packobj%iscloc = 1
154  packobj%isadvpak = 1
155  !
156  ! -- Store pointer to flow model interface. When the GwfGwt exchange is
157  ! created, it sets fmi%bndlist so that the GWT model has access to all
158  ! the flow packages
159  sfeobj%fmi => fmi
160  !
161  ! -- Store pointer to governing equation scale factor
162  sfeobj%eqnsclfac => eqnsclfac
163  !
164  ! -- Store pointer to shared data module for accessing cpw, rhow
165  ! for the budget calculations, and for accessing the latent heat of
166  ! vaporization for evaporative cooling.
167  sfeobj%gwecommon => gwecommon
168  !
169  ! -- Set labels that will be used in generalized APT class
170  sfeobj%depvartype = dvt
171  sfeobj%depvarunit = dvu
172  sfeobj%depvarunitabbrev = dvua
Here is the caller graph for this function:

◆ sfe_da()

subroutine gwesfemodule::sfe_da ( class(gwesfetype)  this)
private

Definition at line 758 of file gwe-sfe.f90.

759  ! -- modules
761  ! -- dummy
762  class(GweSfeType) :: this
763  !
764  ! -- Deallocate scalars
765  call mem_deallocate(this%idxbudrain)
766  call mem_deallocate(this%idxbudevap)
767  call mem_deallocate(this%idxbudroff)
768  call mem_deallocate(this%idxbudiflw)
769  call mem_deallocate(this%idxbudoutf)
770  !
771  ! -- input-context-owned aliases, not package-allocated
772  nullify (this%temprain)
773  nullify (this%tempevap)
774  nullify (this%temproff)
775  nullify (this%tempiflw)
776  !
777  call mem_deallocate(this%vnew)
778  call mem_deallocate(this%vold)
779  !
780  ! -- Deallocate arrays
781  call mem_deallocate(this%ktf)
782  call mem_deallocate(this%rfeatthk)
783  !
784  ! -- Deallocate scalars in TspAptType
785  call this%TspAptType%bnd_da()

◆ sfe_df_obs()

subroutine gwesfemodule::sfe_df_obs ( class(gwesfetype)  this)
private

Store the observation type supported by the APT package and override BndTypebnd_df_obs

Definition at line 960 of file gwe-sfe.f90.

961  ! -- modules
962  ! -- dummy
963  class(GweSfeType) :: this
964  ! -- local
965  integer(I4B) :: indx
966  !
967  ! -- Store obs type and assign procedure pointer
968  ! for temperature observation type.
969  call this%obs%StoreObsType('temperature', .false., indx)
970  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
971  !
972  ! -- Store obs type and assign procedure pointer
973  ! for flow between reaches.
974  call this%obs%StoreObsType('flow-ja-face', .true., indx)
975  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid12
976  !
977  ! -- Store obs type and assign procedure pointer
978  ! for from-mvr observation type.
979  call this%obs%StoreObsType('from-mvr', .true., indx)
980  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
981  !
982  ! -- Store obs type and assign procedure pointer
983  ! for to-mvr observation type.
984  call this%obs%StoreObsType('to-mvr', .true., indx)
985  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
986  !
987  ! -- Store obs type and assign procedure pointer
988  ! for storage observation type.
989  call this%obs%StoreObsType('storage', .true., indx)
990  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
991  !
992  ! -- Store obs type and assign procedure pointer
993  ! for constant observation type.
994  call this%obs%StoreObsType('constant', .true., indx)
995  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
996  !
997  ! -- Store obs type and assign procedure pointer
998  ! for observation type: sfe
999  call this%obs%StoreObsType('sfe', .true., indx)
1000  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
1001  !
1002  ! -- Store obs type and assign procedure pointer
1003  ! for rainfall observation type.
1004  call this%obs%StoreObsType('rainfall', .true., indx)
1005  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
1006  !
1007  ! -- Store obs type and assign procedure pointer
1008  ! for evaporation observation type.
1009  call this%obs%StoreObsType('evaporation', .true., indx)
1010  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
1011  !
1012  ! -- Store obs type and assign procedure pointer
1013  ! for runoff observation type.
1014  call this%obs%StoreObsType('runoff', .true., indx)
1015  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
1016  !
1017  ! -- Store obs type and assign procedure pointer
1018  ! for inflow observation type.
1019  call this%obs%StoreObsType('ext-inflow', .true., indx)
1020  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
1021  !
1022  ! -- Store obs type and assign procedure pointer
1023  ! for ext-outflow observation type.
1024  call this%obs%StoreObsType('ext-outflow', .true., indx)
1025  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
1026  !
1027  ! -- Store obs type and assign procedure pointer
1028  ! for strmbd-cond observation type.
1029  call this%obs%StoreObsType('strmbd-cond', .true., indx)
1030  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
Here is the call graph for this function:

◆ sfe_evap_term()

subroutine gwesfemodule::sfe_evap_term ( class(gwesfetype)  this,
integer(i4b), intent(in)  ientry,
integer(i4b), intent(inout)  n1,
integer(i4b), intent(inout)  n2,
real(dp), intent(inout), optional  rrate,
real(dp), intent(inout), optional  rhsval,
real(dp), intent(inout), optional  hcofval 
)
private

Definition at line 814 of file gwe-sfe.f90.

815  ! -- dummy
816  class(GweSfeType) :: this
817  integer(I4B), intent(in) :: ientry
818  integer(I4B), intent(inout) :: n1
819  integer(I4B), intent(inout) :: n2
820  real(DP), intent(inout), optional :: rrate
821  real(DP), intent(inout), optional :: rhsval
822  real(DP), intent(inout), optional :: hcofval
823  ! -- local
824  real(DP) :: qbnd
825  real(DP) :: heatlat
826  !
827  n1 = this%flowbudptr%budterm(this%idxbudevap)%id1(ientry)
828  n2 = this%flowbudptr%budterm(this%idxbudevap)%id2(ientry)
829  ! -- note that qbnd is negative for evap
830  qbnd = this%flowbudptr%budterm(this%idxbudevap)%flow(ientry)
831  heatlat = this%gwecommon%gwerhow * this%gwecommon%gwelatheatvap
832  if (present(rrate)) rrate = qbnd * heatlat
833  if (present(rhsval)) rhsval = -rrate
834  if (present(hcofval)) hcofval = dzero

◆ sfe_fc_expanded()

subroutine gwesfemodule::sfe_fc_expanded ( class(gwesfetype)  this,
real(dp), dimension(:), intent(inout)  rhs,
integer(i4b), dimension(:), intent(in)  ia,
integer(i4b), dimension(:), intent(in)  idxglo,
class(matrixbasetype), pointer  matrix_sln 
)
private

This will be called from TspAptTypeapt_fc_expanded() in order to add matrix terms specifically for SFE

Definition at line 321 of file gwe-sfe.f90.

322  ! -- dummy
323  class(GweSfeType) :: this
324  real(DP), dimension(:), intent(inout) :: rhs
325  integer(I4B), dimension(:), intent(in) :: ia
326  integer(I4B), dimension(:), intent(in) :: idxglo
327  class(MatrixBaseType), pointer :: matrix_sln
328  ! -- local
329  integer(I4B) :: j, n1, n2
330  integer(I4B) :: iloc
331  integer(I4B) :: iposd, iposoffd
332  integer(I4B) :: ipossymd, ipossymoffd
333  real(DP) :: rrate
334  real(DP) :: rhsval
335  real(DP) :: hcofval
336  !
337  ! -- Add rainfall contribution
338  if (this%idxbudrain /= 0) then
339  do j = 1, this%flowbudptr%budterm(this%idxbudrain)%nlist
340  call this%sfe_rain_term(j, n1, n2, rrate, rhsval, hcofval)
341  iloc = this%idxlocnode(n1)
342  iposd = this%idxpakdiag(n1)
343  call matrix_sln%add_value_pos(iposd, hcofval)
344  rhs(iloc) = rhs(iloc) + rhsval
345  end do
346  end if
347  !
348  ! -- Add evaporation contribution
349  if (this%idxbudevap /= 0) then
350  do j = 1, this%flowbudptr%budterm(this%idxbudevap)%nlist
351  call this%sfe_evap_term(j, n1, n2, rrate, rhsval, hcofval)
352  iloc = this%idxlocnode(n1)
353  iposd = this%idxpakdiag(n1)
354  call matrix_sln%add_value_pos(iposd, hcofval)
355  rhs(iloc) = rhs(iloc) + rhsval
356  end do
357  end if
358  !
359  ! -- Add runoff contribution
360  if (this%idxbudroff /= 0) then
361  do j = 1, this%flowbudptr%budterm(this%idxbudroff)%nlist
362  call this%sfe_roff_term(j, n1, n2, rrate, rhsval, hcofval)
363  iloc = this%idxlocnode(n1)
364  iposd = this%idxpakdiag(n1)
365  call matrix_sln%add_value_pos(iposd, hcofval)
366  rhs(iloc) = rhs(iloc) + rhsval
367  end do
368  end if
369  !
370  ! -- Add inflow contribution
371  if (this%idxbudiflw /= 0) then
372  do j = 1, this%flowbudptr%budterm(this%idxbudiflw)%nlist
373  call this%sfe_iflw_term(j, n1, n2, rrate, rhsval, hcofval)
374  iloc = this%idxlocnode(n1)
375  iposd = this%idxpakdiag(n1)
376  call matrix_sln%add_value_pos(iposd, hcofval)
377  rhs(iloc) = rhs(iloc) + rhsval
378  end do
379  end if
380  !
381  ! -- Add outflow contribution
382  if (this%idxbudoutf /= 0) then
383  do j = 1, this%flowbudptr%budterm(this%idxbudoutf)%nlist
384  call this%sfe_outf_term(j, n1, n2, rrate, rhsval, hcofval)
385  iloc = this%idxlocnode(n1)
386  iposd = this%idxpakdiag(n1)
387  call matrix_sln%add_value_pos(iposd, hcofval)
388  rhs(iloc) = rhs(iloc) + rhsval
389  end do
390  end if
391  !
392  ! -- Add streambed conduction contribution
393  do j = 1, this%flowbudptr%budterm(this%idxbudgwf)%nlist
394  !
395  ! -- Set n to feature number and process if active feature
396  n1 = this%flowbudptr%budterm(this%idxbudgwf)%id1(j)
397  if (this%iboundpak(n1) /= 0) then
398  !
399  call this%sfe_sbcd_term(j, n1, n2, rrate, rhsval, hcofval)
400  !
401  ! -- Add to sfe row
402  iposd = this%idxdglo(j)
403  iposoffd = this%idxoffdglo(j)
404  call matrix_sln%add_value_pos(iposd, -hcofval)
405  call matrix_sln%add_value_pos(iposoffd, hcofval)
406  !
407  ! -- Add to gwe row for sfe connection
408  ipossymd = this%idxsymdglo(j)
409  ipossymoffd = this%idxsymoffdglo(j)
410  call matrix_sln%add_value_pos(ipossymd, -hcofval)
411  call matrix_sln%add_value_pos(ipossymoffd, hcofval)
412  end if
413  end do

◆ sfe_fill_budobj()

subroutine gwesfemodule::sfe_fill_budobj ( class(gwesfetype)  this,
integer(i4b), intent(inout)  idx,
real(dp), dimension(:), intent(in)  x,
real(dp), dimension(:), intent(inout), contiguous  flowja,
real(dp), intent(inout)  ccratin,
real(dp), intent(inout)  ccratout 
)

Definition at line 591 of file gwe-sfe.f90.

592  ! -- dummy
593  class(GweSfeType) :: this
594  integer(I4B), intent(inout) :: idx
595  real(DP), dimension(:), intent(in) :: x
596  real(DP), dimension(:), contiguous, intent(inout) :: flowja
597  real(DP), intent(inout) :: ccratin
598  real(DP), intent(inout) :: ccratout
599  ! -- local
600  integer(I4B) :: j, n1, n2
601  integer(I4B) :: igwfnode
602  integer(I4B) :: nlist
603  integer(I4B) :: idiag
604  real(DP) :: q
605  !
606  ! -- Rain
607  idx = idx + 1
608  nlist = this%flowbudptr%budterm(this%idxbudrain)%nlist
609  call this%budobj%budterm(idx)%reset(nlist)
610  do j = 1, nlist
611  call this%sfe_rain_term(j, n1, n2, q)
612  call this%budobj%budterm(idx)%update_term(n1, n2, q)
613  call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
614  end do
615  !
616  ! -- Evaporation
617  idx = idx + 1
618  nlist = this%flowbudptr%budterm(this%idxbudevap)%nlist
619  call this%budobj%budterm(idx)%reset(nlist)
620  do j = 1, nlist
621  call this%sfe_evap_term(j, n1, n2, q)
622  call this%budobj%budterm(idx)%update_term(n1, n2, q)
623  call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
624  end do
625  !
626  ! -- Runoff
627  idx = idx + 1
628  nlist = this%flowbudptr%budterm(this%idxbudroff)%nlist
629  call this%budobj%budterm(idx)%reset(nlist)
630  do j = 1, nlist
631  call this%sfe_roff_term(j, n1, n2, q)
632  call this%budobj%budterm(idx)%update_term(n1, n2, q)
633  call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
634  end do
635  !
636  ! -- Ext-inflow
637  idx = idx + 1
638  nlist = this%flowbudptr%budterm(this%idxbudiflw)%nlist
639  call this%budobj%budterm(idx)%reset(nlist)
640  do j = 1, nlist
641  call this%sfe_iflw_term(j, n1, n2, q)
642  call this%budobj%budterm(idx)%update_term(n1, n2, q)
643  call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
644  end do
645  !
646  ! -- Ext-outflow
647  idx = idx + 1
648  nlist = this%flowbudptr%budterm(this%idxbudoutf)%nlist
649  call this%budobj%budterm(idx)%reset(nlist)
650  do j = 1, nlist
651  call this%sfe_outf_term(j, n1, n2, q)
652  call this%budobj%budterm(idx)%update_term(n1, n2, q)
653  call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
654  end do
655  !
656  ! -- Strmbd-cond. The idxbudgwf index is used since it contains the
657  ! sfe/cell mapping information
658  idx = idx + 1
659  nlist = this%flowbudptr%budterm(this%idxbudgwf)%nlist
660  call this%budobj%budterm(idx)%reset(nlist)
661  do j = 1, nlist
662  n1 = this%flowbudptr%budterm(this%idxbudgwf)%id1(j)
663  if (this%iboundpak(n1) /= 0) then
664  ! -- use igwfnode instead of n2 for consistency with usage in apt;
665  ! helps highlight that cell number is sought and used
666  call this%sfe_sbcd_term(j, n1, igwfnode, q)
667  call this%budobj%budterm(idx)%update_term(n1, igwfnode, q)
668  call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
669  ! -- Contribution to gwe cell budget, which is different than the
670  ! other terms (i.e., ext-inflow, evap, etc.)
671  this%simvals(n1) = this%simvals(n1) - q
672  idiag = this%dis%con%ia(igwfnode)
673  flowja(idiag) = flowja(idiag) - q
674  end if
675  end do

◆ sfe_get_nbudterms()

integer(i4b) function gwesfemodule::sfe_get_nbudterms ( class(gwesfetype)  this)
private

This overrides a function in the parent class.

Definition at line 473 of file gwe-sfe.f90.

474  ! -- dummy
475  class(GweSfeType) :: this
476  ! -- return
477  integer(I4B) :: nbudterms
478  !
479  ! -- Number of budget terms is 6:
480  ! 1. rainfall
481  ! 2. evaporation
482  ! 3. runoff
483  ! 4. ext-inflow
484  ! 5. ext-outflow
485  ! 6. strmbd-cond
486  nbudterms = 6

◆ sfe_get_volumes()

subroutine gwesfemodule::sfe_get_volumes ( class(gwesfetype)  this,
integer(i4b), intent(in)  icv,
real(dp), intent(inout)  vnew,
real(dp), intent(inout)  vold,
real(dp), intent(in)  delt 
)

Definition at line 1143 of file gwe-sfe.f90.

1144  ! -- dummy
1145  class(GweSfeType) :: this
1146  integer(I4B), intent(in) :: icv
1147  real(DP), intent(inout) :: vnew, vold
1148  real(DP), intent(in) :: delt
1149  ! -- local
1150  real(DP) :: qss
1151  !
1152  ! -- get volumes
1153  vold = dzero
1154  vnew = vold
1155  if (this%idxbudsto /= 0) then
1156  qss = this%flowbudptr%budterm(this%idxbudsto)%flow(icv)
1157  vnew = this%flowbudptr%budterm(this%idxbudsto)%auxvar(1, icv)
1158  this%vnew(icv) = vnew
1159  if (qss /= dzero) then
1160  vold = vnew + qss * delt
1161  else
1162  if (vnew == dzero) then
1163  vold = dzero
1164  else
1165  vold = this%vold(icv)
1166  end if
1167  end if
1168  end if

◆ sfe_iflw_term()

subroutine gwesfemodule::sfe_iflw_term ( class(gwesfetype)  this,
integer(i4b), intent(in)  ientry,
integer(i4b), intent(inout)  n1,
integer(i4b), intent(inout)  n2,
real(dp), intent(inout), optional  rrate,
real(dp), intent(inout), optional  rhsval,
real(dp), intent(inout), optional  hcofval 
)
private

Accounts for energy added via streamflow entering into a stream channel; for example, energy entering the model domain via a specified flow in a stream channel.

Definition at line 867 of file gwe-sfe.f90.

868  ! -- dummy
869  class(GweSfeType) :: this
870  integer(I4B), intent(in) :: ientry
871  integer(I4B), intent(inout) :: n1
872  integer(I4B), intent(inout) :: n2
873  real(DP), intent(inout), optional :: rrate
874  real(DP), intent(inout), optional :: rhsval
875  real(DP), intent(inout), optional :: hcofval
876  ! -- local
877  real(DP) :: qbnd
878  real(DP) :: ctmp
879  !
880  n1 = this%flowbudptr%budterm(this%idxbudiflw)%id1(ientry)
881  n2 = this%flowbudptr%budterm(this%idxbudiflw)%id2(ientry)
882  qbnd = this%flowbudptr%budterm(this%idxbudiflw)%flow(ientry)
883  ctmp = this%tempiflw(n1)
884  if (present(rrate)) rrate = ctmp * qbnd * this%eqnsclfac
885  if (present(rhsval)) rhsval = -rrate
886  if (present(hcofval)) hcofval = dzero

◆ sfe_outf_term()

subroutine gwesfemodule::sfe_outf_term ( class(gwesfetype)  this,
integer(i4b), intent(in)  ientry,
integer(i4b), intent(inout)  n1,
integer(i4b), intent(inout)  n2,
real(dp), intent(inout), optional  rrate,
real(dp), intent(inout), optional  rhsval,
real(dp), intent(inout), optional  hcofval 
)
private

Accounts for the energy leaving a stream channel, for example, energy exiting the model domain via a flow in a stream channel flowing out of the active domain.

Definition at line 894 of file gwe-sfe.f90.

895  ! -- dummy
896  class(GweSfeType) :: this
897  integer(I4B), intent(in) :: ientry
898  integer(I4B), intent(inout) :: n1
899  integer(I4B), intent(inout) :: n2
900  real(DP), intent(inout), optional :: rrate
901  real(DP), intent(inout), optional :: rhsval
902  real(DP), intent(inout), optional :: hcofval
903  ! -- local
904  real(DP) :: qbnd
905  real(DP) :: ctmp
906  !
907  n1 = this%flowbudptr%budterm(this%idxbudoutf)%id1(ientry)
908  n2 = this%flowbudptr%budterm(this%idxbudoutf)%id2(ientry)
909  qbnd = this%flowbudptr%budterm(this%idxbudoutf)%flow(ientry)
910  ctmp = this%xnewpak(n1)
911  if (present(rrate)) rrate = ctmp * qbnd * this%eqnsclfac
912  if (present(rhsval)) rhsval = dzero
913  if (present(hcofval)) hcofval = qbnd * this%eqnsclfac

◆ sfe_rain_term()

subroutine gwesfemodule::sfe_rain_term ( class(gwesfetype)  this,
integer(i4b), intent(in)  ientry,
integer(i4b), intent(inout)  n1,
integer(i4b), intent(inout)  n2,
real(dp), intent(inout), optional  rrate,
real(dp), intent(inout), optional  rhsval,
real(dp), intent(inout), optional  hcofval 
)

Definition at line 790 of file gwe-sfe.f90.

791  ! -- dummy
792  class(GweSfeType) :: this
793  integer(I4B), intent(in) :: ientry
794  integer(I4B), intent(inout) :: n1
795  integer(I4B), intent(inout) :: n2
796  real(DP), intent(inout), optional :: rrate
797  real(DP), intent(inout), optional :: rhsval
798  real(DP), intent(inout), optional :: hcofval
799  ! -- local
800  real(DP) :: qbnd
801  real(DP) :: ctmp
802  !
803  n1 = this%flowbudptr%budterm(this%idxbudrain)%id1(ientry)
804  n2 = this%flowbudptr%budterm(this%idxbudrain)%id2(ientry)
805  qbnd = this%flowbudptr%budterm(this%idxbudrain)%flow(ientry)
806  ctmp = this%temprain(n1)
807  if (present(rrate)) rrate = ctmp * qbnd * this%eqnsclfac
808  if (present(rhsval)) rhsval = -rrate
809  if (present(hcofval)) hcofval = dzero

◆ sfe_read_cvs()

subroutine gwesfemodule::sfe_read_cvs ( class(gwesfetype), intent(inout)  this)
private

Definition at line 1110 of file gwe-sfe.f90.

1113  class(GweSfeType), intent(inout) :: this
1114  integer(I4B) :: n, ifeat
1115  real(DP), dimension(:), pointer, contiguous :: ktf_ptr => null()
1116  real(DP), dimension(:), pointer, contiguous :: rbthcnd_ptr => null()
1117  call this%TspAptType%apt_source_cvs()
1118  call mem_allocate(this%ktf, this%ncv, 'KTF', this%memoryPath)
1119  call mem_allocate(this%rfeatthk, this%ncv, 'RFEATTHK', this%memoryPath)
1120  call mem_setptr(ktf_ptr, 'KTF', this%input_mempath)
1121  call mem_setptr(rbthcnd_ptr, 'RBTHCND', this%input_mempath)
1122  do n = 1, size(this%pkg_ifno)
1123  ifeat = this%pkg_ifno(n)
1124  if (ifeat < 1 .or. ifeat > this%ncv) cycle
1125  this%ktf(ifeat) = ktf_ptr(n)
1126  this%rfeatthk(ifeat) = rbthcnd_ptr(n)
1127  if (this%rfeatthk(ifeat) <= dzero) then
1128  write (errmsg, '(4x,a)') &
1129  '****ERROR. Specified thickness used for thermal '// &
1130  'conduction MUST BE > 0 else divide by zero error occurs'
1131  call store_error(errmsg)
1132  end if
1133  end do
1134  if (count_errors() > 0) then
1135  call store_error_filename(this%input_fname)
1136  end if
1137  call memorystore_release('KTF', this%input_mempath)
1138  call memorystore_release('RBTHCND', this%input_mempath)
subroutine, public memorystore_release(varname, memory_path)
Release a single variable from the memory store.
Here is the call graph for this function:

◆ sfe_roff_term()

subroutine gwesfemodule::sfe_roff_term ( class(gwesfetype)  this,
integer(i4b), intent(in)  ientry,
integer(i4b), intent(inout)  n1,
integer(i4b), intent(inout)  n2,
real(dp), intent(inout), optional  rrate,
real(dp), intent(inout), optional  rhsval,
real(dp), intent(inout), optional  hcofval 
)
private

Definition at line 839 of file gwe-sfe.f90.

840  ! -- dummy
841  class(GweSfeType) :: this
842  integer(I4B), intent(in) :: ientry
843  integer(I4B), intent(inout) :: n1
844  integer(I4B), intent(inout) :: n2
845  real(DP), intent(inout), optional :: rrate
846  real(DP), intent(inout), optional :: rhsval
847  real(DP), intent(inout), optional :: hcofval
848  ! -- local
849  real(DP) :: qbnd
850  real(DP) :: ctmp
851  !
852  n1 = this%flowbudptr%budterm(this%idxbudroff)%id1(ientry)
853  n2 = this%flowbudptr%budterm(this%idxbudroff)%id2(ientry)
854  qbnd = this%flowbudptr%budterm(this%idxbudroff)%flow(ientry)
855  ctmp = this%temproff(n1)
856  if (present(rrate)) rrate = ctmp * qbnd * this%eqnsclfac
857  if (present(rhsval)) rhsval = -rrate
858  if (present(hcofval)) hcofval = dzero

◆ sfe_rp_obs()

subroutine gwesfemodule::sfe_rp_obs ( class(gwesfetype), intent(inout)  this,
type(observetype), intent(inout)  obsrv,
logical, intent(inout)  found 
)
private

Method to process specific observations for this package.

Parameters
[in,out]thispackage class
[in,out]obsrvobservation object
[in,out]foundindicate whether observation was found

Definition at line 1037 of file gwe-sfe.f90.

1038  ! -- dummy
1039  class(GweSfeType), intent(inout) :: this !< package class
1040  type(ObserveType), intent(inout) :: obsrv !< observation object
1041  logical, intent(inout) :: found !< indicate whether observation was found
1042  ! -- local
1043  !
1044  found = .true.
1045  select case (obsrv%ObsTypeId)
1046  case ('RAINFALL')
1047  call this%rp_obs_byfeature(obsrv)
1048  case ('EVAPORATION')
1049  call this%rp_obs_byfeature(obsrv)
1050  case ('RUNOFF')
1051  call this%rp_obs_byfeature(obsrv)
1052  case ('EXT-INFLOW')
1053  call this%rp_obs_byfeature(obsrv)
1054  case ('EXT-OUTFLOW')
1055  call this%rp_obs_byfeature(obsrv)
1056  case ('TO-MVR')
1057  call this%rp_obs_byfeature(obsrv)
1058  case ('STRMBD-COND')
1059  call this%rp_obs_byfeature(obsrv)
1060  case default
1061  found = .false.
1062  end select

◆ sfe_sbcd_term()

subroutine gwesfemodule::sfe_sbcd_term ( class(gwesfetype)  this,
integer(i4b), intent(in)  ientry,
integer(i4b), intent(inout)  n1,
integer(i4b), intent(inout)  igwfnode,
real(dp), intent(inout), optional  rrate,
real(dp), intent(inout), optional  rhsval,
real(dp), intent(inout), optional  hcofval 
)
private

Accounts for the energy entering or leaving a stream channel by thermal conduction through the streambed.

Definition at line 921 of file gwe-sfe.f90.

922  ! -- dummy
923  class(GweSfeType) :: this
924  integer(I4B), intent(in) :: ientry
925  integer(I4B), intent(inout) :: n1
926  integer(I4B), intent(inout) :: igwfnode
927  real(DP), intent(inout), optional :: rrate
928  real(DP), intent(inout), optional :: rhsval
929  real(DP), intent(inout), optional :: hcofval
930  ! -- local
931  integer(I4B) :: auxpos
932  real(DP) :: wa !< wetted area
933  real(DP) :: ktf !< thermal conductivity of streambed material
934  real(DP) :: s !< thickness of conductive streambed material
935  real(DP) :: ctherm
936  !
937  rrate = dzero
938  n1 = this%flowbudptr%budterm(this%idxbudgwf)%id1(ientry)
939  ! -- use igwfnode instead of n2 for consistency with usage in apt;
940  ! helps highlight that cell number is sought and used
941  igwfnode = this%flowbudptr%budterm(this%idxbudgwf)%id2(ientry)
942  ! -- For now, there is only 1 aux variable under 'GWF'
943  auxpos = this%flowbudptr%budterm(this%idxbudgwf)%naux
944  wa = this%flowbudptr%budterm(this%idxbudgwf)%auxvar(auxpos, ientry)
945  ktf = this%ktf(n1)
946  s = this%rfeatthk(n1)
947  ctherm = ktf * wa / s
948  ! -- this%xnew available b/c set in parent class (TspAptType) using
949  ! routine set_pointers from the "grandparent" class BndType
950  if (present(rrate)) rrate = ctherm * (this%xnew(igwfnode) - this%xnewpak(n1))
951  if (present(rhsval)) rhsval = dzero
952  if (present(hcofval)) hcofval = ctherm

◆ sfe_setting_value()

real(dp) function gwesfemodule::sfe_setting_value ( class(gwesfetype), intent(inout)  this,
integer(i4b), intent(in)  itemno,
character(len=*), intent(in)  key 
)

Already resolved by the input context; this only supplies it for the shared apt_rp table echo.

Definition at line 296 of file gwe-sfe.f90.

297  ! -- dummy
298  class(GweSfeType), intent(inout) :: this
299  integer(I4B), intent(in) :: itemno
300  character(len=*), intent(in) :: key
301  real(DP) :: val
302  !
303  val = dzero
304  select case (trim(key))
305  case ('RAINFALL')
306  val = this%temprain(itemno)
307  case ('EVAPORATION')
308  val = this%tempevap(itemno)
309  case ('RUNOFF')
310  val = this%temproff(itemno)
311  case ('INFLOW')
312  val = this%tempiflw(itemno)
313  end select

◆ sfe_setup_budobj()

subroutine gwesfemodule::sfe_setup_budobj ( class(gwesfetype)  this,
integer(i4b), intent(inout)  idx 
)
private

Definition at line 491 of file gwe-sfe.f90.

492  ! -- modules
493  use constantsmodule, only: lenbudtxt
494  ! -- dummy
495  class(GweSfeType) :: this
496  integer(I4B), intent(inout) :: idx
497  ! -- local
498  integer(I4B) :: n, n1, n2
499  integer(I4B) :: maxlist, naux
500  real(DP) :: q
501  character(len=LENBUDTXT) :: text
502  !
503  ! --
504  text = ' RAINFALL'
505  idx = idx + 1
506  maxlist = this%flowbudptr%budterm(this%idxbudrain)%maxlist
507  naux = 0
508  call this%budobj%budterm(idx)%initialize(text, &
509  this%name_model, &
510  this%packName, &
511  this%name_model, &
512  this%packName, &
513  maxlist, .false., .false., &
514  naux)
515  !
516  ! --
517  text = ' EVAPORATION'
518  idx = idx + 1
519  maxlist = this%flowbudptr%budterm(this%idxbudevap)%maxlist
520  naux = 0
521  call this%budobj%budterm(idx)%initialize(text, &
522  this%name_model, &
523  this%packName, &
524  this%name_model, &
525  this%packName, &
526  maxlist, .false., .false., &
527  naux)
528  !
529  ! --
530  text = ' RUNOFF'
531  idx = idx + 1
532  maxlist = this%flowbudptr%budterm(this%idxbudroff)%maxlist
533  naux = 0
534  call this%budobj%budterm(idx)%initialize(text, &
535  this%name_model, &
536  this%packName, &
537  this%name_model, &
538  this%packName, &
539  maxlist, .false., .false., &
540  naux)
541  !
542  ! --
543  text = ' EXT-INFLOW'
544  idx = idx + 1
545  maxlist = this%flowbudptr%budterm(this%idxbudiflw)%maxlist
546  naux = 0
547  call this%budobj%budterm(idx)%initialize(text, &
548  this%name_model, &
549  this%packName, &
550  this%name_model, &
551  this%packName, &
552  maxlist, .false., .false., &
553  naux)
554  !
555  ! --
556  text = ' EXT-OUTFLOW'
557  idx = idx + 1
558  maxlist = this%flowbudptr%budterm(this%idxbudoutf)%maxlist
559  naux = 0
560  call this%budobj%budterm(idx)%initialize(text, &
561  this%name_model, &
562  this%packName, &
563  this%name_model, &
564  this%packName, &
565  maxlist, .false., .false., &
566  naux)
567  !
568  ! -- Conduction through the wetted streambed
569  text = ' STRMBD-COND'
570  idx = idx + 1
571  maxlist = this%flowbudptr%budterm(this%idxbudgwf)%maxlist
572  naux = 0
573  call this%budobj%budterm(idx)%initialize(text, &
574  this%name_model, &
575  this%packName, &
576  this%name_model, &
577  this%packName, &
578  maxlist, .false., .false., &
579  naux)
580  call this%budobj%budterm(idx)%reset(maxlist)
581  q = dzero
582  do n = 1, maxlist
583  n1 = this%flowbudptr%budterm(this%idxbudgwf)%id1(n)
584  n2 = this%flowbudptr%budterm(this%idxbudgwf)%id2(n)
585  call this%budobj%budterm(idx)%update_term(n1, n2, q)
586  end do
This module contains simulation constants.
Definition: Constants.f90:9
integer(i4b), parameter lenbudtxt
maximum length of a budget component names
Definition: Constants.f90:37

◆ sfe_solve()

subroutine gwesfemodule::sfe_solve ( class(gwesfetype)  this)
private

Definition at line 418 of file gwe-sfe.f90.

419  ! -- dummy
420  class(GweSfeType) :: this
421  ! -- local
422  integer(I4B) :: j
423  integer(I4B) :: n1, n2
424  real(DP) :: rrate
425  !
426  ! -- Add rainfall contribution
427  if (this%idxbudrain /= 0) then
428  do j = 1, this%flowbudptr%budterm(this%idxbudrain)%nlist
429  call this%sfe_rain_term(j, n1, n2, rrate)
430  this%dbuff(n1) = this%dbuff(n1) + rrate
431  end do
432  end if
433  !
434  ! -- Add evaporation contribution
435  if (this%idxbudevap /= 0) then
436  do j = 1, this%flowbudptr%budterm(this%idxbudevap)%nlist
437  call this%sfe_evap_term(j, n1, n2, rrate)
438  this%dbuff(n1) = this%dbuff(n1) + rrate
439  end do
440  end if
441  !
442  ! -- Add runoff contribution
443  if (this%idxbudroff /= 0) then
444  do j = 1, this%flowbudptr%budterm(this%idxbudroff)%nlist
445  call this%sfe_roff_term(j, n1, n2, rrate)
446  this%dbuff(n1) = this%dbuff(n1) + rrate
447  end do
448  end if
449  !
450  ! -- Add inflow contribution
451  if (this%idxbudiflw /= 0) then
452  do j = 1, this%flowbudptr%budterm(this%idxbudiflw)%nlist
453  call this%sfe_iflw_term(j, n1, n2, rrate)
454  this%dbuff(n1) = this%dbuff(n1) + rrate
455  end do
456  end if
457  !
458  ! -- Add outflow contribution
459  if (this%idxbudoutf /= 0) then
460  do j = 1, this%flowbudptr%budterm(this%idxbudoutf)%nlist
461  call this%sfe_outf_term(j, n1, n2, rrate)
462  this%dbuff(n1) = this%dbuff(n1) + rrate
463  end do
464  end if
465  !
466  ! Note: explicit streambed conduction terms???

Variable Documentation

◆ flowtype

character(len=*), parameter gwesfemodule::flowtype = 'SFR'
private

Definition at line 61 of file gwe-sfe.f90.

61  character(len=*), parameter :: flowtype = 'SFR'

◆ ftype

character(len=*), parameter gwesfemodule::ftype = 'SFE'
private

Definition at line 60 of file gwe-sfe.f90.

60  character(len=*), parameter :: ftype = 'SFE'

◆ text

character(len=16) gwesfemodule::text = ' SFE'
private

Definition at line 62 of file gwe-sfe.f90.

62  character(len=16) :: text = ' SFE'