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_checkin_deprecated_names (this)
 Alias deprecated SFE variable names to their current storage. 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 682 of file gwe-sfe.f90.

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

◆ find_sfe_package()

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

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

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

762  ! -- dummy
763  class(GweSfeType) :: this
764  ! -- local
765  integer(I4B) :: n
766  !
767  ! -- call base bnd_ad and run the per-timestep resync directly
768  ! (see apt_ad_resync)
769  call this%BndExtType%bnd_ad()
770  call this%apt_ad_resync()
771  !
772  ! -- update vold
773  do n = 1, this%ncv
774  this%vold(n) = this%vnew(n)
775  end do
776 

◆ sfe_allocate_arrays()

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

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

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

1091  ! -- dummy
1092  class(GweSfeType), intent(inout) :: this
1093  character(len=*), intent(in) :: obstypeid
1094  real(DP), intent(inout) :: v
1095  integer(I4B), intent(in) :: jj
1096  logical, intent(inout) :: found
1097  ! -- local
1098  integer(I4B) :: n1, n2
1099  !
1100  found = .true.
1101  select case (obstypeid)
1102  case ('RAINFALL')
1103  if (this%iboundpak(jj) /= 0) then
1104  call this%sfe_rain_term(jj, n1, n2, v)
1105  end if
1106  case ('EVAPORATION')
1107  if (this%iboundpak(jj) /= 0) then
1108  call this%sfe_evap_term(jj, n1, n2, v)
1109  end if
1110  case ('RUNOFF')
1111  if (this%iboundpak(jj) /= 0) then
1112  call this%sfe_roff_term(jj, n1, n2, v)
1113  end if
1114  case ('EXT-INFLOW')
1115  if (this%iboundpak(jj) /= 0) then
1116  call this%sfe_iflw_term(jj, n1, n2, v)
1117  end if
1118  case ('EXT-OUTFLOW')
1119  if (this%iboundpak(jj) /= 0) then
1120  call this%sfe_outf_term(jj, n1, n2, v)
1121  end if
1122  case ('STRMBD-COND')
1123  if (this%iboundpak(jj) /= 0) then
1124  call this%sfe_sbcd_term(jj, n1, n2, v)
1125  end if
1126  case default
1127  found = .false.
1128  end select

◆ sfe_checkin_deprecated_names()

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

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

740  ! -- modules
742  ! -- dummy
743  class(GweSfeType), intent(inout) :: this
744  ! -- code
745  !
746  ! -- names common to all advanced transport packages
747  call this%TspAptType%apt_checkin_deprecated_names()
748  !
749  call mem_alias_deprecated(this%temprain, 'TEMPRAIN', this%memoryPath, &
750  'RAINFALL', this%input_mempath, '6.8.2')
751  call mem_alias_deprecated(this%tempevap, 'TEMPEVAP', this%memoryPath, &
752  'EVAPORATION', this%input_mempath, '6.8.2')
753  call mem_alias_deprecated(this%temproff, 'TEMPROFF', this%memoryPath, &
754  'RUNOFF', this%input_mempath, '6.8.2')
755  call mem_alias_deprecated(this%tempiflw, 'TEMPIFLW', this%memoryPath, &
756  'INFLOW', this%input_mempath, '6.8.2')
Previous variable names checked in as deprecated aliases.
Definition: MemoryAlias.f90:7

◆ 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 115 of file gwe-sfe.f90.

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

◆ sfe_da()

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

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

782  ! -- modules
784  ! -- dummy
785  class(GweSfeType) :: this
786  !
787  ! -- Deallocate scalars
788  call mem_deallocate(this%idxbudrain)
789  call mem_deallocate(this%idxbudevap)
790  call mem_deallocate(this%idxbudroff)
791  call mem_deallocate(this%idxbudiflw)
792  call mem_deallocate(this%idxbudoutf)
793  !
794  ! -- input-context-owned aliases, not package-allocated
795  nullify (this%temprain)
796  nullify (this%tempevap)
797  nullify (this%temproff)
798  nullify (this%tempiflw)
799  !
800  call mem_deallocate(this%vnew)
801  call mem_deallocate(this%vold)
802  !
803  ! -- Deallocate arrays
804  call mem_deallocate(this%ktf)
805  call mem_deallocate(this%rfeatthk)
806  !
807  ! -- Deallocate scalars in TspAptType
808  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 983 of file gwe-sfe.f90.

