MODFLOW 6  version 6.7.0.dev0
USGS Modular Hydrologic Model
gwe-mwe.f90
Go to the documentation of this file.
1 ! -- Multi-Aquifer Well Energy Transport Module
2 ! -- todo: save the mwe temperature into the mwe aux variable?
3 ! -- todo: calculate the maw DENSE aux variable using temperature?
4 !
5 ! MAW flows (flowbudptr) index var MWE term Transport Type
6 !---------------------------------------------------------------------------------
7 
8 ! -- terms from MAW that will be handled by parent APT Package
9 ! FLOW-JA-FACE idxbudfjf FLOW-JA-FACE cv2cv (note that this doesn't exist for MAW)
10 ! GWF (aux FLOW-AREA) idxbudgwf GWF cv2gwf
11 ! STORAGE (aux VOLUME) idxbudsto none used for cv volumes
12 ! FROM-MVR idxbudfmvr FROM-MVR q * text = this%qfrommvr(:)
13 ! TO-MVR idxbudtmvr TO-MVR q * tfeat
14 
15 ! -- MAW terms
16 ! RATE idxbudrate RATE q < 0: q * twell, else q * tuser
17 ! FW-RATE idxbudfwrt FW-RATE q * twell
18 ! RATE-TO-MVR idxbudrtmv RATE-TO-MVR q * twell
19 ! FW-RATE-TO-MVR idxbudfrtm FW-RATE-TO-MVR q * twell
20 ! WELL-AQUIFER CONDUCTION idxbudmwcd MW-CONDUCTION K_t_f * WetArea / thickness
21 
22 ! -- terms from MAW that should be skipped
23 ! CONSTANT-TO-MVR ? CONSTANT-TO-MVR q * twell
24 
25 ! -- terms from a flow file that should be skipped
26 ! CONSTANT none none none
27 ! AUXILIARY none none none
28 
29 ! -- terms that are written to the energy transport budget file
30 ! none none STORAGE (aux ENER) dE/dt
31 ! none none AUXILIARY none
32 ! none none CONSTANT accumulate
33 !
34 !
36 
37  use kindmodule, only: dp, i4b
39  use simvariablesmodule, only: errmsg
41  use bndmodule, only: bndtype, getbndfromlist
42  use tspfmimodule, only: tspfmitype
43  use mawmodule, only: mawtype
44  use observemodule, only: observetype
49 
50  implicit none
51 
52  public mwe_create
53 
54  character(len=*), parameter :: ftype = 'MWE'
55  character(len=*), parameter :: flowtype = 'MAW'
56  character(len=16) :: text = ' MWE'
57 
58  type, extends(tspapttype) :: gwemwetype
59 
60  type(gweinputdatatype), pointer :: gwecommon => null() !< pointer to shared gwe data used by multiple packages but set in mst
61 
62  integer(I4B), pointer :: idxbudrate => null() ! index of well rate terms in flowbudptr
63  integer(I4B), pointer :: idxbudfwrt => null() ! index of flowing well rate terms in flowbudptr
64  integer(I4B), pointer :: idxbudrtmv => null() ! index of rate to mover terms in flowbudptr
65  integer(I4B), pointer :: idxbudfrtm => null() ! index of flowing well rate to mover terms in flowbudptr
66  integer(I4B), pointer :: idxbudmwcd => null() ! index of well bore conduction terms in flowbudptr
67  real(dp), dimension(:), pointer, contiguous :: ktf => null() !< thermal conductivity between the sfe and groundwater cell
68  real(dp), dimension(:), pointer, contiguous :: rfeatthk => null() !< thickness of streambed material through which thermal conduction occurs
69  real(dp), dimension(:), pointer, contiguous :: temprate => null() ! well rate temperature
70 
71  contains
72 
73  procedure :: bnd_da => mwe_da
74  procedure :: allocate_scalars
75  procedure :: apt_allocate_arrays => mwe_allocate_arrays
76  procedure :: find_apt_package => find_mwe_package
77  procedure :: pak_fc_expanded => mwe_fc_expanded
78  procedure :: pak_solve => mwe_solve
79  procedure :: pak_get_nbudterms => mwe_get_nbudterms
80  procedure :: pak_setup_budobj => mwe_setup_budobj
81  procedure :: pak_fill_budobj => mwe_fill_budobj
82  procedure :: mwe_rate_term
83  procedure :: mwe_fwrt_term
84  procedure :: mwe_rtmv_term
85  procedure :: mwe_frtm_term
86  procedure :: pak_df_obs => mwe_df_obs
87  procedure :: pak_rp_obs => mwe_rp_obs
88  procedure :: pak_bd_obs => mwe_bd_obs
89  procedure :: pak_set_stressperiod => mwe_set_stressperiod
90  procedure :: apt_read_cvs => mwe_read_cvs
91 
92  end type gwemwetype
93 
94 contains
95 
96  !> Create new MWE package
97  !<
98  subroutine mwe_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, &
99  fmi, eqnsclfac, gwecommon, dvt, dvu, dvua)
100  ! -- dummy
101  class(bndtype), pointer :: packobj
102  integer(I4B), intent(in) :: id
103  integer(I4B), intent(in) :: ibcnum
104  integer(I4B), intent(in) :: inunit
105  integer(I4B), intent(in) :: iout
106  character(len=*), intent(in) :: namemodel
107  character(len=*), intent(in) :: pakname
108  type(tspfmitype), pointer :: fmi
109  real(dp), intent(in), pointer :: eqnsclfac !< governing equation scale factor
110  type(gweinputdatatype), intent(in), target :: gwecommon !< shared data container for use by multiple GWE packages
111  character(len=*), intent(in) :: dvt !< For GWE, set to "TEMPERATURE" in TspAptType
112  character(len=*), intent(in) :: dvu !< For GWE, set to "energy" in TspAptType
113  character(len=*), intent(in) :: dvua !< For GWE, set to "E" in TspAptType
114  ! -- local
115  type(gwemwetype), pointer :: mweobj
116  !
117  ! -- Allocate the object and assign values to object variables
118  allocate (mweobj)
119  packobj => mweobj
120  !
121  ! -- Create name and memory path
122  call packobj%set_names(ibcnum, namemodel, pakname, ftype)
123  packobj%text = text
124  !
125  ! -- Allocate scalars
126  call mweobj%allocate_scalars()
127  !
128  ! -- Initialize package
129  call packobj%pack_initialize()
130  !
131  packobj%inunit = inunit
132  packobj%iout = iout
133  packobj%id = id
134  packobj%ibcnum = ibcnum
135  packobj%ncolbnd = 1
136  packobj%iscloc = 1
137  !
138  ! -- Store pointer to flow model interface. When the GwfGwe exchange is
139  ! created, it sets fmi%bndlist so that the GWE model has access to all
140  ! the flow packages
141  mweobj%fmi => fmi
142  !
143  ! -- Store pointer to governing equation scale factor
144  mweobj%eqnsclfac => eqnsclfac
145  !
146  ! -- Store pointer to shared data module for accessing cpw, rhow
147  ! for the budget calculations, and for accessing the latent heat of
148  ! vaporization for evaporative cooling.
149  mweobj%gwecommon => gwecommon
150  !
151  ! -- Set labels that will be used in generalized APT class
152  mweobj%depvartype = dvt
153  mweobj%depvarunit = dvu
154  mweobj%depvarunitabbrev = dvua
155  end subroutine mwe_create
156 
157  !> @brief Find corresponding mwe package
158  !<
159  subroutine find_mwe_package(this)
160  ! -- modules
162  ! -- dummy
163  class(gwemwetype) :: this
164  ! -- local
165  character(len=LINELENGTH) :: errmsg
166  class(bndtype), pointer :: packobj
167  integer(I4B) :: ip, icount
168  integer(I4B) :: nbudterm
169  logical :: found
170  !
171  ! -- Initialize found to false, and error later if flow package cannot
172  ! be found
173  found = .false.
174  !
175  ! -- If user is specifying flows in a binary budget file, then set up
176  ! the budget file reader, otherwise set a pointer to the flow package
177  ! budobj
178  if (this%fmi%flows_from_file) then
179  call this%fmi%set_aptbudobj_pointer(this%flowpackagename, this%flowbudptr)
180  if (associated(this%flowbudptr)) found = .true.
181  !
182  else
183  if (associated(this%fmi%gwfbndlist)) then
184  ! -- Look through gwfbndlist for a flow package with the same name as
185  ! this transport package name
186  do ip = 1, this%fmi%gwfbndlist%Count()
187  packobj => getbndfromlist(this%fmi%gwfbndlist, ip)
188  if (packobj%packName == this%flowpackagename) then
189  found = .true.
190  !
191  ! -- Store BndType pointer to packobj, and then
192  ! use the select type to point to the budobj in flow package
193  this%flowpackagebnd => packobj
194  select type (packobj)
195  type is (mawtype)
196  this%flowbudptr => packobj%budobj
197  end select
198  end if
199  if (found) exit
200  end do
201  end if
202  end if
203  !
204  ! -- Error if flow package not found
205  if (.not. found) then
206  write (errmsg, '(a)') 'Could not find flow package with name '&
207  &//trim(adjustl(this%flowpackagename))//'.'
208  call store_error(errmsg)
209  call this%parser%StoreErrorUnit()
210  end if
211  !
212  ! -- Allocate space for idxbudssm, which indicates whether this is a
213  ! special budget term or one that is a general source and sink
214  nbudterm = this%flowbudptr%nbudterm
215  call mem_allocate(this%idxbudssm, nbudterm, 'IDXBUDSSM', this%memoryPath)
216  !
217  ! -- Process budget terms and identify special budget terms
218  write (this%iout, '(/, a, a)') &
219  'PROCESSING '//ftype//' INFORMATION FOR ', this%packName
220  write (this%iout, '(a)') ' IDENTIFYING FLOW TERMS IN '//flowtype//' PACKAGE'
221  write (this%iout, '(a, i0)') &
222  ' NUMBER OF '//flowtype//' = ', this%flowbudptr%ncv
223  icount = 1
224  do ip = 1, this%flowbudptr%nbudterm
225  select case (trim(adjustl(this%flowbudptr%budterm(ip)%flowtype)))
226  case ('FLOW-JA-FACE')
227  this%idxbudfjf = ip
228  this%idxbudssm(ip) = 0
229  case ('GWF')
230  this%idxbudgwf = ip
231  this%idxbudssm(ip) = 0
232  case ('STORAGE')
233  this%idxbudsto = ip
234  this%idxbudssm(ip) = 0
235  case ('RATE')
236  this%idxbudrate = ip
237  this%idxbudssm(ip) = 0
238  case ('FW-RATE')
239  this%idxbudfwrt = ip
240  this%idxbudssm(ip) = 0
241  case ('RATE-TO-MVR')
242  this%idxbudrtmv = ip
243  this%idxbudssm(ip) = 0
244  case ('FW-RATE-TO-MVR')
245  this%idxbudfrtm = ip
246  this%idxbudssm(ip) = 0
247  case ('TO-MVR')
248  this%idxbudtmvr = ip
249  this%idxbudssm(ip) = 0
250  case ('FROM-MVR')
251  this%idxbudfmvr = ip
252  this%idxbudssm(ip) = 0
253  case ('AUXILIARY')
254  this%idxbudaux = ip
255  this%idxbudssm(ip) = 0
256  case default
257  !
258  ! -- Set idxbudssm equal to a column index for where the temperatures
259  ! are stored in the tempbud(nbudssm, ncv) array
260  this%idxbudssm(ip) = icount
261  icount = icount + 1
262  end select
263  write (this%iout, '(a, i0, " = ", a,/, a, i0)') &
264  ' TERM ', ip, trim(adjustl(this%flowbudptr%budterm(ip)%flowtype)), &
265  ' MAX NO. OF ENTRIES = ', this%flowbudptr%budterm(ip)%maxlist
266  end do
267  write (this%iout, '(a, //)') 'DONE PROCESSING '//ftype//' INFORMATION'
268  !
269  ! -- Streambed conduction term
270  this%idxbudmwcd = this%idxbudgwf
271  end subroutine find_mwe_package
272 
273  !> @brief Add matrix terms related to MWE
274  !!
275  !! This routine is called from TspAptType%apt_fc_expanded() in
276  !! order to add matrix terms specifically for MWE
277  !<
278  subroutine mwe_fc_expanded(this, rhs, ia, idxglo, matrix_sln)
279  ! -- dummy
280  class(gwemwetype) :: this
281  real(DP), dimension(:), intent(inout) :: rhs
282  integer(I4B), dimension(:), intent(in) :: ia
283  integer(I4B), dimension(:), intent(in) :: idxglo
284  class(matrixbasetype), pointer :: matrix_sln
285  ! -- local
286  integer(I4B) :: j, n, n1, n2
287  integer(I4B) :: iloc
288  integer(I4B) :: iposd, iposoffd
289  integer(I4B) :: ipossymd, ipossymoffd
290  integer(I4B) :: auxpos
291  real(DP) :: rrate
292  real(DP) :: rhsval
293  real(DP) :: hcofval
294  real(DP) :: ctherm ! kluge?
295  real(DP) :: wa !< wetted area
296  real(DP) :: ktf !< thermal conductivity of streambed material
297  real(DP) :: s !< thickness of conductive wellbore material
298  !
299  ! -- Add puping rate contribution
300  if (this%idxbudrate /= 0) then
301  do j = 1, this%flowbudptr%budterm(this%idxbudrate)%nlist
302  call this%mwe_rate_term(j, n1, n2, rrate, rhsval, hcofval)
303  iloc = this%idxlocnode(n1)
304  iposd = this%idxpakdiag(n1)
305  call matrix_sln%add_value_pos(iposd, hcofval)
306  rhs(iloc) = rhs(iloc) + rhsval
307  end do
308  end if
309  !
310  ! -- Add flowing well rate contribution
311  if (this%idxbudfwrt /= 0) then
312  do j = 1, this%flowbudptr%budterm(this%idxbudfwrt)%nlist
313  call this%mwe_fwrt_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 rate to mover contribution
322  if (this%idxbudrtmv /= 0) then
323  do j = 1, this%flowbudptr%budterm(this%idxbudrtmv)%nlist
324  call this%mwe_rtmv_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 puping rate contribution
333  if (this%idxbudfrtm /= 0) then
334  do j = 1, this%flowbudptr%budterm(this%idxbudfrtm)%nlist
335  call this%mwe_frtm_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 wellbore conduction contribution
344  do j = 1, this%flowbudptr%budterm(this%idxbudgwf)%nlist
345  !
346  ! -- Set n to feature number and process if active features
347  n = this%flowbudptr%budterm(this%idxbudgwf)%id1(j)
348  if (this%iboundpak(n) /= 0) then
349  !
350  ! -- Set acoef and rhs to negative so they are relative to mwe and not gwe
351  auxpos = this%flowbudptr%budterm(this%idxbudgwf)%naux
352  wa = this%flowbudptr%budterm(this%idxbudgwf)%auxvar(auxpos, j)
353  ktf = this%ktf(n)
354  s = this%rfeatthk(n)
355  ctherm = ktf * wa / s
356  !
357  ! -- Add to mwe row
358  iposd = this%idxdglo(j)
359  iposoffd = this%idxoffdglo(j)
360  call matrix_sln%add_value_pos(iposd, -ctherm) ! kluge note: make sure the signs on ctherm are correct here and below
361  call matrix_sln%add_value_pos(iposoffd, ctherm)
362  !
363  ! -- Add to gwe row for mwe connection
364  ipossymd = this%idxsymdglo(j)
365  ipossymoffd = this%idxsymoffdglo(j)
366  call matrix_sln%add_value_pos(ipossymd, -ctherm)
367  call matrix_sln%add_value_pos(ipossymoffd, ctherm)
368  end if
369  end do
370  end subroutine mwe_fc_expanded
371 
372  !> @brief Add terms specific to multi-aquifer wells to the explicit multi-
373  !! aquifer well energy transport solve
374  !<
375  subroutine mwe_solve(this)
376  ! -- dummy
377  class(gwemwetype) :: this
378  ! -- local
379  integer(I4B) :: j
380  integer(I4B) :: n1, n2
381  real(DP) :: rrate
382  !
383  ! -- Add well pumping contribution
384  if (this%idxbudrate /= 0) then
385  do j = 1, this%flowbudptr%budterm(this%idxbudrate)%nlist
386  call this%mwe_rate_term(j, n1, n2, rrate)
387  this%dbuff(n1) = this%dbuff(n1) + rrate
388  end do
389  end if
390  !
391  ! -- Add flowing well rate contribution
392  if (this%idxbudfwrt /= 0) then
393  do j = 1, this%flowbudptr%budterm(this%idxbudfwrt)%nlist
394  call this%mwe_fwrt_term(j, n1, n2, rrate)
395  this%dbuff(n1) = this%dbuff(n1) + rrate
396  end do
397  end if
398  !
399  ! -- Add well pumping rate to mover contribution
400  if (this%idxbudrtmv /= 0) then
401  do j = 1, this%flowbudptr%budterm(this%idxbudrtmv)%nlist
402  call this%mwe_rtmv_term(j, n1, n2, rrate)
403  this%dbuff(n1) = this%dbuff(n1) + rrate
404  end do
405  end if
406  !
407  ! -- Add flowing well rate to mover contribution
408  if (this%idxbudfrtm /= 0) then
409  do j = 1, this%flowbudptr%budterm(this%idxbudfrtm)%nlist
410  call this%mwe_frtm_term(j, n1, n2, rrate)
411  this%dbuff(n1) = this%dbuff(n1) + rrate
412  end do
413  end if
414  end subroutine mwe_solve
415 
416  !> @brief Function to return the number of budget terms just for this package
417  !!
418  !! This overrides a function in the parent class.
419  !<
420  function mwe_get_nbudterms(this) result(nbudterms)
421  ! -- dummy
422  class(gwemwetype) :: this
423  ! -- return
424  integer(I4B) :: nbudterms
425  !
426  ! -- Number of potential budget terms is 5
427  nbudterms = 1 ! RATE
428  if (this%idxbudfwrt /= 0) nbudterms = nbudterms + 1
429  if (this%idxbudrtmv /= 0) nbudterms = nbudterms + 1
430  if (this%idxbudfrtm /= 0) nbudterms = nbudterms + 1
431  if (this%idxbudmwcd /= 0) nbudterms = nbudterms + 1
432  end function mwe_get_nbudterms
433 
434  !> @brief Set up the budget object that stores all the mwe flows
435  !<
436  subroutine mwe_setup_budobj(this, idx)
437  ! -- modules
438  use constantsmodule, only: lenbudtxt
439  ! -- dummy
440  class(gwemwetype) :: this
441  integer(I4B), intent(inout) :: idx
442  ! -- local
443  integer(I4B) :: n, n1, n2
444  integer(I4B) :: maxlist, naux
445  real(DP) :: q
446  character(len=LENBUDTXT) :: text
447  !
448  ! -- User-specified rate
449  text = ' RATE'
450  idx = idx + 1
451  maxlist = this%flowbudptr%budterm(this%idxbudrate)%maxlist
452  naux = 0
453  call this%budobj%budterm(idx)%initialize(text, &
454  this%name_model, &
455  this%packName, &
456  this%name_model, &
457  this%packName, &
458  maxlist, .false., .false., &
459  naux)
460  !
461  ! -- Flowing well rate
462  if (this%idxbudfwrt /= 0) then
463  text = ' FW-RATE'
464  idx = idx + 1
465  maxlist = this%flowbudptr%budterm(this%idxbudfwrt)%maxlist
466  naux = 0
467  call this%budobj%budterm(idx)%initialize(text, &
468  this%name_model, &
469  this%packName, &
470  this%name_model, &
471  this%packName, &
472  maxlist, .false., .false., &
473  naux)
474  end if
475  !
476  ! -- User-specified flow rate to mover
477  if (this%idxbudrtmv /= 0) then
478  text = ' RATE-TO-MVR'
479  idx = idx + 1
480  maxlist = this%flowbudptr%budterm(this%idxbudrtmv)%maxlist
481  naux = 0
482  call this%budobj%budterm(idx)%initialize(text, &
483  this%name_model, &
484  this%packName, &
485  this%name_model, &
486  this%packName, &
487  maxlist, .false., .false., &
488  naux)
489  end if
490  !
491  ! -- Fflowing well rate to mover
492  if (this%idxbudfrtm /= 0) then
493  text = ' FW-RATE-TO-MVR'
494  idx = idx + 1
495  maxlist = this%flowbudptr%budterm(this%idxbudfrtm)%maxlist
496  naux = 0
497  call this%budobj%budterm(idx)%initialize(text, &
498  this%name_model, &
499  this%packName, &
500  this%name_model, &
501  this%packName, &
502  maxlist, .false., .false., &
503  naux)
504  end if
505  !
506  ! -- Conduction through wellbore (and/or filter pack)
507  text = ' WELLBORE-COND'
508  idx = idx + 1
509  maxlist = this%flowbudptr%budterm(this%idxbudmwcd)%maxlist
510  naux = 0
511  call this%budobj%budterm(idx)%initialize(text, &
512  this%name_model, &
513  this%packName, &
514  this%name_model, &
515  this%packName, &
516  maxlist, .false., .false., &
517  naux)
518  call this%budobj%budterm(idx)%reset(maxlist)
519  q = dzero
520  do n = 1, maxlist
521  n1 = this%flowbudptr%budterm(this%idxbudgwf)%id1(n)
522  n2 = this%flowbudptr%budterm(this%idxbudgwf)%id2(n)
523  call this%budobj%budterm(idx)%update_term(n1, n2, q)
524  end do
525  end subroutine mwe_setup_budobj
526 
527  !> @brief Copy flow terms into this%budobj
528  !<
529  subroutine mwe_fill_budobj(this, idx, x, flowja, ccratin, ccratout)
530  ! -- dummy
531  class(gwemwetype) :: this
532  integer(I4B), intent(inout) :: idx
533  real(DP), dimension(:), intent(in) :: x
534  real(DP), dimension(:), contiguous, intent(inout) :: flowja
535  real(DP), intent(inout) :: ccratin
536  real(DP), intent(inout) :: ccratout
537  ! -- local
538  integer(I4B) :: j, n1, n2
539  integer(I4B) :: nlist
540  integer(I4B) :: igwfnode
541  integer(I4B) :: idiag
542  integer(I4B) :: auxpos
543  real(DP) :: q
544  real(DP) :: ctherm
545  real(DP) :: wa !< wetted area
546  real(DP) :: ktf !< thermal conductivity of streambed material
547  real(DP) :: s !< thickness of conductive streambed materia
548  !
549  ! -- Rate
550  idx = idx + 1
551  nlist = this%flowbudptr%budterm(this%idxbudrate)%nlist
552  call this%budobj%budterm(idx)%reset(nlist)
553  do j = 1, nlist
554  call this%mwe_rate_term(j, n1, n2, q)
555  call this%budobj%budterm(idx)%update_term(n1, n2, q)
556  call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
557  end do
558  !
559  ! -- FW-Rate
560  if (this%idxbudfwrt /= 0) then
561  idx = idx + 1
562  nlist = this%flowbudptr%budterm(this%idxbudfwrt)%nlist
563  call this%budobj%budterm(idx)%reset(nlist)
564  do j = 1, nlist
565  call this%mwe_fwrt_term(j, n1, n2, q)
566  call this%budobj%budterm(idx)%update_term(n1, n2, q)
567  call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
568  end do
569  end if
570  !
571  ! -- Rate-To-MVR
572  if (this%idxbudrtmv /= 0) then
573  idx = idx + 1
574  nlist = this%flowbudptr%budterm(this%idxbudrtmv)%nlist
575  call this%budobj%budterm(idx)%reset(nlist)
576  do j = 1, nlist
577  call this%mwe_rtmv_term(j, n1, n2, q)
578  call this%budobj%budterm(idx)%update_term(n1, n2, q)
579  call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
580  end do
581  end if
582  !
583  ! -- FW-Rate-To-MVR
584  if (this%idxbudfrtm /= 0) then
585  idx = idx + 1
586  nlist = this%flowbudptr%budterm(this%idxbudfrtm)%nlist
587  call this%budobj%budterm(idx)%reset(nlist)
588  do j = 1, nlist
589  call this%mwe_frtm_term(j, n1, n2, q)
590  call this%budobj%budterm(idx)%update_term(n1, n2, q)
591  call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
592  end do
593  end if
594  !
595  ! -- Wellbore-Cond
596  idx = idx + 1
597  call this%budobj%budterm(idx)%reset(this%maxbound)
598  do j = 1, this%flowbudptr%budterm(this%idxbudmwcd)%nlist
599  q = dzero
600  n1 = this%flowbudptr%budterm(this%idxbudmwcd)%id1(j)
601  if (this%iboundpak(n1) /= 0) then
602  igwfnode = this%flowbudptr%budterm(this%idxbudmwcd)%id2(j)
603  auxpos = this%flowbudptr%budterm(this%idxbudgwf)%naux
604  wa = this%flowbudptr%budterm(this%idxbudgwf)%auxvar(auxpos, j)
605  ktf = this%ktf(n1)
606  s = this%rfeatthk(n1)
607  ctherm = ktf * wa / s
608  q = ctherm * (x(igwfnode) - this%xnewpak(n1))
609  end if
610  call this%budobj%budterm(idx)%update_term(n1, igwfnode, q)
611  call this%apt_accumulate_ccterm(n1, q, ccratin, ccratout)
612  if (this%iboundpak(n1) /= 0) then
613  ! -- Contribution to gwe cell budget
614  this%simvals(j) = this%simvals(j) - q
615  idiag = this%dis%con%ia(igwfnode)
616  flowja(idiag) = flowja(idiag) - q
617  end if
618  end do
619  end subroutine mwe_fill_budobj
620 
621  !> @brief Allocate scalars specific to the multi-aquifer well energy
622  !! transport (MWE) package.
623  !<
624  subroutine allocate_scalars(this)
625  ! -- modules
627  ! -- dummy
628  class(gwemwetype) :: this
629  !
630  ! -- Allocate scalars in TspAptType
631  call this%TspAptType%allocate_scalars()
632  !
633  ! -- Allocate
634  call mem_allocate(this%idxbudrate, 'IDXBUDRATE', this%memoryPath)
635  call mem_allocate(this%idxbudfwrt, 'IDXBUDFWRT', this%memoryPath)
636  call mem_allocate(this%idxbudrtmv, 'IDXBUDRTMV', this%memoryPath)
637  call mem_allocate(this%idxbudfrtm, 'IDXBUDFRTM', this%memoryPath)
638  call mem_allocate(this%idxbudmwcd, 'IDXBUDMWCD', this%memoryPath)
639  !
640  ! -- Initialize
641  this%idxbudrate = 0
642  this%idxbudfwrt = 0
643  this%idxbudrtmv = 0
644  this%idxbudfrtm = 0
645  this%idxbudmwcd = 0
646  end subroutine allocate_scalars
647 
648  !> @brief Allocate arrays specific to the streamflow mass transport (SFT)
649  !! package
650  !<
651  subroutine mwe_allocate_arrays(this)
652  ! -- modules
654  ! -- dummy
655  class(gwemwetype), intent(inout) :: this
656  ! -- local
657  integer(I4B) :: n
658  !
659  ! -- Time series
660  call mem_allocate(this%temprate, this%ncv, 'TEMPRATE', this%memoryPath)
661  !
662  ! -- Call standard TspAptType allocate arrays
663  call this%TspAptType%apt_allocate_arrays()
664  !
665  ! -- Initialize
666  do n = 1, this%ncv
667  this%temprate(n) = dzero
668  end do
669  end subroutine mwe_allocate_arrays
670 
671  !> @brief Deallocate memory associated with MWE package
672  !<
673  subroutine mwe_da(this)
674  ! -- modules
676  ! -- dummy
677  class(gwemwetype) :: this
678  !
679  ! -- Deallocate scalars
680  call mem_deallocate(this%idxbudrate)
681  call mem_deallocate(this%idxbudfwrt)
682  call mem_deallocate(this%idxbudrtmv)
683  call mem_deallocate(this%idxbudfrtm)
684  call mem_deallocate(this%idxbudmwcd)
685  !
686  ! -- Deallocate time series
687  call mem_deallocate(this%temprate)
688  !
689  ! -- Deallocate arrays
690  call mem_deallocate(this%ktf)
691  call mem_deallocate(this%rfeatthk)
692  !
693  ! -- Deallocate scalars in TspAptType
694  call this%TspAptType%bnd_da()
695  end subroutine mwe_da
696 
697  !> @brief Thermal transport matrix term(s) associated with a user-specified
698  !! flow rate (mwe_rate_term)
699  !<
700  subroutine mwe_rate_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
701  ! -- dummy
702  class(gwemwetype) :: this
703  integer(I4B), intent(in) :: ientry
704  integer(I4B), intent(inout) :: n1
705  integer(I4B), intent(inout) :: n2
706  real(DP), intent(inout), optional :: rrate
707  real(DP), intent(inout), optional :: rhsval
708  real(DP), intent(inout), optional :: hcofval
709  ! -- local
710  real(DP) :: qbnd
711  real(DP) :: ctmp
712  real(DP) :: h, r
713  !
714  n1 = this%flowbudptr%budterm(this%idxbudrate)%id1(ientry)
715  n2 = this%flowbudptr%budterm(this%idxbudrate)%id2(ientry)
716  ! -- Note that qbnd is negative for an extracting well
717  qbnd = this%flowbudptr%budterm(this%idxbudrate)%flow(ientry)
718  if (qbnd < dzero) then
719  ctmp = this%xnewpak(n1)
720  h = qbnd
721  r = dzero
722  else
723  ctmp = this%temprate(n1)
724  h = dzero
725  r = -qbnd * ctmp
726  end if
727  if (present(rrate)) rrate = qbnd * ctmp * this%eqnsclfac
728  if (present(rhsval)) rhsval = r * this%eqnsclfac
729  if (present(hcofval)) hcofval = h * this%eqnsclfac
730  end subroutine mwe_rate_term
731 
732  !> @brief Thermal transport matrix term(s) associated with a flowing-
733  !! well rate term associated with pumping (or injection)
734  !<
735  subroutine mwe_fwrt_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
736  ! -- dummy
737  class(gwemwetype) :: this
738  integer(I4B), intent(in) :: ientry
739  integer(I4B), intent(inout) :: n1
740  integer(I4B), intent(inout) :: n2
741  real(DP), intent(inout), optional :: rrate
742  real(DP), intent(inout), optional :: rhsval
743  real(DP), intent(inout), optional :: hcofval
744  ! -- local
745  real(DP) :: qbnd
746  real(DP) :: ctmp
747  !
748  n1 = this%flowbudptr%budterm(this%idxbudfwrt)%id1(ientry)
749  n2 = this%flowbudptr%budterm(this%idxbudfwrt)%id2(ientry)
750  qbnd = this%flowbudptr%budterm(this%idxbudfwrt)%flow(ientry)
751  ctmp = this%xnewpak(n1)
752  if (present(rrate)) rrate = ctmp * qbnd * this%eqnsclfac
753  if (present(rhsval)) rhsval = dzero
754  if (present(hcofval)) hcofval = qbnd * this%eqnsclfac
755  end subroutine mwe_fwrt_term
756 
757  !> @brief Thermal transport matrix term(s) associated with pumped-water-
758  !! to-mover term (mwe_rtmv_term)
759  !<
760  subroutine mwe_rtmv_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
761  ! -- dummy
762  class(gwemwetype) :: this
763  integer(I4B), intent(in) :: ientry
764  integer(I4B), intent(inout) :: n1
765  integer(I4B), intent(inout) :: n2
766  real(DP), intent(inout), optional :: rrate
767  real(DP), intent(inout), optional :: rhsval
768  real(DP), intent(inout), optional :: hcofval
769  ! -- local
770  real(DP) :: qbnd
771  real(DP) :: ctmp
772  !
773  n1 = this%flowbudptr%budterm(this%idxbudrtmv)%id1(ientry)
774  n2 = this%flowbudptr%budterm(this%idxbudrtmv)%id2(ientry)
775  qbnd = this%flowbudptr%budterm(this%idxbudrtmv)%flow(ientry)
776  ctmp = this%xnewpak(n1)
777  if (present(rrate)) rrate = ctmp * qbnd * this%eqnsclfac
778  if (present(rhsval)) rhsval = dzero
779  if (present(hcofval)) hcofval = qbnd * this%eqnsclfac
780  end subroutine mwe_rtmv_term
781 
782  !> @brief Thermal transport matrix term(s) associated with the flowing-
783  !! well-rate-to-mover term (mwe_frtm_term)
784  !<
785  subroutine mwe_frtm_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
786  ! -- dummy
787  class(gwemwetype) :: this
788  integer(I4B), intent(in) :: ientry
789  integer(I4B), intent(inout) :: n1
790  integer(I4B), intent(inout) :: n2
791  real(DP), intent(inout), optional :: rrate
792  real(DP), intent(inout), optional :: rhsval
793  real(DP), intent(inout), optional :: hcofval
794  ! -- local
795  real(DP) :: qbnd
796  real(DP) :: ctmp
797  !
798  n1 = this%flowbudptr%budterm(this%idxbudfrtm)%id1(ientry)
799  n2 = this%flowbudptr%budterm(this%idxbudfrtm)%id2(ientry)
800  qbnd = this%flowbudptr%budterm(this%idxbudfrtm)%flow(ientry)
801  ctmp = this%xnewpak(n1)
802  if (present(rrate)) rrate = ctmp * qbnd * this%eqnsclfac
803  if (present(rhsval)) rhsval = dzero
804  if (present(hcofval)) hcofval = qbnd * this%eqnsclfac
805  end subroutine mwe_frtm_term
806 
807  !> @brief Observations
808  !!
809  !! Store the observation type supported by the APT package and override
810  !! BndType%bnd_df_obs
811  !<
812  subroutine mwe_df_obs(this)
813  ! -- dummy
814  class(gwemwetype) :: this
815  ! -- local
816  integer(I4B) :: indx
817  !
818  ! -- Store obs type and assign procedure pointer
819  ! for temperature observation type.
820  call this%obs%StoreObsType('temperature', .false., indx)
821  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
822  !
823  ! -- Flow-ja-face not supported for MWE
824  !call this%obs%StoreObsType('flow-ja-face', .true., indx)
825  !this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsID
826  !
827  ! -- Store obs type and assign procedure pointer
828  ! for from-mvr observation type.
829  call this%obs%StoreObsType('from-mvr', .true., indx)
830  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
831  !
832  ! -- To-mvr not supported for mwe
833  !call this%obs%StoreObsType('to-mvr', .true., indx)
834  !this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsID
835  !
836  ! -- Store obs type and assign procedure pointer
837  ! for storage observation type.
838  call this%obs%StoreObsType('storage', .true., indx)
839  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
840  !
841  ! -- Store obs type and assign procedure pointer
842  ! for constant observation type.
843  call this%obs%StoreObsType('constant', .true., indx)
844  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
845  !
846  ! -- Store obs type and assign procedure pointer
847  ! for observation type: mwe
848  call this%obs%StoreObsType('mwe', .true., indx)
849  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid12
850  !
851  ! -- Store obs type and assign procedure pointer
852  ! for rate observation type.
853  call this%obs%StoreObsType('rate', .true., indx)
854  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
855  !
856  ! -- Store obs type and assign procedure pointer
857  ! for observation type.
858  call this%obs%StoreObsType('fw-rate', .true., indx)
859  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
860  !
861  ! -- Store obs type and assign procedure pointer
862  ! for observation type.
863  call this%obs%StoreObsType('rate-to-mvr', .true., indx)
864  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
865  !
866  ! -- Store obs type and assign procedure pointer
867  ! for observation type.
868  call this%obs%StoreObsType('fw-rate-to-mvr', .true., indx)
869  this%obs%obsData(indx)%ProcessIdPtr => apt_process_obsid
870  end subroutine mwe_df_obs
871 
872  !> @brief Process package specific obs
873  !!
874  !! Method to process specific observations for this package.
875  !<
876  subroutine mwe_rp_obs(this, obsrv, found)
877  ! -- dummy
878  class(gwemwetype), intent(inout) :: this !< package class
879  type(observetype), intent(inout) :: obsrv !< observation object
880  logical, intent(inout) :: found !< indicate whether observation was found
881  !
882  found = .true.
883  select case (obsrv%ObsTypeId)
884  case ('RATE')
885  call this%rp_obs_byfeature(obsrv)
886  case ('FW-RATE')
887  call this%rp_obs_byfeature(obsrv)
888  case ('RATE-TO-MVR')
889  call this%rp_obs_byfeature(obsrv)
890  case ('FW-RATE-TO-MVR')
891  call this%rp_obs_byfeature(obsrv)
892  case default
893  found = .false.
894  end select
895  end subroutine mwe_rp_obs
896 
897  !> @brief Calculate observation value and pass it back to APT
898  !<
899  subroutine mwe_bd_obs(this, obstypeid, jj, v, found)
900  ! -- dummy
901  class(gwemwetype), intent(inout) :: this
902  character(len=*), intent(in) :: obstypeid
903  real(DP), intent(inout) :: v
904  integer(I4B), intent(in) :: jj
905  logical, intent(inout) :: found
906  ! -- local
907  integer(I4B) :: n1, n2
908  !
909  found = .true.
910  select case (obstypeid)
911  case ('RATE')
912  if (this%iboundpak(jj) /= 0) then
913  call this%mwe_rate_term(jj, n1, n2, v)
914  end if
915  case ('FW-RATE')
916  if (this%iboundpak(jj) /= 0 .and. this%idxbudfwrt > 0) then
917  call this%mwe_fwrt_term(jj, n1, n2, v)
918  end if
919  case ('RATE-TO-MVR')
920  if (this%iboundpak(jj) /= 0 .and. this%idxbudrtmv > 0) then
921  call this%mwe_rtmv_term(jj, n1, n2, v)
922  end if
923  case ('FW-RATE-TO-MVR')
924  if (this%iboundpak(jj) /= 0 .and. this%idxbudfrtm > 0) then
925  call this%mwe_frtm_term(jj, n1, n2, v)
926  end if
927  case default
928  found = .false.
929  end select
930  end subroutine mwe_bd_obs
931 
932  !> @brief Sets the stress period attributes for keyword use.
933  !<
934  subroutine mwe_set_stressperiod(this, itemno, keyword, found)
935  ! -- modules
937  ! -- dummy
938  class(gwemwetype), intent(inout) :: this
939  integer(I4B), intent(in) :: itemno
940  character(len=*), intent(in) :: keyword
941  logical, intent(inout) :: found
942  ! -- local
943  character(len=LINELENGTH) :: text
944  integer(I4B) :: ierr
945  integer(I4B) :: jj
946  real(DP), pointer :: bndElem => null()
947  !
948  ! RATE <rate>
949  !
950  found = .true.
951  select case (keyword)
952  case ('RATE')
953  ierr = this%apt_check_valid(itemno)
954  if (ierr /= 0) then
955  goto 999
956  end if
957  call this%parser%GetString(text)
958  jj = 1
959  bndelem => this%temprate(itemno)
960  call read_value_or_time_series_adv(text, itemno, jj, bndelem, &
961  this%packName, 'BND', this%tsManager, &
962  this%iprpak, 'RATE')
963  case default
964  !
965  ! -- Keyword not recognized so return to caller with found = .false.
966  found = .false.
967  end select
968  !
969 999 continue
970  end subroutine mwe_set_stressperiod
971 
972  !> @brief Read feature information for this advanced package
973  !<
974  subroutine mwe_read_cvs(this)
975  ! -- modules
978  ! -- dummy
979  class(gwemwetype), intent(inout) :: this
980  ! -- local
981  character(len=LINELENGTH) :: text
982  character(len=LENBOUNDNAME) :: bndName, bndNameTemp
983  character(len=9) :: cno
984  character(len=50), dimension(:), allocatable :: caux
985  integer(I4B) :: ierr
986  logical :: isfound, endOfBlock
987  integer(I4B) :: n
988  integer(I4B) :: ii, jj
989  integer(I4B) :: iaux
990  integer(I4B) :: itmp
991  integer(I4B) :: nlak
992  integer(I4B) :: nconn
993  integer(I4B), dimension(:), pointer, contiguous :: nboundchk
994  real(DP), pointer :: bndElem => null()
995  !
996  ! -- initialize itmp
997  itmp = 0
998  !
999  ! -- allocate apt data
1000  call mem_allocate(this%strt, this%ncv, 'STRT', this%memoryPath)
1001  call mem_allocate(this%ktf, this%ncv, 'KTF', this%memoryPath)
1002  call mem_allocate(this%rfeatthk, this%ncv, 'RFEATTHK', this%memoryPath)
1003  call mem_allocate(this%lauxvar, this%naux, this%ncv, 'LAUXVAR', &
1004  this%memoryPath)
1005  !
1006  ! -- lake boundary and concentrations
1007  if (this%imatrows == 0) then
1008  call mem_allocate(this%iboundpak, this%ncv, 'IBOUND', this%memoryPath)
1009  call mem_allocate(this%xnewpak, this%ncv, 'XNEWPAK', this%memoryPath)
1010  end if
1011  call mem_allocate(this%xoldpak, this%ncv, 'XOLDPAK', this%memoryPath)
1012  !
1013  ! -- allocate character storage not managed by the memory manager
1014  allocate (this%featname(this%ncv)) ! ditch after boundnames allocated??
1015  !allocate(this%status(this%ncv))
1016  !
1017  do n = 1, this%ncv
1018  this%strt(n) = dep20
1019  this%ktf(n) = dzero
1020  this%rfeatthk(n) = dzero
1021  this%lauxvar(:, n) = dzero
1022  this%xoldpak(n) = dep20
1023  if (this%imatrows == 0) then
1024  this%iboundpak(n) = 1
1025  this%xnewpak(n) = dep20
1026  end if
1027  end do
1028  !
1029  ! -- allocate local storage for aux variables
1030  if (this%naux > 0) then
1031  allocate (caux(this%naux))
1032  end if
1033  !
1034  ! -- allocate and initialize temporary variables
1035  allocate (nboundchk(this%ncv))
1036  do n = 1, this%ncv
1037  nboundchk(n) = 0
1038  end do
1039  !
1040  ! -- get packagedata block
1041  call this%parser%GetBlock('PACKAGEDATA', isfound, ierr, &
1042  supportopenclose=.true.)
1043  !
1044  ! -- parse locations block if detected
1045  if (isfound) then
1046  write (this%iout, '(/1x,a)') 'PROCESSING '//trim(adjustl(this%text))// &
1047  ' PACKAGEDATA'
1048  nlak = 0
1049  nconn = 0
1050  do
1051  call this%parser%GetNextLine(endofblock)
1052  if (endofblock) exit
1053  n = this%parser%GetInteger()
1054 
1055  if (n < 1 .or. n > this%ncv) then
1056  write (errmsg, '(a,1x,i6)') &
1057  'Itemno must be > 0 and <= ', this%ncv
1058  call store_error(errmsg)
1059  cycle
1060  end if
1061  !
1062  ! -- increment nboundchk
1063  nboundchk(n) = nboundchk(n) + 1
1064  !
1065  ! -- strt
1066  this%strt(n) = this%parser%GetDouble()
1067  !
1068  ! -- read additional thermal conductivity terms
1069  this%ktf(n) = this%parser%GetDouble()
1070  this%rfeatthk(n) = this%parser%GetDouble()
1071  if (this%rfeatthk(n) <= dzero) then
1072  write (errmsg, '(4x,a)') &
1073  '****ERROR. Specified thickness used for thermal &
1074  &conduction MUST BE > 0 else divide by zero error occurs'
1075  call store_error(errmsg)
1076  cycle
1077  end if
1078  !
1079  ! -- get aux data
1080  do iaux = 1, this%naux
1081  call this%parser%GetString(caux(iaux))
1082  end do
1083 
1084  ! -- set default bndName
1085  write (cno, '(i9.9)') n
1086  bndname = 'Feature'//cno
1087 
1088  ! -- featname
1089  if (this%inamedbound /= 0) then
1090  call this%parser%GetStringCaps(bndnametemp)
1091  if (bndnametemp /= '') then
1092  bndname = bndnametemp
1093  end if
1094  end if
1095  this%featname(n) = bndname
1096 
1097  ! -- fill time series aware data
1098  ! -- fill aux data
1099  do jj = 1, this%naux
1100  text = caux(jj)
1101  ii = n
1102  bndelem => this%lauxvar(jj, ii)
1103  call read_value_or_time_series_adv(text, ii, jj, bndelem, &
1104  this%packName, 'AUX', &
1105  this%tsManager, this%iprpak, &
1106  this%auxname(jj))
1107  end do
1108  !
1109  nlak = nlak + 1
1110  end do
1111  !
1112  ! -- check for duplicate or missing lakes
1113  do n = 1, this%ncv
1114  if (nboundchk(n) == 0) then
1115  write (errmsg, '(a,1x,i0)') 'No data specified for feature', n
1116  call store_error(errmsg)
1117  else if (nboundchk(n) > 1) then
1118  write (errmsg, '(a,1x,i0,1x,a,1x,i0,1x,a)') &
1119  'Data for feature', n, 'specified', nboundchk(n), 'times'
1120  call store_error(errmsg)
1121  end if
1122  end do
1123  !
1124  write (this%iout, '(1x,a)') &
1125  'END OF '//trim(adjustl(this%text))//' PACKAGEDATA'
1126  else
1127  call store_error('Required packagedata block not found.')
1128  end if
1129  !
1130  ! -- terminate if any errors were detected
1131  if (count_errors() > 0) then
1132  call this%parser%StoreErrorUnit()
1133  end if
1134  !
1135  ! -- deallocate local storage for aux variables
1136  if (this%naux > 0) then
1137  deallocate (caux)
1138  end if
1139  !
1140  ! -- deallocate local storage for nboundchk
1141  deallocate (nboundchk)
1142  end subroutine mwe_read_cvs
1143 
1144 end module gwemwemodule
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:45
real(dp), parameter dep20
real constant 1e20
Definition: Constants.f90:91
integer(i4b), parameter lenboundname
maximum length of a bound name
Definition: Constants.f90:36
real(dp), parameter dzero
real constant zero
Definition: Constants.f90:65
integer(i4b), parameter lenbudtxt
maximum length of a budget component names
Definition: Constants.f90:37
subroutine allocate_scalars(this)
Allocate scalars specific to the multi-aquifer well energy transport (MWE) package.
Definition: gwe-mwe.f90:625
character(len= *), parameter flowtype
Definition: gwe-mwe.f90:55
subroutine mwe_rp_obs(this, obsrv, found)
Process package specific obs.
Definition: gwe-mwe.f90:877
subroutine mwe_rtmv_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
Thermal transport matrix term(s) associated with pumped-water- to-mover term (mwe_rtmv_term)
Definition: gwe-mwe.f90:761
subroutine mwe_allocate_arrays(this)
Allocate arrays specific to the streamflow mass transport (SFT) package.
Definition: gwe-mwe.f90:652
subroutine, public mwe_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, fmi, eqnsclfac, gwecommon, dvt, dvu, dvua)
Create new MWE package.
Definition: gwe-mwe.f90:100
subroutine mwe_bd_obs(this, obstypeid, jj, v, found)
Calculate observation value and pass it back to APT.
Definition: gwe-mwe.f90:900
subroutine find_mwe_package(this)
Find corresponding mwe package.
Definition: gwe-mwe.f90:160
subroutine mwe_fill_budobj(this, idx, x, flowja, ccratin, ccratout)
Copy flow terms into thisbudobj.
Definition: gwe-mwe.f90:530
character(len= *), parameter ftype
Definition: gwe-mwe.f90:54
character(len=16) text
Definition: gwe-mwe.f90:56
subroutine mwe_da(this)
Deallocate memory associated with MWE package.
Definition: gwe-mwe.f90:674
subroutine mwe_setup_budobj(this, idx)
Set up the budget object that stores all the mwe flows.
Definition: gwe-mwe.f90:437
integer(i4b) function mwe_get_nbudterms(this)
Function to return the number of budget terms just for this package.
Definition: gwe-mwe.f90:421
subroutine mwe_frtm_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
Thermal transport matrix term(s) associated with the flowing- well-rate-to-mover term (mwe_frtm_term)
Definition: gwe-mwe.f90:786
subroutine mwe_solve(this)
Add terms specific to multi-aquifer wells to the explicit multi- aquifer well energy transport solve.
Definition: gwe-mwe.f90:376
subroutine mwe_fc_expanded(this, rhs, ia, idxglo, matrix_sln)
Add matrix terms related to MWE.
Definition: gwe-mwe.f90:279
subroutine mwe_set_stressperiod(this, itemno, keyword, found)
Sets the stress period attributes for keyword use.
Definition: gwe-mwe.f90:935
subroutine mwe_fwrt_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
Thermal transport matrix term(s) associated with a flowing- well rate term associated with pumping (o...
Definition: gwe-mwe.f90:736
subroutine mwe_read_cvs(this)
Read feature information for this advanced package.
Definition: gwe-mwe.f90:975
subroutine mwe_rate_term(this, ientry, n1, n2, rrate, rhsval, hcofval)
Thermal transport matrix term(s) associated with a user-specified flow rate (mwe_rate_term)
Definition: gwe-mwe.f90:701
subroutine mwe_df_obs(this)
Observations.
Definition: gwe-mwe.f90:813
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 simulation methods.
Definition: Sim.f90:10
subroutine, public store_error(msg, terminate)
Store an error message.
Definition: Sim.f90:92
integer(i4b) function, public count_errors()
Return number of errors.
Definition: Sim.f90:59
This module contains simulation variables.
Definition: SimVariables.f90:9
character(len=maxcharlen) errmsg
error message string
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:2827
subroutine, public apt_process_obsid12(obsrv, dis, inunitobs, iout)
Process observation IDs for a package.
Definition: tsp-apt.f90:2870
@ brief BndType
Data for sharing among multiple packages. Originally read in from.