20 integer(I4B),
pointer :: m1id => null()
21 integer(I4B),
pointer :: m2id => null()
43 character(len=*),
intent(in) :: filename
44 integer(I4B),
intent(in) :: id
45 integer(I4B),
intent(in) :: m1id
46 integer(I4B),
intent(in) :: m2id
50 character(len=20) :: cint
54 baseexchange => exchange
59 write (cint,
'(i0)') id
60 exchange%name =
'GWF-PRT_'//trim(adjustl(cint))
61 exchange%memoryPath = exchange%name
64 call exchange%allocate_scalars()
71 call exchange%set_model_pointers()
98 if (.not.
associated(gwfmodel))
then
99 write (
errmsg,
'(3a)')
'Problem with GWF-PRT exchange ', trim(this%name), &
100 '. Specified GWF Model does not appear to be of the correct type.'
105 if (.not.
associated(prtmodel))
then
106 write (
errmsg,
'(3a)')
'Problem with GWF-PRT exchange ', trim(this%name), &
107 '. Specified PRT Model does not appear to be of the correct type.'
112 prtmodel%fmi%flows_from_file = .false.
116 prtmodel%fmi%gwfbndlist => gwfmodel%bndlist
128 integer(I4B) :: ngwfpack, ip
129 class(
bndtype),
pointer :: packobj => null()
148 if (gwfmodel%idsoln >= prtmodel%idsoln)
then
149 write (
errmsg,
'(3a)')
'Problem with GWF-PRT exchange ', trim(this%name), &
150 '. The GWF model must be solved by a different solution than the PRT model. &
151 &The IMS specified for GWF must be listed in mfsim.nam &
152 &before the EMS for PRT.'
157 prtmodel%fmi%gwfflowja => gwfmodel%flowja
159 'GWFFLOWJA', prtmodel%fmi%memoryPath, &
160 'FLOWJA', gwfmodel%memoryPath)
164 if (prtmodel%indsp > 0)
then
165 gwfmodel%npf%icalcspdis = 1
169 ngwfpack = gwfmodel%bndlist%Count()
172 call prtmodel%fmi%gwfpackages(ip)%set_auxname(packobj%naux, &
190 character(len=*),
parameter :: fmtdiserr = &
191 "('GWF and PRT Models do not have the same discretization for exchange&
193 & GWF Model has ', i0, ' user nodes and ', i0, ' reduced nodes.&
194 & PRT Model has ', i0, ' user nodes and ', i0, ' reduced nodes.&
195 & Ensure discretization packages, including IDOMAIN, are identical.')"
196 character(len=*),
parameter :: fmtidomerr = &
197 "('GWF and PRT Models do not have the same discretization for exchange&
199 & GWF Model and PRT Model have different IDOMAIN arrays.&
200 & Ensure discretization packages, including IDOMAIN, are identical.')"
217 if (prtmodel%dis%nodes /= gwfmodel%dis%nodes .or. &
218 prtmodel%dis%nodesuser /= gwfmodel%dis%nodesuser)
then
219 write (
errmsg, fmtdiserr) trim(this%name), &
220 gwfmodel%dis%nodesuser, &
221 gwfmodel%dis%nodes, &
222 prtmodel%dis%nodesuser, &
228 select type (gwfdis => gwfmodel%dis)
230 select type (prtdis => prtmodel%dis)
232 if (.not. all(gwfdis%idomain == prtdis%idomain))
then
233 write (
errmsg, fmtidomerr) trim(this%name)
238 select type (prtdis => prtmodel%dis)
240 if (.not. all(gwfdis%idomain == prtdis%idomain))
then
241 write (
errmsg, fmtidomerr) trim(this%name)
246 select type (prtdis => prtmodel%dis)
248 if (.not. all(gwfdis%idomain == prtdis%idomain))
then
249 write (
errmsg, fmtidomerr) trim(this%name)
256 prtmodel%fmi%gwfhead => gwfmodel%x
258 'GWFHEAD', prtmodel%fmi%memoryPath, &
259 'X', gwfmodel%memoryPath)
260 prtmodel%fmi%gwfsat => gwfmodel%npf%sat
262 'GWFSAT', prtmodel%fmi%memoryPath, &
263 'SAT', gwfmodel%npf%memoryPath)
264 prtmodel%fmi%gwfspdis => gwfmodel%npf%spdis
266 'GWFSPDIS', prtmodel%fmi%memoryPath, &
267 'SPDIS', gwfmodel%npf%memoryPath)
271 if (prtmodel%inmst > 0)
then
272 if (gwfmodel%insto > 0)
then
273 prtmodel%fmi%gwfstrgss => gwfmodel%sto%strgss
274 prtmodel%fmi%igwfstrgss = 1
275 if (gwfmodel%sto%iusesy == 1)
then
276 prtmodel%fmi%gwfstrgsy => gwfmodel%sto%strgsy
277 prtmodel%fmi%igwfstrgsy = 1
283 call this%gwfbnd2prtfmi()
286 if (gwfmodel%inmvr /= 0) &
287 prtmodel%fmi%mvrbudobj => gwfmodel%mvr%budobj
323 integer(I4B) :: ngwfpack, ip, iterm, imover
327 class(
bndtype),
pointer :: packobj => null()
345 ngwfpack = gwfmodel%bndlist%Count()
349 call prtmodel%fmi%gwfpackages(iterm)%set_pointers( &
351 packobj%memoryPath, &
352 packobj%input_mempath)
357 imover = packobj%imover
358 if (packobj%isadvpak /= 0) imover = 0
359 if (imover /= 0)
then
360 call prtmodel%fmi%gwfpackages(iterm)%set_pointers( &
362 packobj%memoryPath, &
363 packobj%input_mempath)
subroutine, public addbaseexchangetolist(list, exchange)
Add the exchange object (BaseExchangeType) to a list.
class(basemodeltype) function, pointer, public getbasemodelfromlist(list, idx)
This module contains the base boundary package.
class(bndtype) function, pointer, public getbndfromlist(list, idx)
Get boundary from package list.
This module contains simulation constants.
integer(i4b), parameter lenpackagename
maximum length of the package name
subroutine, public gwfprt_cr(filename, id, m1id, m2id)
Create a new GWF to PRT exchange object.
subroutine gwfbnd2prtfmi(this)
subroutine allocate_scalars(this)
subroutine set_model_pointers(this)
This module defines variable data types.
type(listtype), public basemodellist
type(listtype), public baseexchangelist
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
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)
Highest level model type. All models extend this parent type.
Structured grid discretization.
Unstructured grid discretization.
Vertex grid discretization.
Particle tracking (PRT) model.