984  ! -- modules
985  ! -- dummy
986  class(GweSfeType) :: this
987  ! -- local
988  integer(I4B) :: indx
989  !
990  ! -- Store obs type and assign procedure pointer
991  ! for temperature observation type.
992  call this%obs%StoreObsType('temperature', .false., indx)
993  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
994  !
995  ! -- Store obs type and assign procedure pointer
996  ! for flow between reaches.
997  call this%obs%StoreObsType('flow-ja-face', .true., indx)
998  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid12
999  !
1000  ! -- Store obs type and assign procedure pointer
1001  ! for from-mvr observation type.
1002  call this%obs%StoreObsType('from-mvr', .true., indx)
1003  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
1004  !
1005  ! -- Store obs type and assign procedure pointer
1006  ! for to-mvr observation type.
1007  call this%obs%StoreObsType('to-mvr', .true., indx)
1008  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
1009  !
1010  ! -- Store obs type and assign procedure pointer
1011  ! for storage observation type.
1012  call this%obs%StoreObsType('storage', .true., indx)
1013  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
1014  !
1015  ! -- Store obs type and assign procedure pointer
1016  ! for constant observation type.
1017  call this%obs%StoreObsType('constant', .true., indx)
1018  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
1019  !
1020  ! -- Store obs type and assign procedure pointer
1021  ! for observation type: sfe
1022  call this%obs%StoreObsType('sfe', .true., indx)
1023  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
1024  !
1025  ! -- Store obs type and assign procedure pointer
1026  ! for rainfall observation type.
1027  call this%obs%StoreObsType('rainfall', .true., indx)
1028  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
1029  !
1030  ! -- Store obs type and assign procedure pointer
1031  ! for evaporation observation type.
1032  call this%obs%StoreObsType('evaporation', .true., indx)
1033  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
1034  !
1035  ! -- Store obs type and assign procedure pointer
1036  ! for runoff observation type.
1037  call this%obs%StoreObsType('runoff', .true., indx)
1038  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
1039  !
1040  ! -- Store obs type and assign procedure pointer
1041  ! for inflow observation type.
1042  call this%obs%StoreObsType('ext-inflow', .true., indx)
1043  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
1044  !
1045  ! -- Store obs type and assign procedure pointer
1046  ! for ext-outflow observation type.
1047  call this%obs%StoreObsType('ext-outflow', .true., indx)
1048  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
1049  !
1050  ! -- Store obs type and assign procedure pointer
1051  ! for strmbd-cond observation type.
1052  call this%obs%StoreObsType('strmbd-cond', .true., indx)
1053  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 837 of file gwe-sfe.f90.

838  ! -- dummy
839  class(GweSfeType) :: this
840  integer(I4B), intent(in) :: ientry
841  integer(I4B), intent(inout) :: n1
842  integer(I4B), intent(inout) :: n2
843  real(DP), intent(inout), optional :: rrate
844  real(DP), intent(inout), optional :: rhsval
845  real(DP), intent(inout), optional :: hcofval
846  ! -- local
847  real(DP) :: qbnd
848  real(DP) :: heatlat
849  !
850  n1 = this%flowbudptr%budterm(this%idxbudevap)%id1(ientry)
851  n2 = this%flowbudptr%budterm(this%idxbudevap)%id2(ientry)
852  ! -- note that qbnd is negative for evap
853  qbnd = this%flowbudptr%budterm(this%idxbudevap)%flow(ientry)
854  heatlat = this%gwecommon%gwerhow * this%gwecommon%gwelatheatvap
855  if (present(rrate)) rrate = qbnd * heatlat
856  if (present(rhsval)) rhsval = -rrate
857  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 322 of file gwe-sfe.f90.

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

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

475  ! -- dummy
476  class(GweSfeType) :: this
477  ! -- return
478  integer(I4B) :: nbudterms
479  !
480  ! -- Number of budget terms is 6:
481  ! 1. rainfall
482  ! 2. evaporation
483  ! 3. runoff
484  ! 4. ext-inflow
485  ! 5. ext-outflow
486  ! 6. strmbd-cond
487  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 1166 of file gwe-sfe.f90.

1167  ! -- dummy
1168  class(GweSfeType) :: this
1169  integer(I4B), intent(in) :: icv
1170  real(DP), intent(inout) :: vnew, vold
1171  real(DP), intent(in) :: delt
1172  ! -- local
1173  real(DP) :: qss
1174  !
1175  ! -- get volumes
1176  vold = dzero
1177  vnew = vold
1178  if (this%idxbudsto /= 0) then
1179  qss = this%flowbudptr%budterm(this%idxbudsto)%flow(icv)
1180  vnew = this%flowbudptr%budterm(this%idxbudsto)%auxvar(1, icv)
1181  this%vnew(icv) = vnew
1182  if (qss /= dzero) then
1183  vold = vnew + qss * delt
1184  else
1185  if (vnew == dzero) then
1186  vold = dzero
1187  else
1188  vold = this%vold(icv)
1189  end if
1190  end if
1191  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 890 of file gwe-sfe.f90.

