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