285 class(GwfGwtExchangeType) :: this
286 type(GwfModelType),
pointer :: gwfModel
287 type(GwtModelType),
pointer :: gwtModel
289 class(SpatialModelConnectionType),
pointer :: conn => null()
290 class(*),
pointer :: objPtr => null()
291 class(GwtGwtConnectionType),
pointer :: gwtConn => null()
292 class(GwfGwfConnectionType),
pointer :: gwfConn => null()
293 class(GwfExchangeType),
pointer :: gwfExg => null()
294 class(GwtExchangeType),
pointer :: gwtExg => null()
295 integer(I4B) :: ic1, ic2, iex
296 integer(I4B) :: gwfConnIdx, gwfExIdx
297 logical(LGP) :: areEqual
300 gwtloop:
do ic1 = 1, baseconnectionlist%Count()
302 conn => get_smc_from_list(baseconnectionlist, ic1)
303 if (.not.
associated(conn%owner, gwtmodel)) cycle gwtloop
307 gwtconn => castasgwtgwtconnection(objptr)
308 gwtexg => gwtconn%gwtExchange
313 gwfloop:
do ic2 = 1, baseconnectionlist%Count()
314 conn => get_smc_from_list(baseconnectionlist, ic2)
316 if (
associated(conn%owner, gwfmodel))
then
319 gwfconn => castasgwfgwfconnection(objptr)
320 gwfexg => gwfconn%gwfExchange
330 if (gwfexg%v_model1%name /= gwtexg%gwfmodelname1) cycle
331 if (gwfexg%v_model2%name /= gwtexg%gwfmodelname2) cycle
333 areequal = (gwfexg%nexg == gwtexg%nexg)
335 areequal = all(gwfexg%nodem1 == gwtexg%nodem1)
336 areequal = areequal .and. all(gwfexg%nodem2 == gwtexg%nodem2)
340 write (
iout,
'(/6a)')
'Linking exchange ', &
341 trim(gwtexg%name),
' to ', trim(gwfexg%name), &
342 ' (using interface model) for GWT model ', &
345 call this%link_connections(gwtconn, gwfconn)
354 if (gwfconnidx == -1)
then
355 gwfloopexg:
do iex = 1, baseexchangelist%Count()
356 gwfexg => getgwfexchangefromlist(baseexchangelist, iex)
358 if (.not.
associated(gwfexg)) cycle gwfloopexg
360 if (
associated(gwfexg%model1, gwfmodel) .or. &
361 associated(gwfexg%model2, gwfmodel))
then
363 if (gwfexg%v_model1%name /= gwtexg%gwfmodelname1) cycle
364 if (gwfexg%v_model2%name /= gwtexg%gwfmodelname2) cycle
366 areequal = (gwfexg%nexg == gwtexg%nexg)
369 areequal = all(gwfexg%nodem1 == gwtexg%nodem1)
370 areequal = areequal .and. all(gwfexg%nodem2 == gwtexg%nodem2)
374 write (
iout,
'(/6a)')
'Linking exchange ', &
375 trim(gwtexg%name),
' to ', trim(gwfexg%name),
' for GWT model ', &
378 if (gwtconn%owns_exchange)
then
379 gwtexg%gwfsimvals => gwfexg%simvals
381 'GWFSIMVALS', gwtexg%memoryPath, &
382 'SIMVALS', gwfexg%memoryPath)
386 if (gwfexg%inmvr > 0)
then
387 if (gwtconn%owns_exchange)
then
389 call gwtexg%mvt%set_pointer_mvrbudobj(gwfexg%mvr%budobj)
393 if (
associated(gwfexg%model2, gwfmodel)) gwtconn%exgflowSign = -1
394 gwtconn%gwtInterfaceModel%fmi%flows_from_file = .false.
403 if (gwfconnidx == -1 .and. gwfexidx == -1)
then
405 write (errmsg, *)
'Cannot find GWF-GWF exchange when connecting'// &
406 ' GWT model ', trim(gwtmodel%name),
' with exchange ', &
407 trim(gwtexg%name),
' to GWF model ', trim(gwfmodel%name), &
408 '. Note: GWF-GWF and GWT-GWT need identical exchange data '// &
409 '(both in value and order) for the match to succeed.'
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
integer(i4b) function, public count_errors()
Return number of errors.
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.
This module contains simulation variables.
integer(i4b) iout
file unit number for simulation output