MODFLOW 6  version 6.8.0.dev0
USGS Modular Hydrologic Model
exg-gwtgwt.f90
Go to the documentation of this file.
1 !> @brief This module contains the GwtGwtExchangeModule Module
2 !!
3 !! This module contains the code for connecting two GWT Models.
4 !! The methods are based on the simple two point flux approximation
5 !! with the option to use ghost nodes to improve accuracy. This
6 !! exchange is used by GwtGwtConnection with the more sophisticated
7 !! interface model coupling approach when XT3D is needed.
8 !!
9 !<
11 
12  use kindmodule, only: dp, i4b, lgp
21  use listmodule, only: listtype
22  use listsmodule, only: basemodellist
26  use gwtmodule, only: gwtmodeltype
29  use observemodule, only: observetype
30  use obsmodule, only: obstype
31  use tablemodule, only: tabletype, table_cr
33 
34  implicit none
35 
36  private
37  public :: gwtexchangetype
38  public :: gwtexchange_create
39  public :: getgwtexchangefromlist
40  public :: castasgwtexchange
41 
42  !> @brief Derived type for GwtExchangeType
43  !!
44  !! This derived type contains information and methods for
45  !! connecting two GWT models.
46  !<
48  !
49  ! -- names of the GWF models that are connected by this exchange
50  character(len=LENMODELNAME) :: gwfmodelname1 = '' !< name of gwfmodel that corresponds to gwtmodel1
51  character(len=LENMODELNAME) :: gwfmodelname2 = '' !< name of gwfmodel that corresponds to gwtmodel2
52  real(dp), dimension(:), pointer, contiguous :: gwfsimvals => null() !< simulated gwf flow rate for each exchange
53  !
54  ! -- pointers to gwt models
55  class(gwtmodeltype), pointer :: gwtmodel1 => null() !< pointer to GWT Model 1
56  class(gwtmodeltype), pointer :: gwtmodel2 => null() !< pointer to GWT Model 2
57  !
58  ! -- GWT specific option block:
59  integer(I4B), pointer :: inewton => null() !< unneeded newton flag allows for mvt to be used here
60  integer(I4B), pointer :: iadvscheme !< the advection scheme at the interface:
61  !! 0 = upstream, 1 = central, 2 = TVD
62  !
63  ! -- Mover transport package
64  integer(I4B), pointer :: inmvt => null() !< unit number for mover transport (0 if off)
65  type(tspexchangemovertype), pointer :: mvt => null() !< water mover object
66  !
67  ! -- Observation package
68  integer(I4B), pointer :: inobs => null() !< unit number for GWT-GWT observations
69  type(obstype), pointer :: obs => null() !< observation object
70  !
71  ! -- internal data
72  real(dp), dimension(:), pointer, contiguous :: cond => null() !< conductance
73  real(dp), dimension(:), pointer, contiguous :: simvals => null() !< simulated flow rate for each exchange
74  !
75  ! -- table objects
76  type(tabletype), pointer :: outputtab1 => null()
77  type(tabletype), pointer :: outputtab2 => null()
78 
79  contains
80 
81  procedure :: exg_df => gwt_gwt_df
82  procedure :: exg_ar => gwt_gwt_ar
83  procedure :: exg_rp => gwt_gwt_rp
84  procedure :: exg_ad => gwt_gwt_ad
85  procedure :: exg_cf => gwt_gwt_cf
86  procedure :: exg_fc => gwt_gwt_fc
87  procedure :: exg_bd => gwt_gwt_bd
88  procedure :: exg_ot => gwt_gwt_ot
89  procedure :: exg_da => gwt_gwt_da
90  procedure :: exg_fp => gwt_gwt_fp
91  procedure :: connects_model => gwt_gwt_connects_model
92  procedure :: use_interface_model
93  procedure :: allocate_scalars
94  procedure :: allocate_arrays
95  procedure :: source_options
96  procedure :: read_mvt
97  procedure :: gwt_gwt_bdsav
98  procedure, private :: gwt_gwt_bdsav_model
99  procedure, private :: gwt_gwt_df_obs
100  procedure, private :: gwt_gwt_rp_obs
101  procedure, public :: gwt_gwt_save_simvals
102  procedure, private :: validate_exchange
103  end type gwtexchangetype
104 
105 contains
106 
107  !> @ brief Create GWT GWT exchange
108  !!
109  !! Create a new GWT to GWT exchange object.
110  !<
111  subroutine gwtexchange_create(filename, name, id, m1_id, m2_id, input_mempath)
112  ! -- modules
113  use basemodelmodule, only: basemodeltype
114  use listsmodule, only: baseexchangelist
115  use obsmodule, only: obs_cr
117  ! -- dummy
118  character(len=*), intent(in) :: filename !< filename for reading
119  integer(I4B), intent(in) :: id !< id for the exchange
120  character(len=*) :: name !< the exchange name
121  integer(I4B), intent(in) :: m1_id !< id for model 1
122  integer(I4B), intent(in) :: m2_id !< id for model 2
123  character(len=*), intent(in) :: input_mempath
124  ! -- local
125  type(gwtexchangetype), pointer :: exchange
126  class(basemodeltype), pointer :: mb
127  class(baseexchangetype), pointer :: baseexchange
128  integer(I4B) :: m1_index, m2_index
129  !
130  ! -- Create a new exchange and add it to the baseexchangelist container
131  allocate (exchange)
132  baseexchange => exchange
133  call addbaseexchangetolist(baseexchangelist, baseexchange)
134  !
135  ! -- Assign id and name
136  exchange%id = id
137  exchange%name = name
138  exchange%memoryPath = create_mem_path(exchange%name)
139  exchange%input_mempath = input_mempath
140  !
141  ! -- allocate scalars and set defaults
142  call exchange%allocate_scalars()
143  exchange%filename = filename
144  exchange%typename = 'GWT-GWT'
145  exchange%iAdvScheme = 0
146  exchange%ixt3d = 1
147  !
148  ! -- set gwtmodel1
149  m1_index = model_loc_idx(m1_id)
150  mb => getbasemodelfromlist(basemodellist, m1_index)
151  if (m1_index > 0) then
152  select type (mb)
153  type is (gwtmodeltype)
154  exchange%model1 => mb
155  exchange%gwtmodel1 => mb
156  end select
157  end if
158  exchange%v_model1 => get_virtual_model(m1_id)
159  !
160  ! -- set gwtmodel2
161  m2_index = model_loc_idx(m2_id)
162  if (m2_index > 0) then
163  mb => getbasemodelfromlist(basemodellist, m2_index)
164  select type (mb)
165  type is (gwtmodeltype)
166  exchange%model2 => mb
167  exchange%gwtmodel2 => mb
168  end select
169  end if
170  exchange%v_model2 => get_virtual_model(m2_id)
171  !
172  ! -- Verify that gwt model1 is of the correct type
173  if (.not. associated(exchange%gwtmodel1) .and. m1_index > 0) then
174  write (errmsg, '(3a)') 'Problem with GWT-GWT exchange ', &
175  trim(exchange%name), &
176  '. First specified GWT Model does not appear to be of the correct type.'
177  call store_error(errmsg, terminate=.true.)
178  end if
179  !
180  ! -- Verify that gwt model2 is of the correct type
181  if (.not. associated(exchange%gwtmodel2) .and. m2_index > 0) then
182  write (errmsg, '(3a)') 'Problem with GWT-GWT exchange ', &
183  trim(exchange%name), &
184  '. Second specified GWT Model does not appear to be of the correct type.'
185  call store_error(errmsg, terminate=.true.)
186  end if
187  !
188  ! -- Create the obs package
189  call obs_cr(exchange%obs, exchange%inobs)
190  end subroutine gwtexchange_create
191 
192  !> @ brief Define GWT GWT exchange
193  !!
194  !! Define GWT to GWT exchange object.
195  !<
196  subroutine gwt_gwt_df(this)
197  ! -- modules
198  use simvariablesmodule, only: iout
200  use ghostnodemodule, only: gnc_cr
201  ! -- dummy
202  class(gwtexchangetype) :: this !< GwtExchangeType
203  ! -- local
204  !
205  ! -- log the exchange
206  write (iout, '(/a,a)') ' Creating exchange: ', this%name
207  !
208  ! -- Ensure models are in same solution
209  if (this%v_model1%idsoln%get() /= this%v_model2%idsoln%get()) then
210  call store_error('Two models are connected in a GWT '// &
211  'exchange but they are in different solutions. '// &
212  'GWT models must be in same solution: '// &
213  trim(this%v_model1%name)//' '// &
214  trim(this%v_model2%name))
215  call store_error_filename(this%filename)
216  end if
217  !
218  ! -- source options
219  call this%source_options(iout)
220  !
221  ! -- source dimensions
222  call this%source_dimensions(iout)
223  !
224  ! -- allocate arrays
225  call this%allocate_arrays()
226  !
227  ! -- source exchange data
228  call this%source_data(iout)
229  !
230  ! -- Read mover information
231  if (this%inmvt > 0) then
232  call this%read_mvt(iout)
233  if (this%v_model1%is_local) then
234  call this%mvt%mvt_df(this%gwtmodel1%dis)
235  else
236  call this%mvt%mvt_df(this%gwtmodel2%dis)
237  end if
238  end if
239  !
240  ! -- Store obs
241  call this%gwt_gwt_df_obs()
242  if (associated(this%gwtmodel1)) then
243  call this%obs%obs_df(iout, this%name, 'GWT-GWT', this%gwtmodel1%dis)
244  end if
245  !
246  ! -- validate
247  call this%validate_exchange()
248  end subroutine gwt_gwt_df
249 
250  !> @brief validate exchange data after reading
251  !<
252  subroutine validate_exchange(this)
253  ! -- dummy
254  class(gwtexchangetype) :: this !< GwtExchangeType
255  !
256  ! Ensure gwfmodel names were entered
257  if (this%gwfmodelname1 == '') then
258  write (errmsg, '(3a)') 'GWT-GWT exchange ', trim(this%name), &
259  ' requires that GWFMODELNAME1 be entered in the &
260  &OPTIONS block.'
261  call store_error(errmsg)
262  end if
263  if (this%gwfmodelname2 == '') then
264  write (errmsg, '(3a)') 'GWT-GWT exchange ', trim(this%name), &
265  ' requires that GWFMODELNAME2 be entered in the &
266  &OPTIONS block.'
267  call store_error(errmsg)
268  end if
269  !
270  ! Periodic boundary condition in exchange don't allow XT3D (=interface model)
271  if (this%v_model1 == this%v_model2) then
272  if (this%ixt3d > 0) then
273  write (errmsg, '(3a)') 'GWT-GWT exchange ', trim(this%name), &
274  ' is a periodic boundary condition which cannot'// &
275  ' be configured with XT3D'
276  call store_error(errmsg)
277  end if
278  end if
279  !
280  ! Check to see if dispersion is on in either model1 or model2.
281  ! If so, then ANGLDEGX must be provided as an auxiliary variable for this
282  ! GWT-GWT exchange (this%ianglex > 0).
283  if (associated(this%gwtmodel1) .and. associated(this%gwtmodel2)) then
284  if (this%gwtmodel1%indsp /= 0 .or. this%gwtmodel2%indsp /= 0) then
285  if (this%ianglex == 0) then
286  write (errmsg, '(3a)') 'GWT-GWT exchange ', trim(this%name), &
287  ' requires that ANGLDEGX be specified as an'// &
288  ' auxiliary variable because dispersion was '// &
289  'specified in one or both transport models.'
290  call store_error(errmsg)
291  end if
292  end if
293  end if
294  !
295  if (this%ixt3d > 0 .and. this%ianglex == 0) then
296  write (errmsg, '(3a)') 'GWT-GWT exchange ', trim(this%name), &
297  ' requires that ANGLDEGX be specified as an'// &
298  ' auxiliary variable because XT3D is enabled'
299  call store_error(errmsg)
300  end if
301  !
302  if (count_errors() > 0) then
303  call ustop()
304  end if
305  end subroutine validate_exchange
306 
307  !> @ brief Allocate and read
308  !!
309  !! Allocated and read and calculate saturated conductance
310  !<
311  subroutine gwt_gwt_ar(this)
312  ! -- dummy
313  class(gwtexchangetype) :: this !< GwtExchangeType
314  !
315  ! -- If mover is active, then call ar routine
316  if (this%inmvt > 0) call this%mvt%mvt_ar()
317  !
318  ! -- Observation AR
319  call this%obs%obs_ar()
320  end subroutine gwt_gwt_ar
321 
322  !> @ brief Read and prepare
323  !!
324  !! Read new data for mover and obs
325  !<
326  subroutine gwt_gwt_rp(this)
327  ! -- modules
328  use tdismodule, only: readnewdata
329  ! -- dummy
330  class(gwtexchangetype) :: this !< GwtExchangeType
331  !
332  ! -- Check with TDIS on whether or not it is time to RP
333  if (.not. readnewdata) return
334  !
335  ! -- Read and prepare for mover
336  if (this%inmvt > 0) call this%mvt%mvt_rp()
337  !
338  ! -- Read and prepare for observations
339  call this%gwt_gwt_rp_obs()
340  end subroutine gwt_gwt_rp
341 
342  !> @ brief Advance
343  !!
344  !! Advance mover and obs
345  !<
346  subroutine gwt_gwt_ad(this)
347  ! -- dummy
348  class(gwtexchangetype) :: this !< GwtExchangeType
349  !
350  ! -- Advance mover
351  !if(this%inmvt > 0) call this%mvt%mvt_ad()
352  !
353  ! -- Push simulated values to preceding time step
354  call this%obs%obs_ad()
355  end subroutine gwt_gwt_ad
356 
357  subroutine gwt_gwt_cf(this, kiter)
358  class(gwtexchangetype) :: this !< GwfExchangeType
359  integer(I4B), intent(in) :: kiter
360  ! local
361  real(DP), dimension(:), pointer, contiguous :: x_m1, x_m2
362 
363  ! call mvt cf routine
364  if (this%inmvt > 0) then
365  x_m1 => null()
366  x_m2 => null()
367  if (associated(this%gwtmodel1)) x_m1 => this%gwtmodel1%x
368  if (associated(this%gwtmodel2)) x_m2 => this%gwtmodel2%x
369  call this%mvt%xmvt_cf(x_m1, x_m2)
370  end if
371 
372  end subroutine gwt_gwt_cf
373 
374  !> @ brief Fill coefficients
375  !!
376  !! Calculate conductance and fill coefficient matrix
377  !<
378  subroutine gwt_gwt_fc(this, kiter, matrix_sln, rhs_sln, inwtflag)
379  ! -- dummy
380  class(gwtexchangetype) :: this !< GwtExchangeType
381  integer(I4B), intent(in) :: kiter
382  class(matrixbasetype), pointer :: matrix_sln
383  real(DP), dimension(:), intent(inout) :: rhs_sln
384  integer(I4B), optional, intent(in) :: inwtflag
385  ! local
386  real(DP), dimension(:), pointer, contiguous :: x_m1, x_m2
387  !
388  ! -- Call mvt fc routine
389  if (this%inmvt > 0) then
390  x_m1 => null()
391  x_m2 => null()
392  if (associated(this%gwtmodel1)) x_m1 => this%gwtmodel1%x
393  if (associated(this%gwtmodel2)) x_m2 => this%gwtmodel2%x
394  call this%mvt%mvt_fc(x_m1, x_m2)
395  end if
396  end subroutine gwt_gwt_fc
397 
398  !> @ brief Budget
399  !!
400  !! Accumulate budget terms
401  !<
402  subroutine gwt_gwt_bd(this, icnvg, isuppress_output, isolnid)
403  ! -- modules
405  use budgetmodule, only: rate_accumulator
406  ! -- dummy
407  class(gwtexchangetype) :: this !< GwtExchangeType
408  integer(I4B), intent(inout) :: icnvg
409  integer(I4B), intent(in) :: isuppress_output
410  integer(I4B), intent(in) :: isolnid
411  ! -- local
412  character(len=LENBUDTXT), dimension(1) :: budtxt
413  real(DP), dimension(2, 1) :: budterm
414  real(DP) :: ratin, ratout
415  !
416  ! -- initialize
417  budtxt(1) = ' FLOW-JA-FACE'
418  !
419  ! -- Calculate ratin/ratout and pass to model budgets
420  call rate_accumulator(this%simvals, ratin, ratout)
421  !
422  ! -- Add the budget terms to model 1
423  if (associated(this%gwtmodel1)) then
424  budterm(1, 1) = ratin
425  budterm(2, 1) = ratout
426  call this%gwtmodel1%model_bdentry(budterm, budtxt, this%name)
427  end if
428  !
429  ! -- Add the budget terms to model 2
430  if (associated(this%gwtmodel2)) then
431  budterm(1, 1) = ratout
432  budterm(2, 1) = ratin
433  call this%gwtmodel2%model_bdentry(budterm, budtxt, this%name)
434  end if
435  !
436  ! -- Call mvt bd routine
437  if (this%inmvt > 0) call this%mvt%mvt_bd()
438  end subroutine gwt_gwt_bd
439 
440  !> @ brief Budget save
441  !!
442  !! Output individual flows to listing file and binary budget files
443  !<
444  subroutine gwt_gwt_bdsav(this)
445  ! -- dummy
446  class(gwtexchangetype) :: this !< GwtExchangeType
447  ! -- local
448  integer(I4B) :: icbcfl, ibudfl
449  !
450  ! -- budget for model1
451  if (associated(this%gwtmodel1)) then
452  call this%gwt_gwt_bdsav_model(this%gwtmodel1)
453  end if
454  !
455  ! -- budget for model2
456  if (associated(this%gwtmodel2)) then
457  call this%gwt_gwt_bdsav_model(this%gwtmodel2)
458  end if
459  !
460  ! -- Set icbcfl, ibudfl to zero so that flows will be printed and
461  ! saved, if the options were set in the MVT package
462  icbcfl = 1
463  ibudfl = 1
464  !
465  ! -- Call mvt bd routine
466  !cdl todo: if(this%inmvt > 0) call this%mvt%mvt_bdsav(icbcfl, ibudfl, isuppress_output)
467  !
468  ! -- Calculate and write simulated values for observations
469  if (this%inobs /= 0) then
470  call this%gwt_gwt_save_simvals()
471  end if
472  end subroutine gwt_gwt_bdsav
473 
474  !> @ brief Budget save
475  !!
476  !! Output individual flows to listing file and binary budget files
477  !<
478  subroutine gwt_gwt_bdsav_model(this, model)
479  ! -- modules
481  use tdismodule, only: kstp, kper
482  ! -- dummy
483  class(gwtexchangetype) :: this !< GwtExchangeType
484  class(gwtmodeltype), pointer :: model
485  ! -- local
486  character(len=LENBOUNDNAME) :: bname
487  character(len=LENPACKAGENAME + 4) :: packname
488  character(len=LENBUDTXT), dimension(1) :: budtxt
489  type(tabletype), pointer :: output_tab
490  class(virtualmodeltype), pointer :: nbr_model
491  character(len=20) :: nodestr
492  integer(I4B) :: ntabrows
493  integer(I4B) :: nodeu
494  integer(I4B) :: i, n1, n2, n1u, n2u
495  integer(I4B) :: ibinun
496  real(DP) :: ratin, ratout, rrate
497  logical(LGP) :: is_for_model1
498  integer(I4B) :: isuppress_output
499  real(DP), dimension(this%naux) :: auxrow
500  !
501  ! -- initialize local variables
502  isuppress_output = 0
503  budtxt(1) = ' FLOW-JA-FACE'
504  packname = 'EXG '//this%name
505  packname = adjustr(packname)
506  if (associated(model, this%gwtmodel1)) then
507  output_tab => this%outputtab1
508  nbr_model => this%v_model2
509  is_for_model1 = .true.
510  else
511  output_tab => this%outputtab2
512  nbr_model => this%v_model1
513  is_for_model1 = .false.
514  end if
515  !
516  ! -- update output tables
517  if (this%iprflow /= 0) then
518  !
519  ! -- update titles
520  if (model%oc%oc_save('BUDGET')) then
521  call output_tab%set_title(packname)
522  end if
523  !
524  ! -- set table kstp and kper
525  call output_tab%set_kstpkper(kstp, kper)
526  !
527  ! -- update maxbound of tables
528  ntabrows = 0
529  do i = 1, this%nexg
530  n1 = this%nodem1(i)
531  n2 = this%nodem2(i)
532  !
533  ! -- If both cells are active then calculate flow rate
534  if (this%v_model1%ibound%get(n1) /= 0 .and. &
535  this%v_model2%ibound%get(n2) /= 0) then
536  ntabrows = ntabrows + 1
537  end if
538  end do
539  if (ntabrows > 0) then
540  call output_tab%set_maxbound(ntabrows)
541  end if
542  end if
543  !
544  ! -- Print and write budget terms for model 1
545  !
546  ! -- Set binary unit numbers for saving flows
547  if (this%ipakcb /= 0) then
548  ibinun = model%oc%oc_save_unit('BUDGET')
549  else
550  ibinun = 0
551  end if
552  !
553  ! -- If save budget flag is zero for this stress period, then
554  ! shut off saving
555  if (.not. model%oc%oc_save('BUDGET')) ibinun = 0
556  if (isuppress_output /= 0) then
557  ibinun = 0
558  end if
559  !
560  ! -- If cell-by-cell flows will be saved as a list, write header.
561  if (ibinun /= 0) then
562  call model%dis%record_srcdst_list_header(budtxt(1), &
563  model%name, &
564  this%name, &
565  nbr_model%name, &
566  this%name, &
567  this%naux, this%auxname, &
568  ibinun, this%nexg, &
569  model%iout)
570  end if
571  !
572  ! Initialize accumulators
573  ratin = dzero
574  ratout = dzero
575  !
576  ! -- Loop through all exchanges
577  do i = 1, this%nexg
578  !
579  ! -- Assign boundary name
580  if (this%inamedbound > 0) then
581  bname = this%boundname(i)
582  else
583  bname = ''
584  end if
585  !
586  ! -- Calculate the flow rate between n1 and n2
587  rrate = dzero
588  n1 = this%nodem1(i)
589  n2 = this%nodem2(i)
590  !
591  ! -- If both cells are active then calculate flow rate
592  if (this%v_model1%ibound%get(n1) /= 0 .and. &
593  this%v_model2%ibound%get(n2) /= 0) then
594  rrate = this%simvals(i)
595  !
596  ! -- Print the individual rates to model list files if requested
597  if (this%iprflow /= 0) then
598  if (model%oc%oc_save('BUDGET')) then
599  !
600  ! -- set nodestr and write outputtab table
601  if (is_for_model1) then
602  nodeu = model%dis%get_nodeuser(n1)
603  call model%dis%nodeu_to_string(nodeu, nodestr)
604  call output_tab%print_list_entry(i, trim(adjustl(nodestr)), &
605  rrate, bname)
606  else
607  nodeu = model%dis%get_nodeuser(n2)
608  call model%dis%nodeu_to_string(nodeu, nodestr)
609  call output_tab%print_list_entry(i, trim(adjustl(nodestr)), &
610  -rrate, bname)
611  end if
612  end if
613  end if
614  if (rrate < dzero) then
615  ratout = ratout - rrate
616  else
617  ratin = ratin + rrate
618  end if
619  end if
620  !
621  ! -- If saving cell-by-cell flows in list, write flow
622  n1u = this%v_model1%dis_get_nodeuser(n1)
623  n2u = this%v_model2%dis_get_nodeuser(n2)
624  if (ibinun /= 0) then
625  if (this%naux > 0) then
626  auxrow(:) = this%auxvar(:, i)
627  end if
628  if (is_for_model1) then
629  call model%dis%record_mf6_list_entry( &
630  ibinun, n1u, n2u, rrate, this%naux, auxrow, &
631  .false., .false.)
632  else
633  call model%dis%record_mf6_list_entry( &
634  ibinun, n2u, n1u, -rrate, this%naux, auxrow, &
635  .false., .false.)
636  end if
637  end if
638  !
639  end do
640  end subroutine gwt_gwt_bdsav_model
641 
642  !> @ brief Output
643  !!
644  !! Write output
645  !<
646  subroutine gwt_gwt_ot(this)
647  ! -- modules
648  use simvariablesmodule, only: iout
649  use constantsmodule, only: dzero
650  ! -- dummy
651  class(gwtexchangetype) :: this !< GwtExchangeType
652  ! -- local
653  integer(I4B) :: iexg, n1, n2
654  integer(I4B) :: ibudfl
655  real(DP) :: flow
656  character(len=LINELENGTH) :: node1str, node2str
657  ! -- format
658  character(len=*), parameter :: fmtheader = &
659  "(/1x, 'SUMMARY OF EXCHANGE RATES FOR EXCHANGE ', a, ' WITH ID ', i0, /, &
660  &2a16, 5a16, /, 112('-'))"
661  character(len=*), parameter :: fmtheader2 = &
662  "(/1x, 'SUMMARY OF EXCHANGE RATES FOR EXCHANGE ', a, ' WITH ID ', i0, /, &
663  &2a16, 4a16, /, 96('-'))"
664  character(len=*), parameter :: fmtdata = &
665  "(2a16, 5(1pg16.6))"
666  !
667  ! -- Call bdsave
668  call this%gwt_gwt_bdsav()
669  !
670  ! -- Write a table of exchanges
671  if (this%iprflow /= 0) then
672  write (iout, fmtheader2) trim(adjustl(this%name)), this%id, 'NODEM1', &
673  'NODEM2', 'COND', 'X_M1', 'X_M2', 'FLOW'
674  do iexg = 1, this%nexg
675  n1 = this%nodem1(iexg)
676  n2 = this%nodem2(iexg)
677  flow = this%simvals(iexg)
678  call this%v_model1%dis_noder_to_string(n1, node1str)
679  call this%v_model2%dis_noder_to_string(n2, node2str)
680  write (iout, fmtdata) trim(adjustl(node1str)), &
681  trim(adjustl(node2str)), &
682  this%cond(iexg), this%v_model1%x%get(n1), &
683  this%v_model2%x%get(n2), flow
684  end do
685  end if
686  !
687  !cdl Implement when MVT is ready
688  ! -- Mover budget output
689  ibudfl = 1
690  if (this%inmvt > 0) call this%mvt%mvt_ot_bdsummary(ibudfl)
691  !
692  ! -- OBS output
693  call this%obs%obs_ot()
694  end subroutine gwt_gwt_ot
695 
696  !> @ brief Source options
697  !!
698  !! Source the options block
699  !<
700  subroutine source_options(this, iout)
701  ! -- modules
702  use constantsmodule, only: lenvarname
708  ! -- dummy
709  class(gwtexchangetype) :: this !< GwtExchangeType
710  integer(I4B), intent(in) :: iout
711  ! -- local
712  type(exggwtgwtparamfoundtype) :: found
713  character(len=LENVARNAME), dimension(4) :: adv_scheme = &
714  &[character(len=LENVARNAME) :: 'UPSTREAM', 'CENTRAL', 'TVD', 'UTVD']
715  character(len=linelength) :: mvt_fname
716  !
717  ! -- update defaults with values sourced from input context
718  call mem_set_value(this%gwfmodelname1, 'GWFMODELNAME1', this%input_mempath, &
719  found%gwfmodelname1)
720  call mem_set_value(this%gwfmodelname2, 'GWFMODELNAME2', this%input_mempath, &
721  found%gwfmodelname2)
722  call mem_set_value(this%iAdvScheme, 'ADV_SCHEME', this%input_mempath, &
723  adv_scheme, found%adv_scheme)
724  call mem_set_value(this%ixt3d, 'DSP_XT3D_OFF', this%input_mempath, &
725  found%dsp_xt3d_off)
726  call mem_set_value(this%ixt3d, 'DSP_XT3D_RHS', this%input_mempath, &
727  found%dsp_xt3d_rhs)
728  !
729  write (iout, '(1x,a)') 'PROCESSING GWT-GWT EXCHANGE OPTIONS'
730  !
731  ! -- source base class options
732  call this%DisConnExchangeType%source_options(iout)
733  !
734  if (found%gwfmodelname1) then
735  write (iout, '(4x,a,a)') &
736  'GWFMODELNAME1 IS SET TO: ', trim(this%gwfmodelname1)
737  end if
738  !
739  if (found%gwfmodelname2) then
740  write (iout, '(4x,a,a)') &
741  'GWFMODELNAME2 IS SET TO: ', trim(this%gwfmodelname2)
742  end if
743  !
744  if (found%adv_scheme) then
745  if (this%iAdvScheme == 0) then
746  call store_error('Unrecognized input value for ADV_SCHEME option.')
747  call store_error_filename(this%filename)
748  else
749  ! -- count from 0
750  this%iAdvScheme = this%iAdvScheme - 1
751  write (iout, '(4x,a,a)') &
752  'ADVECTION SCHEME METHOD HAS BEEN SET TO: ', &
753  trim(adv_scheme(this%iAdvScheme + 1))
754  end if
755  end if
756  !
757  if (found%dsp_xt3d_off .and. found%dsp_xt3d_rhs) then
758  errmsg = 'DSP_XT3D_OFF and DSP_XT3D_RHS cannot both be set as options.'
759  call store_error(errmsg)
760  call store_error_filename(this%filename)
761  else if (found%dsp_xt3d_off) then
762  this%ixt3d = 0
763  write (iout, '(4x,a)') 'XT3D FORMULATION HAS BEEN SHUT OFF.'
764  else if (found%dsp_xt3d_rhs) then
765  this%ixt3d = 2
766  write (iout, '(4x,a)') 'XT3D RIGHT-HAND SIDE FORMULATION IS SELECTED.'
767  end if
768  !
769  ! -- enforce 0 or 1 MVR6_FILENAME entries in option block
770  if (filein_fname(mvt_fname, 'MVT6_FILENAME', this%input_mempath, &
771  this%filename)) then
772  this%inmvt = getunit()
773  call openfile(this%inmvt, iout, mvt_fname, 'MVT')
774  write (iout, '(4x,a)') &
775  'WATER MOVER TRANSPORT INFORMATION WILL BE READ FROM ', trim(mvt_fname)
776  end if
777  !
778  ! -- enforce 0 or 1 OBS6_FILENAME entries in option block
779  if (filein_fname(this%obs%inputFilename, 'OBS6_FILENAME', &
780  this%input_mempath, this%filename)) then
781  this%obs%active = .true.
782  this%obs%inUnitObs = getunit()
783  call openfile(this%obs%inUnitObs, iout, this%obs%inputFilename, 'OBS')
784  end if
785  !
786  write (iout, '(1x,a)') 'END OF GWT-GWT EXCHANGE OPTIONS'
787  end subroutine source_options
788 
789  !> @ brief Read mover
790  !!
791  !! Read and process movers
792  !<
793  subroutine read_mvt(this, iout)
794  ! -- modules
795  use tspmvtmodule, only: mvt_cr
796  ! -- dummy
797  class(gwtexchangetype) :: this !< GwtExchangeType
798  integer(I4B), intent(in) :: iout
799  ! -- local
800  class(transportmodeltype), pointer :: tspmodel1, tspmodel2
801  !
802  ! -- Create and initialize the mover object
803  tspmodel1 => this%gwtmodel1
804  tspmodel2 => this%gwtmodel2
805  call xmvt_cr(this%mvt, this%name, tspmodel1, tspmodel2, &
806  this%gwfmodelname1, this%gwfmodelname2, this%inmvt, iout)
807 
808  end subroutine read_mvt
809 
810  !> @ brief Allocate scalars
811  !!
812  !! Allocate scalar variables
813  !<
814  subroutine allocate_scalars(this)
815  ! -- modules
817  use constantsmodule, only: dzero
818  ! -- dummy
819  class(gwtexchangetype) :: this !< GwtExchangeType
820  !
821  call this%DisConnExchangeType%allocate_scalars()
822  !
823  call mem_allocate(this%inewton, 'INEWTON', this%memoryPath)
824  call mem_allocate(this%inobs, 'INOBS', this%memoryPath)
825  call mem_allocate(this%iAdvScheme, 'IADVSCHEME', this%memoryPath)
826  this%inewton = 0
827  this%inobs = 0
828  this%iAdvScheme = 0
829  !
830  call mem_allocate(this%inmvt, 'INMVT', this%memoryPath)
831  this%inmvt = 0
832  end subroutine allocate_scalars
833 
834  !> @ brief Deallocate
835  !!
836  !! Deallocate memory associated with this object
837  !<
838  subroutine gwt_gwt_da(this)
839  ! -- modules
841  ! -- dummy
842  class(gwtexchangetype) :: this !< GwtExchangeType
843  !
844  ! -- objects
845  if (this%inmvt > 0) then
846  call this%mvt%mvt_da()
847  deallocate (this%mvt)
848  end if
849  call this%obs%obs_da()
850  deallocate (this%obs)
851  !
852  ! -- arrays
853  call mem_deallocate(this%cond)
854  call mem_deallocate(this%simvals)
855  call mem_deallocate(this%gwfsimvals, 'GWFSIMVALS', this%memoryPath) ! linked memory
856  !
857  ! -- output table objects
858  if (associated(this%outputtab1)) then
859  call this%outputtab1%table_da()
860  deallocate (this%outputtab1)
861  nullify (this%outputtab1)
862  end if
863  if (associated(this%outputtab2)) then
864  call this%outputtab2%table_da()
865  deallocate (this%outputtab2)
866  nullify (this%outputtab2)
867  end if
868  !
869  ! -- scalars
870  deallocate (this%filename)
871  call mem_deallocate(this%inewton)
872  call mem_deallocate(this%inobs)
873  call mem_deallocate(this%iAdvScheme)
874  call mem_deallocate(this%inmvt)
875  !
876  ! -- deallocate base
877  call this%DisConnExchangeType%disconnex_da()
878  end subroutine gwt_gwt_da
879 
880  !> @ brief Allocate arrays
881  !!
882  !! Allocate arrays
883  !<
884  subroutine allocate_arrays(this)
885  ! -- modules
887  ! -- dummy
888  class(gwtexchangetype) :: this !< GwtExchangeType
889  ! -- local
890  character(len=LINELENGTH) :: text
891  integer(I4B) :: ntabcol, i
892  !
893  call this%DisConnExchangeType%allocate_arrays()
894  !
895  call mem_allocate(this%cond, this%nexg, 'COND', this%memoryPath)
896  call mem_allocate(this%simvals, this%nexg, 'SIMVALS', this%memoryPath)
897  !
898  ! -- Initialize
899  do i = 1, this%nexg
900  this%cond(i) = dnodata
901  end do
902  !
903  ! -- allocate and initialize the output table
904  if (this%iprflow /= 0) then
905  !
906  ! -- dimension table
907  ntabcol = 3
908  if (this%inamedbound > 0) then
909  ntabcol = ntabcol + 1
910  end if
911  !
912  ! -- initialize the output table objects
913  ! outouttab1
914  if (this%v_model1%is_local) then
915  call table_cr(this%outputtab1, this%name, ' ')
916  call this%outputtab1%table_df(this%nexg, ntabcol, this%gwtmodel1%iout, &
917  transient=.true.)
918  text = 'NUMBER'
919  call this%outputtab1%initialize_column(text, 10, alignment=tabcenter)
920  text = 'CELLID'
921  call this%outputtab1%initialize_column(text, 20, alignment=tableft)
922  text = 'RATE'
923  call this%outputtab1%initialize_column(text, 15, alignment=tabcenter)
924  if (this%inamedbound > 0) then
925  text = 'NAME'
926  call this%outputtab1%initialize_column(text, 20, alignment=tableft)
927  end if
928  end if
929  ! outouttab2
930  if (this%v_model2%is_local) then
931  call table_cr(this%outputtab2, this%name, ' ')
932  call this%outputtab2%table_df(this%nexg, ntabcol, this%gwtmodel2%iout, &
933  transient=.true.)
934  text = 'NUMBER'
935  call this%outputtab2%initialize_column(text, 10, alignment=tabcenter)
936  text = 'CELLID'
937  call this%outputtab2%initialize_column(text, 20, alignment=tableft)
938  text = 'RATE'
939  call this%outputtab2%initialize_column(text, 15, alignment=tabcenter)
940  if (this%inamedbound > 0) then
941  text = 'NAME'
942  call this%outputtab2%initialize_column(text, 20, alignment=tableft)
943  end if
944  end if
945  end if
946  end subroutine allocate_arrays
947 
948  !> @ brief Define observations
949  !!
950  !! Define the observations associated with this object
951  !<
952  subroutine gwt_gwt_df_obs(this)
953  ! -- dummy
954  class(gwtexchangetype) :: this !< GwtExchangeType
955  ! -- local
956  integer(I4B) :: indx
957  !
958  ! -- Store obs type and assign procedure pointer
959  ! for gwt-gwt observation type.
960  call this%obs%StoreObsType('flow-ja-face', .true., indx)
961  this%obs%obsData(indx)%ProcessIdPtr => gwt_gwt_process_obsid
962  end subroutine gwt_gwt_df_obs
963 
964  !> @ brief Read and prepare observations
965  !!
966  !! Handle observation exchanges exchange-boundary names.
967  !<
968  subroutine gwt_gwt_rp_obs(this)
969  ! -- modules
970  use constantsmodule, only: dzero
971  ! -- dummy
972  class(gwtexchangetype) :: this !< GwtExchangeType
973  ! -- local
974  integer(I4B) :: i
975  integer(I4B) :: j
976  class(observetype), pointer :: obsrv => null()
977  character(len=LENBOUNDNAME) :: bname
978  logical :: jfound
979  ! -- formats
980 10 format('Exchange "', a, '" for observation "', a, &
981  '" is invalid in package "', a, '"')
982 20 format('Exchange id "', i0, '" for observation "', a, &
983  '" is invalid in package "', a, '"')
984  !
985  do i = 1, this%obs%npakobs
986  obsrv => this%obs%pakobs(i)%obsrv
987  !
988  ! -- indxbnds needs to be reset each stress period because
989  ! list of boundaries can change each stress period.
990  ! -- Not true for exchanges, but leave this in for now anyway.
991  call obsrv%ResetObsIndex()
992  obsrv%BndFound = .false.
993  !
994  bname = obsrv%FeatureName
995  if (bname /= '') then
996  ! -- Observation location(s) is(are) based on a boundary name.
997  ! Iterate through all boundaries to identify and store
998  ! corresponding index(indices) in bound array.
999  jfound = .false.
1000  do j = 1, this%nexg
1001  if (this%boundname(j) == bname) then
1002  jfound = .true.
1003  obsrv%BndFound = .true.
1004  obsrv%CurrentTimeStepEndValue = dzero
1005  call obsrv%AddObsIndex(j)
1006  end if
1007  end do
1008  if (.not. jfound) then
1009  write (errmsg, 10) trim(bname), trim(obsrv%ObsTypeId), trim(this%name)
1010  call store_error(errmsg)
1011  end if
1012  else
1013  ! -- Observation location is a single exchange number
1014  if (obsrv%intPak1 <= this%nexg .and. obsrv%intPak1 > 0) then
1015  jfound = .true.
1016  obsrv%BndFound = .true.
1017  obsrv%CurrentTimeStepEndValue = dzero
1018  call obsrv%AddObsIndex(obsrv%intPak1)
1019  else
1020  jfound = .false.
1021  end if
1022  if (.not. jfound) then
1023  write (errmsg, 20) obsrv%intPak1, trim(obsrv%ObsTypeId), trim(this%name)
1024  call store_error(errmsg)
1025  end if
1026  end if
1027  end do
1028  !
1029  ! -- write summary of error messages
1030  if (count_errors() > 0) then
1031  call store_error_filename(this%obs%inputFilename)
1032  end if
1033  end subroutine gwt_gwt_rp_obs
1034 
1035  !> @ brief Final processing
1036  !!
1037  !! Conduct any final processing
1038  !<
1039  subroutine gwt_gwt_fp(this)
1040  ! -- dummy
1041  class(gwtexchangetype) :: this !< GwtExchangeType
1042  end subroutine gwt_gwt_fp
1043 
1044  !> @brief Return true when this exchange provides matrix coefficients for
1045  !! solving @param model
1046  !<
1047  function gwt_gwt_connects_model(this, model) result(is_connected)
1048  ! -- dummy
1049  class(gwtexchangetype) :: this !< GwtExchangeType
1050  class(basemodeltype), pointer, intent(in) :: model !< the model to which the exchange might hold a connection
1051  ! -- return
1052  logical(LGP) :: is_connected !< true, when connected
1053  !
1054  is_connected = .false.
1055  !
1056  ! only connected when model is GwtModelType of course
1057  select type (model)
1058  class is (gwtmodeltype)
1059  if (associated(this%gwtmodel1, model)) then
1060  is_connected = .true.
1061  else if (associated(this%gwtmodel2, model)) then
1062  is_connected = .true.
1063  end if
1064  end select
1065  end function gwt_gwt_connects_model
1066 
1067  !> @brief Should interface model be used for this exchange
1068  !!
1069  !! For now this always returns true, since we do not support
1070  !! a classic-style two-point flux approximation for GWT-GWT.
1071  !! If we ever add logic to support a simpler non-interface
1072  !! model flux calculation, then logic should be added here to
1073  !! set the return accordingly.
1074  !<
1075  function use_interface_model(this) result(use_im)
1076  ! -- dummy
1077  class(gwtexchangetype) :: this !< GwtExchangeType
1078  ! -- return
1079  logical(LGP) :: use_im !< true when interface model should be used
1080  !
1081  ! For now set use_im to .true. since the interface model approach
1082  ! must currently be used for any GWT-GWT exchange.
1083  use_im = .true.
1084  end function
1085 
1086  !> @ brief Save simulated flow observations
1087  !!
1088  !! Save the simulated flows for each exchange
1089  !<
1090  subroutine gwt_gwt_save_simvals(this)
1091  ! -- dummy
1092  use simvariablesmodule, only: errmsg
1093  use constantsmodule, only: dzero
1094  use observemodule, only: observetype
1095  class(gwtexchangetype), intent(inout) :: this
1096  ! -- local
1097  integer(I4B) :: i
1098  integer(I4B) :: j
1099  integer(I4B) :: n1
1100  integer(I4B) :: n2
1101  integer(I4B) :: iexg
1102  real(DP) :: v
1103  type(observetype), pointer :: obsrv => null()
1104  !
1105  ! -- Write simulated values for all gwt-gwt observations
1106  if (this%obs%npakobs > 0) then
1107  call this%obs%obs_bd_clear()
1108  do i = 1, this%obs%npakobs
1109  obsrv => this%obs%pakobs(i)%obsrv
1110  do j = 1, obsrv%indxbnds_count
1111  iexg = obsrv%indxbnds(j)
1112  v = dzero
1113  select case (obsrv%ObsTypeId)
1114  case ('FLOW-JA-FACE')
1115  n1 = this%nodem1(iexg)
1116  n2 = this%nodem2(iexg)
1117  v = this%simvals(iexg)
1118  case default
1119  errmsg = 'Unrecognized observation type: '// &
1120  trim(obsrv%ObsTypeId)
1121  call store_error(errmsg)
1122  call store_error_filename(this%obs%inputFilename)
1123  end select
1124  call this%obs%SaveOneSimval(obsrv, v)
1125  end do
1126  end do
1127  end if
1128  end subroutine gwt_gwt_save_simvals
1129 
1130  !> @ brief Obs ID processor
1131  !!
1132  !! Process observations for this exchange
1133  !<
1134  subroutine gwt_gwt_process_obsid(obsrv, dis, inunitobs, iout)
1135  ! -- modules
1136  use constantsmodule, only: linelength
1137  use inputoutputmodule, only: urword
1138  use observemodule, only: observetype
1139  use basedismodule, only: disbasetype
1140  ! -- dummy
1141  type(observetype), intent(inout) :: obsrv
1142  class(disbasetype), intent(in) :: dis
1143  integer(I4B), intent(in) :: inunitobs
1144  integer(I4B), intent(in) :: iout
1145  ! -- local
1146  integer(I4B) :: n, iexg, istat
1147  integer(I4B) :: icol, istart, istop
1148  real(DP) :: r
1149  character(len=LINELENGTH) :: string
1150  !
1151  string = obsrv%IDstring
1152  icol = 1
1153  ! -- get exchange index
1154  call urword(string, icol, istart, istop, 1, n, r, iout, inunitobs)
1155  read (string(istart:istop), '(i10)', iostat=istat) iexg
1156  if (istat == 0) then
1157  obsrv%intPak1 = iexg
1158  else
1159  ! Integer can't be read from string; it's presumed to be an exchange
1160  ! boundary name (already converted to uppercase)
1161  obsrv%FeatureName = trim(adjustl(string))
1162  ! -- Observation may require summing rates from multiple exchange
1163  ! boundaries, so assign intPak1 as a value that indicates observation
1164  ! is for a named exchange boundary or group of exchange boundaries.
1165  obsrv%intPak1 = namedboundflag
1166  end if
1167  end subroutine gwt_gwt_process_obsid
1168 
1169  !> @ brief Cast polymorphic object as exchange
1170  !!
1171  !! Cast polymorphic object as exchange
1172  !<
1173  function castasgwtexchange(obj) result(res)
1174  implicit none
1175  ! -- dummy
1176  class(*), pointer, intent(inout) :: obj
1177  ! -- return
1178  class(gwtexchangetype), pointer :: res
1179  !
1180  res => null()
1181  if (.not. associated(obj)) return
1182  !
1183  select type (obj)
1184  class is (gwtexchangetype)
1185  res => obj
1186  end select
1187  end function castasgwtexchange
1188 
1189  !> @ brief Get exchange from list
1190  !!
1191  !! Return an exchange from the list for specified index
1192  !<
1193  function getgwtexchangefromlist(list, idx) result(res)
1194  implicit none
1195  ! -- dummy
1196  type(listtype), intent(inout) :: list
1197  integer(I4B), intent(in) :: idx
1198  ! -- return
1199  class(gwtexchangetype), pointer :: res
1200  ! -- local
1201  class(*), pointer :: obj
1202  !
1203  obj => list%GetItem(idx)
1204  res => castasgwtexchange(obj)
1205  end function getgwtexchangefromlist
1206 
1207 end module gwtgwtexchangemodule
1208 
subroutine, public addbaseexchangetolist(list, exchange)
Add the exchange object (BaseExchangeType) to a list.
class(basemodeltype) function, pointer, public getbasemodelfromlist(list, idx)
Definition: BaseModel.f90:171
This module contains the BudgetModule.
Definition: Budget.f90:20
subroutine, public rate_accumulator(flow, rin, rout)
@ brief Rate accumulator subroutine
Definition: Budget.f90:632
This module contains simulation constants.
Definition: Constants.f90:9
integer(i4b), parameter linelength
maximum length of a standard line
Definition: Constants.f90:45
@ tabcenter
centered table column
Definition: Constants.f90:172
@ tableft
left justified table column
Definition: Constants.f90:171
integer(i4b), parameter lenmodelname
maximum length of the model name
Definition: Constants.f90:22
integer(i4b), parameter lenpackagename
maximum length of the package name
Definition: Constants.f90:23
integer(i4b), parameter namedboundflag
named bound flag
Definition: Constants.f90:49
real(dp), parameter dnodata
real no data constant
Definition: Constants.f90:95
integer(i4b), parameter lenvarname
maximum length of a variable name
Definition: Constants.f90:17
integer(i4b), parameter lenauxname
maximum length of a aux variable
Definition: Constants.f90:35
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, public gnc_cr(gncobj, name_parent, inunit, iout)
Create new GNC exchange object.
Definition: GhostNode.f90:61
This module contains the GwtGwtExchangeModule Module.
Definition: exg-gwtgwt.f90:10
class(gwtexchangetype) function, pointer, public castasgwtexchange(obj)
@ brief Cast polymorphic object as exchange
subroutine allocate_scalars(this)
@ brief Allocate scalars
Definition: exg-gwtgwt.f90:815
subroutine gwt_gwt_fc(this, kiter, matrix_sln, rhs_sln, inwtflag)
@ brief Fill coefficients
Definition: exg-gwtgwt.f90:379
subroutine read_mvt(this, iout)
@ brief Read mover
Definition: exg-gwtgwt.f90:794
subroutine gwt_gwt_df_obs(this)
@ brief Define observations
Definition: exg-gwtgwt.f90:953
subroutine source_options(this, iout)
@ brief Source options
Definition: exg-gwtgwt.f90:701
subroutine gwt_gwt_df(this)
@ brief Define GWT GWT exchange
Definition: exg-gwtgwt.f90:197
subroutine gwt_gwt_process_obsid(obsrv, dis, inunitobs, iout)
@ brief Obs ID processor
subroutine, public gwtexchange_create(filename, name, id, m1_id, m2_id, input_mempath)
@ brief Create GWT GWT exchange
Definition: exg-gwtgwt.f90:112
subroutine validate_exchange(this)
validate exchange data after reading
Definition: exg-gwtgwt.f90:253
subroutine gwt_gwt_bdsav(this)
@ brief Budget save
Definition: exg-gwtgwt.f90:445
subroutine gwt_gwt_fp(this)
@ brief Final processing
logical(lgp) function gwt_gwt_connects_model(this, model)
Return true when this exchange provides matrix coefficients for solving.
subroutine gwt_gwt_save_simvals(this)
@ brief Save simulated flow observations
subroutine gwt_gwt_ad(this)
@ brief Advance
Definition: exg-gwtgwt.f90:347
subroutine gwt_gwt_rp_obs(this)
@ brief Read and prepare observations
Definition: exg-gwtgwt.f90:969
subroutine gwt_gwt_bdsav_model(this, model)
@ brief Budget save
Definition: exg-gwtgwt.f90:479
subroutine gwt_gwt_cf(this, kiter)
Definition: exg-gwtgwt.f90:358
class(gwtexchangetype) function, pointer, public getgwtexchangefromlist(list, idx)
@ brief Get exchange from list
subroutine allocate_arrays(this)
@ brief Allocate arrays
Definition: exg-gwtgwt.f90:885
subroutine gwt_gwt_ar(this)
@ brief Allocate and read
Definition: exg-gwtgwt.f90:312
subroutine gwt_gwt_bd(this, icnvg, isuppress_output, isolnid)
@ brief Budget
Definition: exg-gwtgwt.f90:403
logical(lgp) function use_interface_model(this)
Should interface model be used for this exchange.
subroutine gwt_gwt_rp(this)
@ brief Read and prepare
Definition: exg-gwtgwt.f90:327
subroutine gwt_gwt_da(this)
@ brief Deallocate
Definition: exg-gwtgwt.f90:839
subroutine gwt_gwt_ot(this)
@ brief Output
Definition: exg-gwtgwt.f90:647
Definition: gwt.f90:8
integer(i4b) function, public getunit()
Get a free unit number.
subroutine, public openfile(iu, iout, fname, ftype, fmtarg_opt, accarg_opt, filstat_opt, mode_opt)
Open a file.
Definition: InputOutput.f90:30
subroutine, public urword(line, icol, istart, istop, ncode, n, r, iout, in)
Extract a word from a string.
This module defines variable data types.
Definition: kind.f90:8
type(listtype), public basemodellist
Definition: mf6lists.f90:16
type(listtype), public baseexchangelist
Definition: mf6lists.f90:25
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
This module contains the derived types ObserveType and ObsDataType.
Definition: Observe.f90:15
This module contains the derived type ObsType.
Definition: Obs.f90:127
subroutine, public obs_cr(obs, inobs)
@ brief Create a new ObsType object
Definition: Obs.f90:225
This module contains simulation methods.
Definition: Sim.f90:10
subroutine, public ustop(stopmess, ioutlocal)
Stop the simulation.
Definition: Sim.f90:312
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
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.
Definition: Sim.f90:203
This module contains simulation variables.
Definition: SimVariables.f90:9
character(len=maxcharlen) errmsg
error message string
integer(i4b), dimension(:), allocatable model_loc_idx
equals the local index into the basemodel list (-1 when not available)
integer(i4b) iout
file unit number for simulation output
This module contains the SourceCommonModule.
Definition: SourceCommon.f90:7
logical(lgp) function, public filein_fname(filename, tagname, input_mempath, input_fname)
enforce and set a single input filename provided via FILEIN keyword
subroutine, public table_cr(this, name, title)
Definition: Table.f90:87
logical(lgp), pointer, public readnewdata
flag indicating time to read new data
Definition: tdis.f90:29
integer(i4b), pointer, public kstp
current time step number
Definition: tdis.f90:27
integer(i4b), pointer, public kper
current stress period number
Definition: tdis.f90:26
This module contains the base transport model type.
Definition: tsp.f90:7
subroutine, public xmvt_cr(mvt, name_exg, tsp_model1, tsp_model2, gwfmodelname1, gwfmodelname2, inunit, iout)
subroutine, public mvt_cr(mvt, name_model, inunit, iout, fmi1, eqnsclfac, depvartype, gwfmodelname1, gwfmodelname2, fmi2)
Definition: tsp-mvt.f90:85
Highest level model type. All models extend this parent type.
Definition: BaseModel.f90:16
This class is used to store a single deferred-length character string. It was designed to work in an ...
Definition: CharString.f90:23
Exchange based on connection between discretizations of DisBaseType. The data specifies the connectio...
Derived type for GwtExchangeType.
Definition: exg-gwtgwt.f90:47
A generic heterogeneous doubly-linked list.
Definition: List.f90:14