891  ! -- dummy
892  class(GweSfeType) :: this
893  integer(I4B), intent(in) :: ientry
894  integer(I4B), intent(inout) :: n1
895  integer(I4B), intent(inout) :: n2
896  real(DP), intent(inout), optional :: rrate
897  real(DP), intent(inout), optional :: rhsval
898  real(DP), intent(inout), optional :: hcofval
899  ! -- local
900  real(DP) :: qbnd
901  real(DP) :: ctmp
902  !
903  n1 = this%flowbudptr%budterm(this%idxbudiflw)%id1(ientry)
904  n2 = this%flowbudptr%budterm(this%idxbudiflw)%id2(ientry)
905  qbnd = this%flowbudptr%budterm(this%idxbudiflw)%flow(ientry)
906  ctmp = this%tempiflw(n1)
907  if (present(rrate)) rrate = ctmp * qbnd * this%eqnsclfac
908  if (present(rhsval)) rhsval = -rrate
909  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 917 of file gwe-sfe.f90.

918  ! -- dummy
919  class(GweSfeType) :: this
920  integer(I4B), intent(in) :: ientry
921  integer(I4B), intent(inout) :: n1
922  integer(I4B), intent(inout) :: n2
923  real(DP), intent(inout), optional :: rrate
924  real(DP), intent(inout), optional :: rhsval
925  real(DP), intent(inout), optional :: hcofval
926  ! -- local
927  real(DP) :: qbnd
928  real(DP) :: ctmp
929  !
930  n1 = this%flowbudptr%budterm(this%idxbudoutf)%id1(ientry)
931  n2 = this%flowbudptr%budterm(this%idxbudoutf)%id2(ientry)
932  qbnd = this%flowbudptr%budterm(this%idxbudoutf)%flow(ientry)
933  ctmp = this%xnewpak(n1)
934  if (present(rrate)) rrate = ctmp * qbnd * this%eqnsclfac
935  if (present(rhsval)) rhsval = dzero
936  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 813 of file gwe-sfe.f90.

814  ! -- dummy
815  class(GweSfeType) :: this
816  integer(I4B), intent(in) :: ientry
817  integer(I4B), intent(inout) :: n1
818  integer(I4B), intent(inout) :: n2
819  real(DP), intent(inout), optional :: rrate
820  real(DP), intent(inout), optional :: rhsval
821  real(DP), intent(inout), optional :: hcofval
822  ! -- local
823  real(DP) :: qbnd
824  real(DP) :: ctmp
825  !
826  n1 = this%flowbudptr%budterm(this%idxbudrain)%id1(ientry)
827  n2 = this%flowbudptr%budterm(this%idxbudrain)%id2(ientry)
828  qbnd = this%flowbudptr%budterm(this%idxbudrain)%flow(ientry)
829  ctmp = this%temprain(n1)
830  if (present(rrate)) rrate = ctmp * qbnd * this%eqnsclfac
831  if (present(rhsval)) rhsval = -rrate
832  if (present(hcofval)) hcofval = dzero

◆ sfe_read_cvs()

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

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

1136  class(GweSfeType), intent(inout) :: this
1137  integer(I4B) :: n, ifeat
1138  real(DP), dimension(:), pointer, contiguous :: ktf_ptr => null()
1139  real(DP), dimension(:), pointer, contiguous :: rbthcnd_ptr => null()
1140  call this%TspAptType%apt_source_cvs()
1141  call mem_allocate(this%ktf, this%ncv, 'KTF', this%memoryPath)
1142  call mem_allocate(this%rfeatthk, this%ncv, 'RFEATTHK', this%memoryPath)
1143  call mem_setptr(ktf_ptr, 'KTF', this%input_mempath)
1144  call mem_setptr(rbthcnd_ptr, 'RBTHCND', this%input_mempath)
1145  do n = 1, size(this%pkg_ifno)
1146  ifeat = this%pkg_ifno(n)
1147  if (ifeat < 1 .or. ifeat > this%ncv) cycle
1148  this%ktf(ifeat) = ktf_ptr(n)
1149  this%rfeatthk(ifeat) = rbthcnd_ptr(n)
1150  if (this%rfeatthk(ifeat) <= dzero) then
1151  write (errmsg, '(4x,a)') &
1152  '****ERROR. Specified thickness used for thermal '// &
1153  'conduction MUST BE > 0 else divide by zero error occurs'
1154  call store_error(errmsg)
1155  end if
1156  end do
1157  if (count_errors() > 0) then
1158  call store_error_filename(this%input_fname)
1159  end if
1160  call memorystore_release('KTF', this%input_mempath)
1161  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 862 of file gwe-sfe.f90.

