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