361
365 use chfgwfexchangemodule,
only:
chfgwf_cr
372 use olfgwfexchangemodule,
only:
olfgwf_cr
375
376
377
378 character(len=LENMEMPATH) :: input_mempath
379 type(CharacterStringType), dimension(:), contiguous, &
380 pointer :: etypes
381 type(CharacterStringType), dimension(:), contiguous, &
382 pointer :: efiles
383 type(CharacterStringType), dimension(:), contiguous, &
384 pointer :: emnames_a
385 type(CharacterStringType), dimension(:), contiguous, &
386 pointer :: emnames_b
387 type(CharacterStringType), dimension(:), contiguous, &
388 pointer :: emempaths
389 character(len=LINELENGTH) :: exgtype
390 integer(I4B) :: exg_id
391 integer(I4B) :: m1_id, m2_id
392 character(len=LINELENGTH) :: fname, name1, name2
393 character(len=LENEXCHANGENAME) :: exg_name
394 character(len=LENMEMPATH) :: exg_mempath
395 integer(I4B) :: n
396 character(len=LINELENGTH) :: errmsg
397 logical(LGP) :: terminate = .true.
398 logical(LGP) :: both_remote, both_local
399
400 character(len=*), parameter :: fmtmerr = "('Error in simulation control ', &
401 &'file. Could not find model: ', a)"
402
403
405
406
407 call mem_setptr(etypes,
'EXGTYPE', input_mempath)
408 call mem_setptr(efiles,
'EXGFILE', input_mempath)
409 call mem_setptr(emnames_a,
'EXGMNAMEA', input_mempath)
410 call mem_setptr(emnames_b,
'EXGMNAMEB', input_mempath)
411 call mem_setptr(emempaths,
'EXGMEMPATHS', input_mempath)
412
413
414 write (
iout,
'(/1x,a)')
'READING SIMULATION EXCHANGES'
415
416
417 exg_id = 0
418
419
420 do n = 1, size(etypes)
421
422
423 exgtype = etypes(n)
424 fname = efiles(n)
425 name1 = emnames_a(n)
426 name2 = emnames_b(n)
427 exg_mempath = emempaths(n)
428
429 exg_id = exg_id + 1
430
431
433 if (m1_id < 0) then
434 write (
errmsg, fmtmerr) trim(name1)
435 call store_error(
errmsg, terminate)
436 end if
438 if (m2_id < 0) then
439 write (
errmsg, fmtmerr) trim(name2)
440 call store_error(
errmsg, terminate)
441 end if
442
443
448 if (.not. both_remote) then
449 write (
iout,
'(4x,a,a,i0,a,i0,a,i0)') trim(exgtype),
' exchange ', &
450 exg_id, ' will be created to connect model ', m1_id, &
451 ' with model ', m2_id
452 end if
453
454 select case (exgtype)
455 case ('CHF6-GWF6')
456 write (exg_name, '(a,i0)') 'CHF-GWF_', exg_id
457 if (both_local) then
458 call chfgwf_cr(fname, exg_name, exg_id, m1_id, m2_id, exg_mempath)
459 end if
460 case ('GWF6-GWF6')
461 write (exg_name, '(a,i0)') 'GWF-GWF_', exg_id
462 if (.not. both_remote) then
464 exg_mempath)
465 end if
467 case ('GWF6-GWT6')
468 if (both_local) then
469 call gwfgwt_cr(fname, exg_id, m1_id, m2_id)
470 end if
471 case ('GWF6-GWE6')
472 if (both_local) then
473 call gwfgwe_cr(fname, exg_id, m1_id, m2_id)
474 end if
475 case ('GWF6-PRT6')
476 call gwfprt_cr(fname, exg_id, m1_id, m2_id)
477 case ('GWT6-GWT6')
478 write (exg_name, '(a,i0)') 'GWT-GWT_', exg_id
479 if (.not. both_remote) then
481 exg_mempath)
482 end if
484 "concentration")
485 case ('GWE6-GWE6')
486 write (exg_name, '(a,i0)') 'GWE-GWE_', exg_id
487 if (.not. both_remote) then
489 exg_mempath)
490 end if
492 "temperature")
493 case ('OLF6-GWF6')
494 write (exg_name, '(a,i0)') 'OLF-GWF_', exg_id
495 if (both_local) then
496 call olfgwf_cr(fname, exg_name, exg_id, m1_id, m2_id, exg_mempath)
497 end if
498 case default
500 'Unknown simulation exchange type: ', trim(exgtype)
501 call store_error(
errmsg, terminate)
502 end select
503 end do
504
505
506 write (
iout,
'(1x,a)')
'END OF SIMULATION EXCHANGES'
subroutine chfgwf_cr(filename, name, id, m1_id, m2_id, input_mempath)
Create CHF GWF exchange.
subroutine olfgwf_cr(filename, name, id, m1_id, m2_id, input_mempath)
Create OLF GWF exchange.
This module contains the GweGweExchangeModule Module.
subroutine, public gweexchange_create(filename, name, id, m1_id, m2_id, input_mempath)
Create GWT GWT exchange.
subroutine, public gwfgwe_cr(filename, id, m1_id, m2_id)
Create a new GWF to GWE exchange object.
This module contains the GwfGwfExchangeModule Module.
subroutine, public gwfexchange_create(filename, name, id, m1_id, m2_id, input_mempath)
Create GWF GWF exchange.
subroutine, public gwfgwt_cr(filename, id, m1_id, m2_id)
Create a new GWF to GWT exchange object.
subroutine, public gwfprt_cr(filename, id, m1id, m2id)
Create a new GWF to PRT exchange object.
This module contains the GwtGwtExchangeModule Module.
subroutine, public gwtexchange_create(filename, name, id, m1_id, m2_id, input_mempath)
Create GWT GWT exchange.
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
character(len=linelength) idm_context
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
character(len=lenmodelname), dimension(:), allocatable model_names
all model names in the (global) simulation
subroutine, public add_virtual_gwf_exchange(name, exchange_id, model1_id, model2_id)
Add a virtual GWF-GWF exchange to the simulation.
subroutine, public add_virtual_tsp_exchange(name, exchange_id, m1_id, m2_id, qtype)
Add a virtual GWT-GWT or GWE-GWE exchange to the simulation.