863  ! -- dummy
864  class(GweSfeType) :: this
865  integer(I4B), intent(in) :: ientry
866  integer(I4B), intent(inout) :: n1
867  integer(I4B), intent(inout) :: n2
868  real(DP), intent(inout), optional :: rrate
869  real(DP), intent(inout), optional :: rhsval
870  real(DP), intent(inout), optional :: hcofval
871  ! -- local
872  real(DP) :: qbnd
873  real(DP) :: ctmp
874  !
875  n1 = this%flowbudptr%budterm(this%idxbudroff)%id1(ientry)
876  n2 = this%flowbudptr%budterm(this%idxbudroff)%id2(ientry)
877  qbnd = this%flowbudptr%budterm(this%idxbudroff)%flow(ientry)
878  ctmp = this%temproff(n1)
879  if (present(rrate)) rrate = ctmp * qbnd * this%eqnsclfac
880  if (present(rhsval)) rhsval = -rrate
881  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 1060 of file gwe-sfe.f90.

1061  ! -- dummy
1062  class(GweSfeType), intent(inout) :: this !< package class
1063  type(ObserveType), intent(inout) :: obsrv !< observation object
1064  logical, intent(inout) :: found !< indicate whether observation was found
1065  ! -- local
1066  !
1067  found = .true.
1068  select case (obsrv%ObsTypeId)
1069  case ('RAINFALL')
1070  call this%rp_obs_byfeature(obsrv)
1071  case ('EVAPORATION')
1072  call this%rp_obs_byfeature(obsrv)
1073  case ('RUNOFF')
1074  call this%rp_obs_byfeature(obsrv)
1075  case ('EXT-INFLOW')
1076  call this%rp_obs_byfeature(obsrv)
1077  case ('EXT-OUTFLOW')
1078  call this%rp_obs_byfeature(obsrv)
1079  case ('TO-MVR')
1080  call this%rp_obs_byfeature(obsrv)
1081  case ('STRMBD-COND')
1082  call this%rp_obs_byfeature(obsrv)
1083  case default
1084  found = .false.
1085  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 944 of file gwe-sfe.f90.

945  ! -- dummy
946  class(GweSfeType) :: this
947  integer(I4B), intent(in) :: ientry
948  integer(I4B), intent(inout) :: n1
949  integer(I4B), intent(inout) :: igwfnode
950  real(DP), intent(inout), optional :: rrate
951  real(DP), intent(inout), optional :: rhsval
952  real(DP), intent(inout), optional :: hcofval
953  ! -- local
954  integer(I4B) :: auxpos
955  real(DP) :: wa !< wetted area
956  real(DP) :: ktf !< thermal conductivity of streambed material
957  real(DP) :: s !< thickness of conductive streambed material
958  real(DP) :: ctherm
959  !
960  rrate = dzero
961  n1 = this%flowbudptr%budterm(this%idxbudgwf)%id1(ientry)
962  ! -- use igwfnode instead of n2 for consistency with usage in apt;
963  ! helps highlight that cell number is sought and used
964  igwfnode = this%flowbudptr%budterm(this%idxbudgwf)%id2(ientry)
965  ! -- For now, there is only 1 aux variable under 'GWF'
966  auxpos = this%flowbudptr%budterm(this%idxbudgwf)%naux
967  wa = this%flowbudptr%budterm(this%idxbudgwf)%auxvar(auxpos, ientry)
968  ktf = this%ktf(n1)
969  s = this%rfeatthk(n1)
970  ctherm = ktf * wa / s
971  ! -- this%xnew available b/c set in parent class (TspAptType) using
972  ! routine set_pointers from the "grandparent" class BndType
973  if (present(rrate)) rrate = ctherm * (this%xnew(igwfnode) - this%xnewpak(n1))
974  if (present(rhsval)) rhsval = dzero
975  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 297 of file gwe-sfe.f90.

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

◆ sfe_setup_budobj()

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

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

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

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