MODFLOW 6  version 6.5.0.dev2
MODFLOW 6 Code Documentation
gwe-sfe.f90
Go to the documentation of this file.
1 ! -- Stream Energy Transport Module
2 ! -- todo: Temperature decay?
3 ! -- todo: save the sfe temperature into the sfr aux variable? (perhaps needed for GWT-GWE exchanges)
4 ! -- todo: calculate the sfr VISC aux variable using temperature?
5 !
6 ! SFR flows (sfrbudptr) index var SFE term Transport Type
7 !---------------------------------------------------------------------------------
8 
9 ! -- terms from SFR that will be handled by parent APT Package
10 ! FLOW-JA-FACE idxbudfjf FLOW-JA-FACE cv2cv
11 ! GWF (aux FLOW-AREA) idxbudgwf GWF cv2gwf
12 ! STORAGE (aux VOLUME) idxbudsto none used for cv volumes
13 ! FROM-MVR idxbudfmvr FROM-MVR q * tmpext = this%qfrommvr(:) ! kluge note: include rhow*cpw in comments for various terms
14 ! TO-MVR idxbudtmvr TO-MVR q * tfeat
15 
16 ! -- SFR terms
17 ! RAINFALL idxbudrain RAINFALL q * train
18 ! EVAPORATION idxbudevap EVAPORATION tfeat<tevap: q*tfeat, else: q*tevap (latent heat will likely need to modify these calcs in the future) ! kluge note
19 ! RUNOFF idxbudroff RUNOFF q * troff
20 ! EXT-INFLOW idxbudiflw EXT-INFLOW q * tiflw
21 ! EXT-OUTFLOW idxbudoutf EXT-OUTFLOW q * tfeat
22 ! STRMBD-COND idxbudsbcd STRMBD-COND ! kluge note: expression for this
23 
24 ! -- terms from a flow file that should be skipped
25 ! CONSTANT none none none
26 ! AUXILIARY none none none
27 
28 ! -- terms that are written to the transport budget file
29 ! none none STORAGE (aux MASS) dE/dt
30 ! none none AUXILIARY none
31 ! none none CONSTANT accumulate
32 !
33 !
35 
36  use kindmodule, only: dp, i4b
38  use simmodule, only: store_error
39  use bndmodule, only: bndtype, getbndfromlist
40  use tspfmimodule, only: tspfmitype
41  use sfrmodule, only: sfrtype
42  use observemodule, only: observetype
47  !
48  implicit none
49  !
50  private
51  public :: sfe_create
52  !
53  character(len=*), parameter :: ftype = 'SFE'
54  character(len=*), parameter :: flowtype = 'SFR'
55  character(len=16) :: text = ' SFE'
56 
57  type, extends(tspapttype) :: gwesfetype
58 
59  type(gweinputdatatype), pointer :: gwecommon => null() !< pointer to shared gwe data used by multiple packages but set in mst
60 
61  integer(I4B), pointer :: idxbudrain => null() !< index of rainfall terms in flowbudptr
62  integer(I4B), pointer :: idxbudevap => null() !< index of evaporation terms in flowbudptr
63  integer(I4B), pointer :: idxbudroff => null() !< index of runoff terms in flowbudptr
64  integer(I4B), pointer :: idxbudiflw => null() !< index of inflow terms in flowbudptr
65  integer(I4B), pointer :: idxbudoutf => null() !< index of outflow terms in flowbudptr
66  integer(I4B), pointer :: idxbudsbcd => null() !< index of streambed conduction terms in flowbudptr
67 
68  real(dp), dimension(:), pointer, contiguous :: temprain => null() !< rainfall temperature
69  real(dp), dimension(:), pointer, contiguous :: tempevap => null() !< evaporation temperature
70  real(dp), dimension(:), pointer, contiguous :: temproff => null() !< runoff temperature
71  real(dp), dimension(:), pointer, contiguous :: tempiflw => null() !< inflow temperature
72 
73  contains
74 
75  procedure :: bnd_da => sfe_da
76  procedure :: allocate_scalars
77  procedure :: apt_allocate_arrays => sfe_allocate_arrays
78  procedure :: find_apt_package => find_sfe_package
79  procedure :: pak_fc_expanded => sfe_fc_expanded
80  procedure :: pak_solve => sfe_solve
81  procedure :: pak_get_nbudterms => sfe_get_nbudterms
82  procedure :: pak_setup_budobj => sfe_setup_budobj
83  procedure :: pak_fill_budobj => sfe_fill_budobj
84  procedure :: sfe_rain_term
85  procedure :: sfe_evap_term
86  procedure :: sfe_roff_term
87  procedure :: sfe_iflw_term
88  procedure :: sfe_outf_term
89  procedure :: pak_df_obs => sfe_df_obs
90  procedure :: pak_rp_obs => sfe_rp_obs
91  procedure :: pak_bd_obs => sfe_bd_obs
92  procedure :: pak_set_stressperiod => sfe_set_stressperiod
93 
94  end type gwesfetype
95 
96 contains
97 
98  !> @brief Create a new sfe package
99  !<
100  subroutine sfe_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
101  fmi, eqnsclfac, gwecommon, dvt, dvu, dvua)
102  ! -- dummy
103  class(bndtype), pointer :: packobj
104  integer(I4B), intent(in) :: id
105  integer(I4B), intent(in) :: ibcnum
106  integer(I4B), intent(in) :: inunit
107  integer(I4B), intent(in) :: iout
108  character(len=*), intent(in) :: namemodel
109  character(len=*), intent(in) :: pakname
110  type(tspfmitype), pointer :: fmi
111  real(dp), intent(in), pointer :: eqnsclfac !< Governing equation scale factor
112  type(gweinputdatatype), intent(in), target :: gwecommon !< Shared data container for use by multiple GWE packages
113  character(len=*), intent(in) :: dvt !< For GWE, set to "TEMPERATURE" in TspAptType
114  character(len=*), intent(in) :: dvu !< For GWE, set to "energy" in TspAptType
115  character(len=*), intent(in) :: dvua !< For GWE, set to "E" in TspAptType
116  ! -- local
117  type(gwesfetype), pointer :: sfeobj
118  !
119  ! -- Allocate the object and assign values to object variables
120  allocate (sfeobj)
121  packobj => sfeobj
122  !
123  ! -- Create name and memory path
124  call packobj%set_names(ibcnum, namemodel, pakname, ftype)
125  packobj%text = text
126  !
127  ! -- Allocate scalars
128  call sfeobj%allocate_scalars()
129  !
130  ! -- Initialize package
131  call packobj%pack_initialize()
132  !
133  packobj%inunit = inunit
134  packobj%iout = iout
135  packobj%id = id
136  packobj%ibcnum = ibcnum
137  packobj%ncolbnd = 1
138  packobj%iscloc = 1
139  !
140  ! -- Store pointer to flow model interface. When the GwfGwt exchange is
141  ! created, it sets fmi%bndlist so that the GWT model has access to all
142  ! the flow packages
143  sfeobj%fmi => fmi
144  !
145  ! -- Store pointer to governing equation scale factor
146  sfeobj%eqnsclfac => eqnsclfac
147  !
148  ! -- Store pointer to shared data module for accessing cpw, rhow
149  ! for the budget calculations, and for accessing the latent heat of
150  ! vaporization for evaporative cooling.
151  sfeobj%gwecommon => gwecommon
152  !
153  ! -- Set labels that will be used in generalized APT class
154  sfeobj%depvartype = dvt
155  sfeobj%depvarunit = dvu
156  sfeobj%depvarunitabbrev = dvua
157  !
158  ! -- Return
159  return
160  end subroutine sfe_create
161 
162  !> @brief Find corresponding sfe package
163  !<
164  subroutine find_sfe_package(this)
165  ! -- modules
167  ! -- dummy
168  class(gwesfetype) :: this
169  ! -- local
170  character(len=LINELENGTH) :: errmsg
171  class(bndtype), pointer :: packobj
172  integer(I4B) :: ip, icount
173  integer(I4B) :: nbudterm
174  logical :: found
175  !
176  ! -- Initialize found to false, and error later if flow package cannot
177  ! be found
178  found = .false.
179  !
180  ! -- If user is specifying flows in a binary budget file, then set up
181  ! the budget file reader, otherwise set a pointer to the flow package
182  ! budobj
183  if (this%fmi%flows_from_file) then
184  call this%fmi%set_aptbudobj_pointer(this%flowpackagename, this%flowbudptr)
185  if (associated(this%flowbudptr)) found = .true.
186  !
187  else
188  if (associated(this%fmi%gwfbndlist)) then
189  ! -- Look through gwfbndlist for a flow package with the same name as
190  ! this transport package name
191  do ip = 1, this%fmi%gwfbndlist%Count()
192  packobj => getbndfromlist(this%fmi%gwfbndlist, ip)
193  if (packobj%packName == this%flowpackagename) then
194  found = .true.
195  !
196  ! -- Store BndType pointer to packobj, and then
197  ! use the select type to point to the budobj in flow package
198  this%flowpackagebnd => packobj
199  select type (packobj)
200  type is (sfrtype)
201  this%flowbudptr => packobj%budobj
202  end select
203  end if
204  if (found) exit
205  end do
206  end if
207  end if
208  !
209  ! -- Error if flow package not found
210  if (.not. found) then
211  write (errmsg, '(a)') 'COULD NOT FIND FLOW PACKAGE WITH NAME '&
212  &//trim(adjustl(this%flowpackagename))//'.'
213  call store_error(errmsg)
214  call this%parser%StoreErrorUnit()
215  end if
216  !
217  ! -- Allocate space for idxbudssm, which indicates whether this is a
218  ! special budget term or one that is a general source and sink
219  nbudterm = this%flowbudptr%nbudterm
220  call mem_allocate(this%idxbudssm, nbudterm, 'IDXBUDSSM', this%memoryPath)
221  !
222  ! -- Process budget terms and identify special budget terms
223  write (this%iout, '(/, a, a)') &
224  'PROCESSING '//ftype//' INFORMATION FOR ', this%packName
225  write (this%iout, '(a)') ' IDENTIFYING FLOW TERMS IN '//flowtype//' PACKAGE'
226  write (this%iout, '(a, i0)') &
227  ' NUMBER OF '//flowtype//' = ', this%flowbudptr%ncv
228  icount = 1
229  do ip = 1, this%flowbudptr%nbudterm
230  select case (trim(adjustl(this%flowbudptr%budterm(ip)%flowtype)))
231  case ('FLOW-JA-FACE')
232  this%idxbudfjf = ip
233  this%idxbudssm(ip) = 0
234  case ('GWF')
235  this%idxbudgwf = ip
236  this%idxbudssm(ip) = 0
237  case ('STORAGE')
238  this%idxbudsto = ip
239  this%idxbudssm(ip) = 0
240  case ('RAINFALL')
241  this%idxbudrain = ip
242  this%idxbudssm(ip) = 0
243  case ('EVAPORATION')
244  this%idxbudevap = ip
245  this%idxbudssm(ip) = 0
246  case ('RUNOFF')
247  this%idxbudroff = ip
248  this%idxbudssm(ip) = 0
249  case ('EXT-INFLOW')
250  this%idxbudiflw = ip
251  this%idxbudssm(ip) = 0
252  case ('EXT-OUTFLOW')
253  this%idxbudoutf = ip
254  this%idxbudssm(ip) = 0
255  case ('TO-MVR')
256  this%idxbudtmvr = ip
257  this%idxbudssm(ip) = 0
258  case ('FROM-MVR')
259  this%idxbudfmvr = ip
260  this%idxbudssm(ip) = 0
261  case ('AUXILIARY')
262  this%idxbudaux = ip
263  this%idxbudssm(ip) = 0
264  case default
265  !
266  ! -- Set idxbudssm equal to a column index for where the temperatures
267  ! are stored in the concbud(nbudssm, ncv) array
268  this%idxbudssm(ip) = icount
269  icount = icount + 1
270  end select
271  write (this%iout, '(a, i0, " = ", a,/, a, i0)') &
272  ' TERM ', ip, trim(adjustl(this%flowbudptr%budterm(ip)%flowtype)), &
273  ' MAX NO. OF ENTRIES = ', this%flowbudptr%budterm(ip)%maxlist
274  end do
275  write (this%iout, '(a, //)') 'DONE PROCESSING '//ftype//' INFORMATION'
276  !
277  ! -- Streambed conduction term
278  this%idxbudsbcd = this%idxbudgwf
279  !
280  ! -- Return
281  return
282  end subroutine find_sfe_package
283 
284  !> @brief Add matrix terms related to SFE
285  !!
286  !! This will be called from TspAptType%apt_fc_expanded()
287  !! in order to add matrix terms specifically for SFE
288  !<
289  subroutine sfe_fc_expanded(this, rhs, ia, idxglo, matrix_sln)
290  ! -- dummy
291  class(gwesfetype) :: this
292  real(DP), dimension(:), intent(inout) :: rhs
293  integer(I4B), dimension(:), intent(in) :: ia
294  integer(I4B), dimension(:), intent(in) :: idxglo
295  class(matrixbasetype), pointer :: matrix_sln
296  ! -- local
297  integer(I4B) :: j, n, n1, n2
298  integer(I4B) :: iloc
299  integer(I4B) :: iposd, iposoffd
300  integer(I4B) :: ipossymd, ipossymoffd
301  integer(I4B) :: auxpos
302  real(DP) :: rrate
303  real(DP) :: rhsval
304  real(DP) :: hcofval
305  real(DP) :: ctherm
306  real(DP) :: wa !< wetted area
307  real(DP) :: ktf !< thermal conductivity of streambed material
308  real(DP) :: s !< thickness of conductive streambed material
309  !
310  ! -- Add rainfall contribution
311  if (this%idxbudrain /= 0) then
312  do j = 1, this%flowbudptr%budterm(this%idxbudrain)%nlist
313  call this%sfe_rain_term(j, n1, n2, rrate, rhsval, hcofval)
314  iloc = this%idxlocnode(n1)
315  iposd = this%idxpakdiag(n1)
316  call matrix_sln%add_value_pos(iposd, hcofval)
317  rhs(iloc) = rhs(iloc) + rhsval
318  end do
319  end if
320  !
321  ! -- Add evaporation contribution
322  if (this%idxbudevap /= 0) then
323  do j = 1, this%flowbudptr%budterm(this%idxbudevap)%nlist
324  call this%sfe_evap_term(j, n1, n2, rrate, rhsval, hcofval)
325  iloc = this%idxlocnode(n1)
326  iposd = this%idxpakdiag(n1)
327  call matrix_sln%add_value_pos(iposd, hcofval)
328  rhs(iloc) = rhs(iloc) + rhsval
329  end do
330  end if
331  !
332  ! -- Add runoff contribution
333  if (this%idxbudroff /= 0) then
334  do j = 1, this%flowbudptr%budterm(this%idxbudroff)%nlist
335  call this%sfe_roff_term(j, n1, n2, rrate, rhsval, hcofval)
336  iloc = this%idxlocnode(n1)
337  iposd = this%idxpakdiag(n1)
338  call matrix_sln%add_value_pos(iposd, hcofval)
339  rhs(iloc) = rhs(iloc) + rhsval
340  end do
341  end if
342  !
343  ! -- Add inflow contribution
344  if (this%idxbudiflw /= 0) then
345  do j = 1, this%flowbudptr%budterm(this%idxbudiflw)%nlist
346  call this%sfe_iflw_term(j, n1, n2, rrate, rhsval, hcofval)
347  iloc = this%idxlocnode(n1)
348  iposd = this%idxpakdiag(n1)
349  call matrix_sln%add_value_pos(iposd, hcofval)
350  rhs(iloc) = rhs(iloc) + rhsval
351  end do
352  end if
353  !
354  ! -- Add outflow contribution
355  if (this%idxbudoutf /= 0) then
356  do j = 1, this%flowbudptr%budterm(this%idxbudoutf)%nlist
357  call this%sfe_outf_term(j, n1, n2, rrate, rhsval, hcofval)
358  iloc = this%idxlocnode(n1)
359  iposd = this%idxpakdiag(n1)
360  call matrix_sln%add_value_pos(iposd, hcofval)
361  rhs(iloc) = rhs(iloc) + rhsval
362  end do
363  end if
364  !
365  ! -- Add streambed conduction contribution
366  do j = 1, this%flowbudptr%budterm(this%idxbudgwf)%nlist
367  !
368  ! -- Set n to feature number and process if active feature
369  n = this%flowbudptr%budterm(this%idxbudgwf)%id1(j)
370  if (this%iboundpak(n) /= 0) then
371  !
372  ! -- Set acoef and rhs to negative so they are relative to sfe and not gwe
373  auxpos = this%flowbudptr%budterm(this%idxbudgwf)%naux
374  wa = this%flowbudptr%budterm(this%idxbudgwf)%auxvar(auxpos, j)
375  ktf = this%ktf(n)
376  s = this%rfeatthk(n)
377  ctherm = ktf * wa / s
378  !
379  ! -- Add to sfe row
380  iposd = this%idxdglo(j)
381  iposoffd = this%idxoffdglo(j)
382  call matrix_sln%add_value_pos(iposd, -ctherm)
383  call matrix_sln%add_value_pos(iposoffd, ctherm)
384  !
385  ! -- Add to gwe row for sfe connection
386  ipossymd = this%idxsymdglo(j)
387  ipossymoffd = this%idxsymoffdglo(j)
388  call matrix_sln%add_value_pos(ipossymd, -ctherm)
389  call matrix_sln%add_value_pos(ipossymoffd, ctherm)
390  end if
391  end do
392  !
393  ! -- Return
394  return
395  end subroutine sfe_fc_expanded
396 
397  !> @ brief Add terms specific to sfr to the explicit sfe solve
398  !<
399  subroutine sfe_solve(this)
400  ! -- dummy
401  class(gwesfetype) :: this
402  ! -- local
403  integer(I4B) :: j
404  integer(I4B) :: n1, n2
405  real(DP) :: rrate
406  !
407  ! -- Add rainfall contribution
408  if (this%idxbudrain /= 0) then
409  do j = 1, this%flowbudptr%budterm(this%idxbudrain)%nlist
410  call this%sfe_rain_term(j, n1, n2, rrate)
411  this%dbuff(n1) = this%dbuff(n1) + rrate
412  end do
413  end if
414  !
415  ! -- Add evaporation contribution
416  if (this%idxbudevap /= 0) then
417  do j = 1, this%flowbudptr%budterm(this%idxbudevap)%nlist
418  call this%sfe_evap_term(j, n1, n2, rrate)
419  this%dbuff(n1) = this%dbuff(n1) + rrate
420  end do
421  end if
422  !
423  ! -- Add runoff contribution
424  if (this%idxbudroff /= 0) then
425  do j = 1, this%flowbudptr%budterm(this%idxbudroff)%nlist
426  call this%sfe_roff_term(j, n1, n2, rrate)
427  this%dbuff(n1) = this%dbuff(n1) + rrate
428  end do
429  end if
430  !
431  ! -- Add inflow contribution
432  if (this%idxbudiflw /= 0) then
433  do j = 1, this%flowbudptr%budterm(this%idxbudiflw)%nlist
434  call this%sfe_iflw_term(j, n1, n2, rrate)
435  this%dbuff(n1) = this%dbuff(n1) + rrate
436  end do
437  end if
438  !
439  ! -- Add outflow contribution
440  if (this%idxbudoutf /= 0) then
441  do j = 1, this%flowbudptr%budterm(this%idxbudoutf)%nlist
442  call this%sfe_outf_term(j, n1, n2, rrate)
443  this%dbuff(n1) = this%dbuff(n1) + rrate
444  end do
445  end if
446  !
447  ! Note: explicit streambed conduction terms???
448  !
449  ! -- Return
450  return
451  end subroutine sfe_solve
452 
453  !> @brief Function to return the number of budget terms just for this package.
454  !!
455  !! This overrides a function in the parent class.
456  !<
457  function sfe_get_nbudterms(this) result(nbudterms)
458  ! -- dummy
459  class(gwesfetype) :: this
460  ! -- return
461  integer(I4B) :: nbudterms
462  !
463  ! -- Number of budget terms is 6:
464  ! 1. rainfall
465  ! 2. evaporation
466  ! 3. runoff
467  ! 4. ext-inflow
468  ! 5. ext-outflow
469  ! 6. streambed-cond
470  nbudterms = 6
471  !
472  ! -- Return
473  return
474  end function sfe_get_nbudterms
475 
476  !> @brief Set up the budget object that stores all the sfe flows
477  !<
478  subroutine sfe_setup_budobj(this, idx)
479  ! -- modules
480  use constantsmodule, only: lenbudtxt
481  ! -- dummy
482  class(gwesfetype) :: this
483  integer(I4B), intent(inout) :: idx
484  ! -- local
485  integer(I4B) :: n, n1, n2
486  integer(I4B) :: maxlist, naux
487  real(DP) :: q
488  character(len=LENBUDTXT) :: text
489  !
490  ! --
491  text = ' RAINFALL'
492  idx = idx + 1
493  maxlist = this%flowbudptr%budterm(this%idxbudrain)%maxlist
494  naux = 0
495  call this%budobj%budterm(idx)%initialize(text, &
496  this%name_model, &
497  this%packName, &
498  this%name_model, &
499  this%packName, &
500  maxlist, .false., .false., &
501  naux)
502  !
503  ! --
504  text = ' EVAPORATION'
505  idx = idx + 1
506  maxlist = this%flowbudptr%budterm(this%idxbudevap)%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 = ' RUNOFF'
518  idx = idx + 1
519  maxlist = this%flowbudptr%budterm(this%idxbudroff)%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 = ' EXT-INFLOW'
531  idx = idx + 1
532  maxlist = this%flowbudptr%budterm(this%idxbudiflw)%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-OUTFLOW'
544  idx = idx + 1
545  maxlist = this%flowbudptr%budterm(this%idxbudoutf)%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  ! -- Conduction through the wetted streambed
556  text = ' STREAMBED-COND'
557  idx = idx + 1
558  maxlist = this%flowbudptr%budterm(this%idxbudsbcd)%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  call this%budobj%budterm(idx)%reset(maxlist)
568  q = dzero
569  do n = 1, maxlist
570  n1 = this%flowbudptr%budterm(this%idxbudgwf)%id1(n)
571  n2 = this%flowbudptr%budterm(this%idxbudgwf)%id2(n)
572  call this%budobj%budterm(idx)%update_term(n1, n2, q)
573  end do
574  !
575  ! -- Return
576  return
577  end subroutine sfe_setup_budobj
578 
579  !> @brief Copy flow terms into this%budobj
580  !<
581  subroutine sfe_fill_budobj(this, idx, x, flowja, ccratin, ccratout)
582  ! -- dummy
583  class(gwesfetype) :: this
584  integer(I4B), intent(inout) :: idx
585  real(DP), dimension(:), intent(in) :: x
586  real(DP), dimension(:), contiguous, intent(inout) :: flowja
587  real(DP), intent(inout) :: ccratin
588  real(DP), intent(inout) :: ccratout
589  ! -- local
590  integer(I4B) :: j, n1, n2
591  integer(I4B) :: nlist
592  integer(I4B) :: igwfnode
593  integer(I4B) :: idiag
594  integer(I4B) :: auxpos
595  real(DP) :: q
596  real(DP) :: ctherm
597  real(DP) :: wa !< wetted area
598  real(DP) :: ktf !< thermal conductivity of streambed material
599  real(DP) :: s !< thickness of conductive streambed materia
600  !
601  ! -- Rain
602  idx = idx + 1
603  nlist = this%flowbudptr%budterm(this%idxbudrain)%nlist
604  call this%budobj%budterm(idx)%reset(nlist)
605  do j = 1, nlist
606  call this%sfe_rain_term(j, n1, n2, q)
607  call this%budobj%budterm(idx)%update_term(n1, n2, q)
608  call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
609  end do
610  !
611  ! -- Evaporation
612  idx = idx + 1
613  nlist = this%flowbudptr%budterm(this%idxbudevap)%nlist
614  call this%budobj%budterm(idx)%reset(nlist)
615  do j = 1, nlist
616  call this%sfe_evap_term(j, n1, n2, q)
617  call this%budobj%budterm(idx)%update_term(n1, n2, q)
618  call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
619  end do
620  !
621  ! -- Runoff
622  idx = idx + 1
623  nlist = this%flowbudptr%budterm(this%idxbudroff)%nlist
624  call this%budobj%budterm(idx)%reset(nlist)
625  do j = 1, nlist
626  call this%sfe_roff_term(j, n1, n2, q)
627  call this%budobj%budterm(idx)%update_term(n1, n2, q)
628  call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
629  end do
630  !
631  ! -- Ext-inflow
632  idx = idx + 1
633  nlist = this%flowbudptr%budterm(this%idxbudiflw)%nlist
634  call this%budobj%budterm(idx)%reset(nlist)
635  do j = 1, nlist
636  call this%sfe_iflw_term(j, n1, n2, q)
637  call this%budobj%budterm(idx)%update_term(n1, n2, q)
638  call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
639  end do
640  !
641  ! -- Ext-outflow
642  idx = idx + 1
643  nlist = this%flowbudptr%budterm(this%idxbudoutf)%nlist
644  call this%budobj%budterm(idx)%reset(nlist)
645  do j = 1, nlist
646  call this%sfe_outf_term(j, n1, n2, q)
647  call this%budobj%budterm(idx)%update_term(n1, n2, q)
648  call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
649  end do
650  !
651  ! -- Strmbd-cond
652  idx = idx + 1
653  call this%budobj%budterm(idx)%reset(this%maxbound)
654  do j = 1, this%flowbudptr%budterm(this%idxbudsbcd)%nlist
655  q = dzero
656  n1 = this%flowbudptr%budterm(this%idxbudsbcd)%id1(j)
657  if (this%iboundpak(n1) /= 0) then
658  igwfnode = this%flowbudptr%budterm(this%idxbudsbcd)%id2(j)
659  ! -- For now, there is only 1 aux variable under 'GWF'
660  auxpos = this%flowbudptr%budterm(this%idxbudgwf)%naux
661  wa = this%flowbudptr%budterm(this%idxbudgwf)%auxvar(auxpos, j)
662  ktf = this%ktf(n1)
663  s = this%rfeatthk(n1)
664  ctherm = ktf * wa / s
665  q = ctherm * (x(igwfnode) - this%xnewpak(n1))
666  end if
667  call this%budobj%budterm(idx)%update_term(n1, igwfnode, q)
668  call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
669  if (this%iboundpak(n1) /= 0) then
670  ! -- Contribution to gwe cell budget
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
676  !
677  ! -- Return
678  return
679  end subroutine sfe_fill_budobj
680 
681  !> @brief Allocate scalars specific to the streamflow energy transport (SFE)
682  !! package.
683  !<
684  subroutine allocate_scalars(this)
685  ! -- modules
687  ! -- dummy
688  class(gwesfetype) :: this
689  !
690  ! -- Allocate scalars in TspAptType
691  call this%TspAptType%allocate_scalars()
692  !
693  ! -- Allocate
694  call mem_allocate(this%idxbudrain, 'IDXBUDRAIN', this%memoryPath)
695  call mem_allocate(this%idxbudevap, 'IDXBUDEVAP', this%memoryPath)
696  call mem_allocate(this%idxbudroff, 'IDXBUDROFF', this%memoryPath)
697  call mem_allocate(this%idxbudiflw, 'IDXBUDIFLW', this%memoryPath)
698  call mem_allocate(this%idxbudoutf, 'IDXBUDOUTF', this%memoryPath)
699  call mem_allocate(this%idxbudsbcd, 'IDXBUDSBCD', this%memoryPath)
700  !
701  ! -- Initialize
702  this%idxbudrain = 0
703  this%idxbudevap = 0
704  this%idxbudroff = 0
705  this%idxbudiflw = 0
706  this%idxbudoutf = 0
707  this%idxbudsbcd = 0
708  !
709  ! -- Return
710  return
711  end subroutine allocate_scalars
712 
713  !> @brief Allocate arrays specific to the streamflow energy transport (SFE)
714  !! package.
715  !<
716  subroutine sfe_allocate_arrays(this)
717  ! -- modules
719  ! -- dummy
720  class(gwesfetype), intent(inout) :: this
721  ! -- local
722  integer(I4B) :: n
723  !
724  ! -- Time series
725  call mem_allocate(this%temprain, this%ncv, 'TEMPRAIN', this%memoryPath)
726  call mem_allocate(this%tempevap, this%ncv, 'TEMPEVAP', this%memoryPath)
727  call mem_allocate(this%temproff, this%ncv, 'TEMPROFF', this%memoryPath)
728  call mem_allocate(this%tempiflw, this%ncv, 'TEMPIFLW', this%memoryPath)
729  !
730  ! -- Call standard TspAptType allocate arrays
731  call this%TspAptType%apt_allocate_arrays()
732  !
733  ! -- Initialize
734  do n = 1, this%ncv
735  this%temprain(n) = dzero
736  this%tempevap(n) = dzero
737  this%temproff(n) = dzero
738  this%tempiflw(n) = dzero
739  end do
740  !
741  ! -- Return
742  return
743  end subroutine sfe_allocate_arrays
744 
745  !> @brief Deallocate memory
746  !<
747  subroutine sfe_da(this)
748  ! -- modules
750  ! -- dummy
751  class(gwesfetype) :: this
752  !
753  ! -- Deallocate scalars
754  call mem_deallocate(this%idxbudrain)
755  call mem_deallocate(this%idxbudevap)
756  call mem_deallocate(this%idxbudroff)
757  call mem_deallocate(this%idxbudiflw)
758  call mem_deallocate(this%idxbudoutf)
759  call mem_deallocate(this%idxbudsbcd)
760  !
761  ! -- Deallocate time series
762  call mem_deallocate(this%temprain)
763  call mem_deallocate(this%tempevap)
764  call mem_deallocate(this%temproff)
765  call mem_deallocate(this%tempiflw)
766  !
767  ! -- Deallocate scalars in TspAptType
768  call this%TspAptType%bnd_da()
769  !
770  ! -- Return
771  return
772  end subroutine sfe_da
773 
774  !> @brief Rain term
775  !<
776  subroutine sfe_rain_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
777  ! -- dummy
778  class(gwesfetype) :: this
779  integer(I4B), intent(in) :: ientry
780  integer(I4B), intent(inout) :: n1
781  integer(I4B), intent(inout) :: n2
782  real(DP), intent(inout), optional :: rrate
783  real(DP), intent(inout), optional :: rhsval
784  real(DP), intent(inout), optional :: hcofval
785  ! -- local
786  real(DP) :: qbnd
787  real(DP) :: ctmp
788  !
789  n1 = this%flowbudptr%budterm(this%idxbudrain)%id1(ientry)
790  n2 = this%flowbudptr%budterm(this%idxbudrain)%id2(ientry)
791  qbnd = this%flowbudptr%budterm(this%idxbudrain)%flow(ientry)
792  ctmp = this%temprain(n1)
793  if (present(rrate)) rrate = ctmp * qbnd * this%eqnsclfac ! kluge note: think about budget / sensible heat issue
794  if (present(rhsval)) rhsval = -rrate
795  if (present(hcofval)) hcofval = dzero
796  !
797  ! -- Return
798  return
799  end subroutine sfe_rain_term
800 
801  !> @brief Evaporative term
802  !<
803  subroutine sfe_evap_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
804  ! -- dummy
805  class(gwesfetype) :: this
806  integer(I4B), intent(in) :: ientry
807  integer(I4B), intent(inout) :: n1
808  integer(I4B), intent(inout) :: n2
809  real(DP), intent(inout), optional :: rrate
810  real(DP), intent(inout), optional :: rhsval
811  real(DP), intent(inout), optional :: hcofval
812  ! -- local
813  real(DP) :: qbnd
814  real(DP) :: heatlat
815  !
816  n1 = this%flowbudptr%budterm(this%idxbudevap)%id1(ientry)
817  n2 = this%flowbudptr%budterm(this%idxbudevap)%id2(ientry)
818  ! -- note that qbnd is negative for evap
819  qbnd = this%flowbudptr%budterm(this%idxbudevap)%flow(ientry)
820  heatlat = this%gwecommon%gwerhow * this%gwecommon%gwelatheatvap
821  if (present(rrate)) rrate = qbnd * heatlat
822  !!if (present(rhsval)) rhsval = -rrate / this%eqnsclfac ! kluge note: divided by eqnsclfac for fc purposes because rrate is in terms of energy
823  if (present(rhsval)) rhsval = -rrate
824  if (present(hcofval)) hcofval = dzero
825  !
826  ! -- Return
827  return
828  end subroutine sfe_evap_term
829 
830  !> @brief Runoff term
831  !<
832  subroutine sfe_roff_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
833  ! -- dummy
834  class(gwesfetype) :: this
835  integer(I4B), intent(in) :: ientry
836  integer(I4B), intent(inout) :: n1
837  integer(I4B), intent(inout) :: n2
838  real(DP), intent(inout), optional :: rrate
839  real(DP), intent(inout), optional :: rhsval
840  real(DP), intent(inout), optional :: hcofval
841  ! -- local
842  real(DP) :: qbnd
843  real(DP) :: ctmp
844  !
845  n1 = this%flowbudptr%budterm(this%idxbudroff)%id1(ientry)
846  n2 = this%flowbudptr%budterm(this%idxbudroff)%id2(ientry)
847  qbnd = this%flowbudptr%budterm(this%idxbudroff)%flow(ientry)
848  ctmp = this%temproff(n1)
849  if (present(rrate)) rrate = ctmp * qbnd * this%eqnsclfac
850  if (present(rhsval)) rhsval = -rrate
851  if (present(hcofval)) hcofval = dzero
852  !
853  ! -- Return
854  return
855  end subroutine sfe_roff_term
856 
857  !> @brief Inflow Term
858  !!
859  !! Accounts for energy added via streamflow entering into a stream channel;
860  !! for example, energy entering the model domain via a specified flow in a
861  !! stream channel.
862  !<
863  subroutine sfe_iflw_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
864  ! -- dummy
865  class(gwesfetype) :: this
866  integer(I4B), intent(in) :: ientry
867  integer(I4B), intent(inout) :: n1
868  integer(I4B), intent(inout) :: n2
869  real(DP), intent(inout), optional :: rrate
870  real(DP), intent(inout), optional :: rhsval
871  real(DP), intent(inout), optional :: hcofval
872  ! -- local
873  real(DP) :: qbnd
874  real(DP) :: ctmp
875  !
876  n1 = this%flowbudptr%budterm(this%idxbudiflw)%id1(ientry)
877  n2 = this%flowbudptr%budterm(this%idxbudiflw)%id2(ientry)
878  qbnd = this%flowbudptr%budterm(this%idxbudiflw)%flow(ientry)
879  ctmp = this%tempiflw(n1)
880  if (present(rrate)) rrate = ctmp * qbnd * this%eqnsclfac
881  if (present(rhsval)) rhsval = -rrate
882  if (present(hcofval)) hcofval = dzero
883  !
884  ! -- Return
885  return
886  end subroutine sfe_iflw_term
887 
888  !> @brief Outflow term
889  !!
890  !! Accounts for the energy leaving a stream channel, for example, energy exiting the
891  !! model domain via a flow in a stream channel flowing out of the active domain.
892  !<
893  subroutine sfe_outf_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
894  ! -- dummy
895  class(gwesfetype) :: this
896  integer(I4B), intent(in) :: ientry
897  integer(I4B), intent(inout) :: n1
898  integer(I4B), intent(inout) :: n2
899  real(DP), intent(inout), optional :: rrate
900  real(DP), intent(inout), optional :: rhsval
901  real(DP), intent(inout), optional :: hcofval
902  ! -- local
903  real(DP) :: qbnd
904  real(DP) :: ctmp
905  !
906  n1 = this%flowbudptr%budterm(this%idxbudoutf)%id1(ientry)
907  n2 = this%flowbudptr%budterm(this%idxbudoutf)%id2(ientry)
908  qbnd = this%flowbudptr%budterm(this%idxbudoutf)%flow(ientry)
909  ctmp = this%xnewpak(n1)
910  if (present(rrate)) rrate = ctmp * qbnd * this%eqnsclfac
911  if (present(rhsval)) rhsval = dzero
912  if (present(hcofval)) hcofval = qbnd * this%eqnsclfac
913  !
914  ! -- Return
915  return
916  end subroutine sfe_outf_term
917 
918  !> @brief Observations
919  !!
920  !! Store the observation type supported by the APT package and override
921  !! BndType%bnd_df_obs
922  !<
923  subroutine sfe_df_obs(this)
924  ! -- modules
925  ! -- dummy
926  class(gwesfetype) :: this
927  ! -- local
928  integer(I4B) :: indx
929  !
930  ! -- Store obs type and assign procedure pointer
931  ! for temperature observation type.
932  call this%obs%StoreObsType('temperature', .false., indx)
933  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
934  !
935  ! -- Store obs type and assign procedure pointer
936  ! for flow between reaches.
937  call this%obs%StoreObsType('flow-ja-face', .true., indx)
938  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid12
939  !
940  ! -- Store obs type and assign procedure pointer
941  ! for from-mvr observation type.
942  call this%obs%StoreObsType('from-mvr', .true., indx)
943  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
944  !
945  ! -- Store obs type and assign procedure pointer
946  ! for to-mvr observation type.
947  call this%obs%StoreObsType('to-mvr', .true., indx)
948  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
949  !
950  ! -- Store obs type and assign procedure pointer
951  ! for storage observation type.
952  call this%obs%StoreObsType('storage', .true., indx)
953  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
954  !
955  ! -- Store obs type and assign procedure pointer
956  ! for constant observation type.
957  call this%obs%StoreObsType('constant', .true., indx)
958  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
959  !
960  ! -- Store obs type and assign procedure pointer
961  ! for observation type: sfe
962  call this%obs%StoreObsType('sfe', .true., indx)
963  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
964  !
965  ! -- Store obs type and assign procedure pointer
966  ! for rainfall observation type.
967  call this%obs%StoreObsType('rainfall', .true., indx)
968  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
969  !
970  ! -- Store obs type and assign procedure pointer
971  ! for evaporation observation type.
972  call this%obs%StoreObsType('evaporation', .true., indx)
973  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
974  !
975  ! -- Store obs type and assign procedure pointer
976  ! for runoff observation type.
977  call this%obs%StoreObsType('runoff', .true., indx)
978  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
979  !
980  ! -- Store obs type and assign procedure pointer
981  ! for inflow observation type.
982  call this%obs%StoreObsType('ext-inflow', .true., indx)
983  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
984  !
985  ! -- Store obs type and assign procedure pointer
986  ! for ext-outflow observation type.
987  call this%obs%StoreObsType('ext-outflow', .true., indx)
988  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
989  !
990  ! -- Return
991  return
992  end subroutine sfe_df_obs
993 
994  !> @brief Process package specific obs
995  !!
996  !! Method to process specific observations for this package.
997  !<
998  subroutine sfe_rp_obs(this, obsrv, found)
999  ! -- dummy
1000  class(gwesfetype), intent(inout) :: this !< package class
1001  type(observetype), intent(inout) :: obsrv !< observation object
1002  logical, intent(inout) :: found !< indicate whether observation was found
1003  ! -- local
1004  !
1005  found = .true.
1006  select case (obsrv%ObsTypeId)
1007  case ('RAINFALL')
1008  call this%rp_obs_byfeature(obsrv)
1009  case ('EVAPORATION')
1010  call this%rp_obs_byfeature(obsrv)
1011  case ('RUNOFF')
1012  call this%rp_obs_byfeature(obsrv)
1013  case ('EXT-INFLOW')
1014  call this%rp_obs_byfeature(obsrv)
1015  case ('EXT-OUTFLOW')
1016  call this%rp_obs_byfeature(obsrv)
1017  case ('TO-MVR')
1018  call this%rp_obs_byfeature(obsrv)
1019  case default
1020  found = .false.
1021  end select
1022  !
1023  ! -- Return
1024  return
1025  end subroutine sfe_rp_obs
1026 
1027  !> @brief Calculate observation value and pass it back to APT
1028  !<
1029  subroutine sfe_bd_obs(this, obstypeid, jj, v, found)
1030  ! -- dummy
1031  class(gwesfetype), intent(inout) :: this
1032  character(len=*), intent(in) :: obstypeid
1033  real(DP), intent(inout) :: v
1034  integer(I4B), intent(in) :: jj
1035  logical, intent(inout) :: found
1036  ! -- local
1037  integer(I4B) :: n1, n2
1038  !
1039  found = .true.
1040  select case (obstypeid)
1041  case ('RAINFALL')
1042  if (this%iboundpak(jj) /= 0) then
1043  call this%sfe_rain_term(jj, n1, n2, v)
1044  end if
1045  case ('EVAPORATION')
1046  if (this%iboundpak(jj) /= 0) then
1047  call this%sfe_evap_term(jj, n1, n2, v)
1048  end if
1049  case ('RUNOFF')
1050  if (this%iboundpak(jj) /= 0) then
1051  call this%sfe_roff_term(jj, n1, n2, v)
1052  end if
1053  case ('EXT-INFLOW')
1054  if (this%iboundpak(jj) /= 0) then
1055  call this%sfe_iflw_term(jj, n1, n2, v)
1056  end if
1057  case ('EXT-OUTFLOW')
1058  if (this%iboundpak(jj) /= 0) then
1059  call this%sfe_outf_term(jj, n1, n2, v)
1060  end if
1061  case default
1062  found = .false.
1063  end select
1064  !
1065  ! -- Return
1066  return
1067  end subroutine sfe_bd_obs
1068 
1069  !> @brief Sets the stress period attributes for keyword use.
1070  !<
1071  subroutine sfe_set_stressperiod(this, itemno, keyword, found)
1072  ! -- modules
1074  ! -- dummy
1075  class(gwesfetype), intent(inout) :: this
1076  integer(I4B), intent(in) :: itemno
1077  character(len=*), intent(in) :: keyword
1078  logical, intent(inout) :: found
1079  ! -- local
1080  character(len=LINELENGTH) :: text
1081  integer(I4B) :: ierr
1082  integer(I4B) :: jj
1083  real(DP), pointer :: bndElem => null()
1084  !
1085  ! RAINFALL <rainfall>
1086  ! EVAPORATION <evaporation>
1087  ! RUNOFF <runoff>
1088  ! INFLOW <inflow>
1089  ! WITHDRAWAL <withdrawal>
1090  !
1091  found = .true.
1092  select case (keyword)
1093  case ('RAINFALL')
1094  ierr = this%apt_check_valid(itemno)
1095  if (ierr /= 0) then
1096  goto 999
1097  end if
1098  call this%parser%GetString(text)
1099  jj = 1
1100  bndelem => this%temprain(itemno)
1101  call read_value_or_time_series_adv(text, itemno, jj, bndelem, &
1102  this%packName, 'BND', this%tsManager, &
1103  this%iprpak, 'RAINFALL')
1104  case ('EVAPORATION')
1105  ierr = this%apt_check_valid(itemno)
1106  if (ierr /= 0) then
1107  goto 999
1108  end if
1109  call this%parser%GetString(text)
1110  jj = 1
1111  bndelem => this%tempevap(itemno)
1112  call read_value_or_time_series_adv(text, itemno, jj, bndelem, &
1113  this%packName, 'BND', this%tsManager, &
1114  this%iprpak, 'EVAPORATION')
1115  case ('RUNOFF')
1116  ierr = this%apt_check_valid(itemno)
1117  if (ierr /= 0) then
1118  goto 999
1119  end if
1120  call this%parser%GetString(text)
1121  jj = 1
1122  bndelem => this%temproff(itemno)
1123  call read_value_or_time_series_adv(text, itemno, jj, bndelem, &
1124  this%packName, 'BND', this%tsManager, &
1125  this%iprpak, 'RUNOFF')
1126  case ('INFLOW')
1127  ierr = this%apt_check_valid(itemno)
1128  if (ierr /= 0) then
1129  goto 999
1130  end if
1131  call this%parser%GetString(text)
1132  jj = 1
1133  bndelem => this%tempiflw(itemno)
1134  call read_value_or_time_series_adv(text, itemno, jj, bndelem, &
1135  this%packName, 'BND', this%tsManager, &
1136  this%iprpak, 'INFLOW')
1137  case default
1138  !
1139  ! -- Keyword not recognized so return to caller with found = .false.
1140  found = .false.
1141  end select
1142  !
1143 999 continue
1144  !
1145  ! -- Return
1146  return
1147  end subroutine sfe_set_stressperiod
1148 
1149 end module gwesfemodule
This module contains the base boundary package.
class(bndtype) function, pointer, public getbndfromlist(list, idx)
Get boundary from package list.
This module contains simulation constants.
Definition: Constants.f90:9
integer(i4b), parameter linelength
maximum length of a standard line
Definition: Constants.f90:44
real(dp), parameter dzero
real constant zero
Definition: Constants.f90:64
integer(i4b), parameter lenbudtxt
maximum length of a budget component names
Definition: Constants.f90:36
real(dp), parameter done
real constant 1
Definition: Constants.f90:75
subroutine sfe_bd_obs(this, obstypeid, jj, v, found)
Calculate observation value and pass it back to APT.
Definition: gwe-sfe.f90:1030
character(len= *), parameter flowtype
Definition: gwe-sfe.f90:54
subroutine sfe_df_obs(this)
Observations.
Definition: gwe-sfe.f90:924
subroutine allocate_scalars(this)
Allocate scalars specific to the streamflow energy transport (SFE) package.
Definition: gwe-sfe.f90:685
subroutine sfe_setup_budobj(this, idx)
Set up the budget object that stores all the sfe flows.
Definition: gwe-sfe.f90:479
integer(i4b) function sfe_get_nbudterms(this)
Function to return the number of budget terms just for this package.
Definition: gwe-sfe.f90:458
subroutine sfe_outf_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
Outflow term.
Definition: gwe-sfe.f90:894
subroutine sfe_iflw_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
Inflow Term.
Definition: gwe-sfe.f90:864
subroutine sfe_set_stressperiod(this, itemno, keyword, found)
Sets the stress period attributes for keyword use.
Definition: gwe-sfe.f90:1072
character(len=16) text
Definition: gwe-sfe.f90:55
subroutine sfe_rp_obs(this, obsrv, found)
Process package specific obs.
Definition: gwe-sfe.f90:999
subroutine sfe_fill_budobj(this, idx, x, flowja, ccratin, ccratout)
Copy flow terms into thisbudobj.
Definition: gwe-sfe.f90:582
subroutine, public sfe_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, fmi, eqnsclfac, gwecommon, dvt, dvu, dvua)
Create a new sfe package.
Definition: gwe-sfe.f90:102
subroutine sfe_rain_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
Rain term.
Definition: gwe-sfe.f90:777
subroutine sfe_evap_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
Evaporative term.
Definition: gwe-sfe.f90:804
character(len= *), parameter ftype
Definition: gwe-sfe.f90:53
subroutine sfe_solve(this)
@ brief Add terms specific to sfr to the explicit sfe solve
Definition: gwe-sfe.f90:400
subroutine sfe_allocate_arrays(this)
Allocate arrays specific to the streamflow energy transport (SFE) package.
Definition: gwe-sfe.f90:717
subroutine sfe_roff_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
Runoff term.
Definition: gwe-sfe.f90:833
subroutine sfe_fc_expanded(this, rhs, ia, idxglo, matrix_sln)
Add matrix terms related to SFE.
Definition: gwe-sfe.f90:290
subroutine sfe_da(this)
Deallocate memory.
Definition: gwe-sfe.f90:748
subroutine find_sfe_package(this)
Find corresponding sfe package.
Definition: gwe-sfe.f90:165
This module defines variable data types.
Definition: kind.f90:8
This module contains the derived types ObserveType and ObsDataType.
Definition: Observe.f90:15
This module contains the SFR package methods.
Definition: gwf-sfr.f90:7
This module contains simulation methods.
Definition: Sim.f90:10
subroutine, public store_error(msg, terminate)
Store an error message.
Definition: Sim.f90:92
subroutine, public read_value_or_time_series_adv(textInput, ii, jj, bndElem, pkgName, auxOrBnd, tsManager, iprpak, varName)
Call this subroutine from advanced packages to define timeseries link for a variable (varName).
subroutine, public apt_process_obsid(obsrv, dis, inunitobs, iout)
Process observation IDs for an advanced package.
Definition: tsp-apt.f90:2998
subroutine, public apt_process_obsid12(obsrv, dis, inunitobs, iout)
Process observation IDs for a package.
Definition: tsp-apt.f90:3044
@ brief BndType
Data for sharing among multiple packages. Originally read in from.