24 character(len=LINELENGTH),
pointer :: filename => null()
30 logical(LGP) :: is_datacopy
33 integer(I4B),
pointer :: nexg => null()
34 integer(I4B),
dimension(:),
pointer,
contiguous :: nodem1 => null()
35 integer(I4B),
dimension(:),
pointer,
contiguous :: nodem2 => null()
36 integer(I4B),
dimension(:),
pointer,
contiguous :: ihc => null()
37 real(dp),
dimension(:),
pointer,
contiguous :: cl1 => null()
38 real(dp),
dimension(:),
pointer,
contiguous :: cl2 => null()
39 real(dp),
dimension(:),
pointer,
contiguous :: hwva => null()
40 integer(I4B),
pointer :: naux => null()
41 character(len=LENBOUNDNAME),
dimension(:), &
42 pointer,
contiguous :: boundname => null()
44 character(len=LENAUXNAME),
dimension(:), &
45 pointer,
contiguous :: auxname => null()
47 contiguous :: auxname_cst => null()
48 real(dp),
dimension(:, :),
pointer,
contiguous :: auxvar => null()
49 integer(I4B),
pointer :: ianglex => null()
50 integer(I4B),
pointer :: icdist => null()
51 integer(I4B),
pointer :: iprpak => null()
52 integer(I4B),
pointer :: iprflow => null()
53 integer(I4B),
pointer :: ipakcb => null()
54 integer(I4B),
pointer :: inamedbound => null()
56 integer(I4B),
pointer :: ixt3d => null()
57 logical(LGP),
pointer :: dev_ifmod_on
81 logical :: naux = .false.
82 logical :: ipakcb = .false.
83 logical :: iprpak = .false.
84 logical :: iprflow = .false.
85 logical :: boundnames = .false.
86 logical :: auxiliary = .false.
87 logical :: dev_ifmod_on = .false.
88 logical :: nexg = .false.
101 integer(I4B),
intent(in) :: iout
104 integer(I4B) :: ival, n
107 call mem_set_value(this%naux,
'NAUX', this%input_mempath, found%naux, &
109 call mem_set_value(this%ipakcb,
'IPAKCB', this%input_mempath, found%ipakcb)
110 call mem_set_value(this%iprpak,
'IPRPAK', this%input_mempath, found%iprpak)
111 call mem_set_value(this%iprflow,
'IPRFLOW', this%input_mempath, found%iprflow)
112 call mem_set_value(this%inamedbound,
'BOUNDNAMES', this%input_mempath, &
113 found%boundnames, release=.false.)
114 call mem_set_value(this%dev_ifmod_on,
'DEV_IFMOD_ON', this%input_mempath, &
118 if (found%naux .and. this%naux > 0)
then
120 'AUXNAME', this%memoryPath)
122 'AUXNAME_CST', this%memoryPath)
123 call mem_set_value(this%auxname_cst,
'AUXILIARY', this%input_mempath, &
124 found%auxiliary, release=.false.)
127 this%auxname(n) = this%auxname_cst(n)
132 ival =
ifind(this%auxname,
'ANGLDEGX')
137 ival =
ifind(this%auxname,
'CDIST')
143 if (found%ipakcb)
then
145 write (iout,
'(4x,a)') &
146 'EXCHANGE FLOWS WILL BE SAVED TO BINARY BUDGET FILES.'
149 if (found%iprpak)
then
150 write (iout,
'(4x,a)') &
151 'THE LIST OF EXCHANGES WILL BE PRINTED.'
154 if (found%iprflow)
then
155 write (iout,
'(4x,a)') &
156 'EXCHANGE FLOWS WILL BE PRINTED TO LIST FILES.'
159 if (found%boundnames)
then
160 write (iout,
'(4x,a)')
'EXCHANGE BOUNDARIES HAVE NAMES IN LAST COLUMN'
163 if (found%dev_ifmod_on)
then
164 write (iout,
'(4x,2a)')
'Interface model coupling approach manually &
165 &activated for ', trim(this%name)
176 integer(I4B),
intent(in) :: iout
181 call mem_set_value(this%nexg,
'NEXG', this%input_mempath, found%nexg)
183 write (iout,
'(1x,a)')
'PROCESSING EXCHANGE DIMENSIONS'
186 write (iout,
'(4x,a,i0)')
'NEXG = ', this%nexg
189 write (iout,
'(1x,a)')
'END OF EXCHANGE DIMENSIONS'
194 function noder(this, model, cellid, iout)
200 integer(I4B),
dimension(:),
intent(in) :: cellid
201 integer(I4B),
intent(in) :: iout
202 integer(I4B) ::
noder, node
204 if (model%dis%ndim == 1)
then
206 elseif (model%dis%ndim == 2)
then
207 node =
get_node(cellid(1), 1, cellid(2), &
208 model%dis%mshape(1), 1, &
211 node =
get_node(cellid(1), cellid(2), cellid(3), &
212 model%dis%mshape(1), &
213 model%dis%mshape(2), &
216 noder = model%dis%get_nodenumber(node, 0)
226 integer(I4B),
dimension(:),
intent(in) :: cellid
227 integer(I4B),
intent(in) :: iout
229 character(len=*),
parameter :: fmtndim1 = &
231 character(len=*),
parameter :: fmtndim2 = &
232 "('(',i0,',',i0,')')"
233 character(len=*),
parameter :: fmtndim3 = &
234 "('(',i0,',',i0,',',i0,')')"
240 write (
cellstr, fmtndim1) cellid(1)
242 write (
cellstr, fmtndim2) cellid(1), cellid(2)
244 write (
cellstr, fmtndim3) cellid(1), cellid(2), cellid(3)
257 integer(I4B),
intent(in) :: iout
259 integer(I4B),
dimension(:, :),
contiguous,
pointer :: cellidm1
260 integer(I4B),
dimension(:, :),
contiguous,
pointer :: cellidm2
261 integer(I4B),
dimension(:),
contiguous,
pointer :: ihc
262 real(DP),
dimension(:),
contiguous,
pointer :: cl1
263 real(DP),
dimension(:),
contiguous,
pointer :: cl2
264 real(DP),
dimension(:),
contiguous,
pointer :: hwva
265 real(DP),
dimension(:, :),
contiguous,
pointer :: auxvar
267 integer(I4B) :: ndim1, ndim2
268 character(len=20) :: cellstr1, cellstr2
269 character(len=2) :: cnfloat
270 integer(I4B) :: nerr, iaux
271 integer(I4B) :: iexg, nodem1, nodem2
273 character(len=*),
parameter :: fmtexglabel =
"(1x, 3a10, 50(a16))"
274 character(len=*),
parameter :: fmtexgdata = &
275 "(5x, a, 1x, a ,I10, 50(1pg16.6))"
276 character(len=40) :: fmtexgdata2
278 call mem_setptr(cellidm1,
'CELLIDM1', this%input_mempath)
279 call mem_setptr(cellidm2,
'CELLIDM2', this%input_mempath)
280 call mem_setptr(ihc,
'IHC', this%input_mempath)
281 call mem_setptr(cl1,
'CL1', this%input_mempath)
282 call mem_setptr(cl2,
'CL2', this%input_mempath)
283 call mem_setptr(hwva,
'HWVA', this%input_mempath)
284 call mem_setptr(auxvar,
'AUXVAR', this%input_mempath)
285 call mem_setptr(boundname,
'BOUNDNAME', this%input_mempath)
286 ndim1 =
size(cellidm1, dim=1)
287 ndim2 =
size(cellidm2, dim=1)
289 write (iout,
'(1x,a)')
'PROCESSING EXCHANGEDATA'
291 if (this%iprpak /= 0)
then
292 if (this%inamedbound == 0)
then
293 write (iout, fmtexglabel)
'NODEM1',
'NODEM2',
'IHC', &
294 'CL1',
'CL2',
'HWVA', (adjustr(this%auxname(iaux)), &
297 write (iout, fmtexglabel)
'NODEM1',
'NODEM2',
'IHC',
'CL1',
'CL2', &
298 'HWVA', (adjustr(this%auxname(iaux)), iaux=1, this%naux), &
302 write (cnfloat,
'(i0)') 3 + this%naux
303 fmtexgdata2 =
'(5x, a, 1x, a, i10, '//trim(cnfloat)// &
308 do iexg = 1, this%nexg
310 if (
associated(this%model1))
then
313 nodem1 = this%noder(this%model1, cellidm1(:, iexg), iout)
314 this%nodem1(iexg) = nodem1
317 this%nodem1(iexg) = -1
320 if (
associated(this%model2))
then
323 nodem2 = this%noder(this%model2, cellidm2(:, iexg), iout)
324 this%nodem2(iexg) = nodem2
327 this%nodem2(iexg) = -1
331 this%ihc(iexg) = ihc(iexg)
332 this%cl1(iexg) = cl1(iexg)
333 this%cl2(iexg) = cl2(iexg)
334 this%hwva(iexg) = hwva(iexg)
335 do iaux = 1, this%naux
336 this%auxvar(iaux, iexg) = auxvar(iaux, iexg)
338 if (this%inamedbound == 1)
then
339 this%boundname(iexg) = boundname(iexg)
343 if (this%iprpak /= 0)
then
344 cellstr1 = this%cellstr(ndim1, cellidm1(:, iexg), iout)
345 cellstr2 = this%cellstr(ndim2, cellidm2(:, iexg), iout)
346 if (this%inamedbound == 0)
then
347 write (iout, fmtexgdata) trim(cellstr1), trim(cellstr2), &
348 this%ihc(iexg), this%cl1(iexg), this%cl2(iexg), &
350 (this%auxvar(iaux, iexg), iaux=1, this%naux)
352 write (iout, fmtexgdata2) trim(cellstr1), trim(cellstr2), &
353 this%ihc(iexg), this%cl1(iexg), this%cl2(iexg), &
355 (this%auxvar(iaux, iexg), iaux=1, this%naux), &
356 trim(this%boundname(iexg))
361 if (
associated(this%model1))
then
362 if (nodem1 <= 0)
then
363 cellstr1 = this%cellstr(ndim1, cellidm1(:, iexg), iout)
365 trim(adjustl(this%model1%name))// &
366 ' Cell is outside active grid domain ('// &
367 trim(adjustl(cellstr1))//
').'
373 if (
associated(this%model2))
then
374 if (nodem2 <= 0)
then
375 cellstr2 = this%cellstr(ndim2, cellidm2(:, iexg), iout)
377 trim(adjustl(this%model2%name))// &
378 ' Cell is outside active grid domain ('// &
379 trim(adjustl(cellstr2))//
').'
385 write (iout,
'(1x,a)')
'END OF EXCHANGEDATA'
390 call store_error(
'Errors encountered in exchange input file.')
412 allocate (this%filename)
417 call mem_allocate(this%ianglex,
'IANGLEX', this%memoryPath)
418 call mem_allocate(this%icdist,
'ICDIST', this%memoryPath)
420 call mem_allocate(this%iprpak,
'IPRPAK', this%memoryPath)
421 call mem_allocate(this%iprflow,
'IPRFLOW', this%memoryPath)
422 call mem_allocate(this%ipakcb,
'IPAKCB', this%memoryPath)
423 call mem_allocate(this%inamedbound,
'INAMEDBOUND', this%memoryPath)
424 call mem_allocate(this%dev_ifmod_on,
'DEV_IFMOD_ON', this%memoryPath)
427 'AUXNAME', this%memoryPath)
429 'AUXNAME_CST', this%memoryPath)
441 this%dev_ifmod_on = .false.
451 call mem_allocate(this%nodem1, this%nexg,
'NODEM1', this%memoryPath)
452 call mem_allocate(this%nodem2, this%nexg,
'NODEM2', this%memoryPath)
453 call mem_allocate(this%ihc, this%nexg,
'IHC', this%memoryPath)
454 call mem_allocate(this%cl1, this%nexg,
'CL1', this%memoryPath)
455 call mem_allocate(this%cl2, this%nexg,
'CL2', this%memoryPath)
456 call mem_allocate(this%hwva, this%nexg,
'HWVA', this%memoryPath)
459 'AUXVAR', this%memoryPath)
462 if (this%inamedbound == 1)
then
463 allocate (this%boundname(this%nexg))
465 allocate (this%boundname(1))
467 this%boundname(:) =
''
477 logical(LGP) :: use_im
481 use_im = .not. (this%v_model1%is_local .and. this%v_model2%is_local)
501 deallocate (this%boundname)
507 call mem_deallocate(this%auxname_cst,
'AUXNAME_CST', this%memoryPath)
521 class(*),
pointer,
intent(inout) :: obj
526 if (.not.
associated(obj))
return
537 type(
listtype),
intent(inout) :: list
540 class(*),
pointer :: obj
549 type(
listtype),
intent(inout) :: list
550 integer(I4B),
intent(in) :: idx
554 class(*),
pointer :: obj
556 obj => list%GetItem(idx)
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
integer(i4b), parameter lenauxname
maximum length of a aux variable
integer(i4b), parameter lenboundname
maximum length of a bound name
integer(i4b) function noder(this, model, cellid, iout)
Returns reduced node number from user.
logical(lgp) function use_interface_model(this)
Should interface model be used to handle these exchanges, to be overridden for inheriting types.
subroutine, public adddisconnexchangetolist(list, exchange)
character(len=20) function cellstr(this, ndim, cellid, iout)
subroutine allocate_scalars(this)
Allocate scalars and initialize to defaults.
class(disconnexchangetype) function, pointer, public getdisconnexchangefromlist(list, idx)
subroutine allocate_arrays(this)
Allocate array data, using the number of connected nodes.
subroutine source_options(this, iout)
Source options from input context.
class(disconnexchangetype) function, pointer, public castasdisconnexchangeclass(obj)
subroutine disconnex_da(this)
Clean up all scalars and arrays.
subroutine source_data(this, iout)
Source exchange data from input context.
subroutine source_dimensions(this, iout)
Source dimension from input context.
integer(i4b) function, public get_node(ilay, irow, icol, nlay, nrow, ncol)
Get node number, given layer, row, and column indices for a structured grid. If any argument is inval...
This module defines variable data types.
subroutine, public memorystore_release(varname, memory_path)
Release a single variable from the memory store.
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.
character(len=maxcharlen) errmsg
error message string
This class is used to store a single deferred-length character string. It was designed to work in an ...
@ brief DisConnExchangeFoundType
Exchange based on connection between discretizations of DisBaseType. The data specifies the connectio...
A generic heterogeneous doubly-linked list.