319 class(GwfGweExchangeType) :: this
320 type(GwfModelType),
pointer :: gwfModel
321 type(GweModelType),
pointer :: gweModel
323 class(SpatialModelConnectionType),
pointer :: conn => null()
324 class(*),
pointer :: objPtr => null()
325 class(GweGweConnectionType),
pointer :: gweConn => null()
326 class(GwfGwfConnectionType),
pointer :: gwfConn => null()
327 class(GwfExchangeType),
pointer :: gwfEx => null()
328 integer(I4B) :: ic1, ic2, iex
329 integer(I4B) :: gwfConnIdx, gwfExIdx
330 logical(LGP) :: areEqual
333 gweloop:
do ic1 = 1, baseconnectionlist%Count()
335 conn => get_smc_from_list(baseconnectionlist, ic1)
336 if (.not.
associated(conn%owner, gwemodel)) cycle gweloop
340 gweconn => castasgwegweconnection(objptr)
345 gwfloop:
do ic2 = 1, baseconnectionlist%Count()
346 conn => get_smc_from_list(baseconnectionlist, ic2)
348 if (
associated(conn%owner, gwfmodel))
then
350 gwfconn => castasgwfgwfconnection(objptr)
356 if (gwfconn%gwfExchange%v_model1%name /= &
357 gweconn%gweExchange%gwfmodelname1) cycle
358 if (gwfconn%gwfExchange%v_model2%name /= &
359 gweconn%gweExchange%gwfmodelname2) cycle
363 areequal = (gwfconn%gwfExchange%nexg == gweconn%gweExchange%nexg)
365 areequal = all(gwfconn%prim_exchange%nodem1 == &
366 gweconn%prim_exchange%nodem1)
367 areequal = areequal .and. all(gwfconn%prim_exchange%nodem2 == &
368 gweconn%prim_exchange%nodem2)
372 write (
iout,
'(/6a)')
'Linking exchange ', &
373 trim(gweconn%prim_exchange%name), &
374 ' to ', trim(gwfconn%prim_exchange%name), &
375 ' (using interface model) for GWE model ', &
378 call this%link_connections(gweconn, gwfconn)
386 if (gwfconnidx == -1)
then
387 gwfloopexg:
do iex = 1, baseexchangelist%Count()
388 gwfex => getgwfexchangefromlist(baseexchangelist, iex)
392 if (.not.
associated(gwfex)) cycle gwfloopexg
394 if (
associated(gwfex%model1, gwfmodel) .or. &
395 associated(gwfex%model2, gwfmodel))
then
400 if (gwfex%v_model1%name /= gweconn%gweExchange%gwfmodelname1) cycle
401 if (gwfex%v_model2%name /= gweconn%gweExchange%gwfmodelname2) cycle
404 areequal =
size(gwfex%nodem1) ==
size(gweconn%prim_exchange%nodem1)
408 areequal = all(gwfex%nodem1 == gweconn%prim_exchange%nodem1)
410 areequal = all(gwfex%nodem2 == gweconn%prim_exchange%nodem2)
413 write (
iout,
'(/6a)')
'Linking exchange ', &
414 trim(gweconn%prim_exchange%name), &
415 ' to ', trim(gwfex%name),
' for GWE model ', &
418 if (gweconn%owns_exchange)
then
419 gweconn%gweExchange%gwfsimvals => gwfex%simvals
421 'GWFSIMVALS', gweconn%gweExchange%memoryPath, &
422 'SIMVALS', gwfex%memoryPath)
426 if (gwfex%inmvr > 0)
then
427 if (gweconn%owns_exchange)
then
429 call gweconn%gweExchange%mvt%set_pointer_mvrbudobj( &
434 if (
associated(gwfex%model2, gwfmodel)) gweconn%exgflowSign = -1
435 gweconn%gweInterfaceModel%fmi%flows_from_file = .false.
444 if (gwfconnidx == -1 .and. gwfexidx == -1)
then
446 write (errmsg,
'(/6a)')
'Missing GWF-GWF exchange when connecting GWE'// &
447 ' model ', trim(gwemodel%name),
' with exchange ', &
448 trim(gweconn%prim_exchange%name),
' to GWF model ', &
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
This module contains simulation variables.
integer(i4b) iout
file unit number for simulation output