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