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)
108 call mem_set_value(this%ipakcb,
'IPAKCB', this%input_mempath, found%ipakcb)
109 call mem_set_value(this%iprpak,
'IPRPAK', this%input_mempath, found%iprpak)
110 call mem_set_value(this%iprflow,
'IPRFLOW', this%input_mempath, found%iprflow)
111 call mem_set_value(this%inamedbound,
'BOUNDNAMES', this%input_mempath, &
113 call mem_set_value(this%dev_ifmod_on,
'DEV_IFMOD_ON', this%input_mempath, &
117 if (found%naux .and. this%naux > 0)
then
119 'AUXNAME', this%memoryPath)
121 'AUXNAME_CST', this%memoryPath)
122 call mem_set_value(this%auxname_cst,
'AUXILIARY', this%input_mempath, &
126 this%auxname(n) = this%auxname_cst(n)
131 ival =
ifind(this%auxname,
'ANGLDEGX')
136 ival =
ifind(this%auxname,
'CDIST')
142 if (found%ipakcb)
then
144 write (iout,
'(4x,a)') &
145 'EXCHANGE FLOWS WILL BE SAVED TO BINARY BUDGET FILES.'
148 if (found%iprpak)
then
149 write (iout,
'(4x,a)') &
150 'THE LIST OF EXCHANGES WILL BE PRINTED.'
153 if (found%iprflow)
then
154 write (iout,
'(4x,a)') &
155 'EXCHANGE FLOWS WILL BE PRINTED TO LIST FILES.'
158 if (found%boundnames)
then
159 write (iout,
'(4x,a)')
'EXCHANGE BOUNDARIES HAVE NAMES IN LAST COLUMN'
162 if (found%dev_ifmod_on)
then
163 write (iout,
'(4x,2a)')
'Interface model coupling approach manually &
164 &activated for ', trim(this%name)
178 integer(I4B),
intent(in) :: iout
183 call mem_set_value(this%nexg,
'NEXG', this%input_mempath, found%nexg)
185 write (iout,
'(1x,a)')
'PROCESSING EXCHANGE DIMENSIONS'
188 write (iout,
'(4x,a,i0)')
'NEXG = ', this%nexg
191 write (iout,
'(1x,a)')
'END OF EXCHANGE DIMENSIONS'
199 function noder(this, model, cellid, iout)
205 integer(I4B),
dimension(:),
pointer,
intent(in) :: cellid
206 integer(I4B),
intent(in) :: iout
207 integer(I4B) ::
noder, node
209 if (model%dis%ndim == 1)
then
211 elseif (model%dis%ndim == 2)
then
212 node =
get_node(cellid(1), 1, cellid(2), &
213 model%dis%mshape(1), 1, &
216 node =
get_node(cellid(1), cellid(2), cellid(3), &
217 model%dis%mshape(1), &
218 model%dis%mshape(2), &
221 noder = model%dis%get_nodenumber(node, 0)
234 integer(I4B),
dimension(:),
pointer,
intent(in) :: cellid
235 integer(I4B),
intent(in) :: iout
237 character(len=*),
parameter :: fmtndim1 = &
239 character(len=*),
parameter :: fmtndim2 = &
240 "('(',i0,',',i0,')')"
241 character(len=*),
parameter :: fmtndim3 = &
242 "('(',i0,',',i0,',',i0,')')"
248 write (
cellstr, fmtndim1) cellid(1)
250 write (
cellstr, fmtndim2) cellid(1), cellid(2)
252 write (
cellstr, fmtndim3) cellid(1), cellid(2), cellid(3)
267 integer(I4B),
intent(in) :: iout
269 integer(I4B),
dimension(:, :),
contiguous,
pointer :: cellidm1
270 integer(I4B),
dimension(:, :),
contiguous,
pointer :: cellidm2
271 integer(I4B),
dimension(:),
contiguous,
pointer :: ihc
272 real(DP),
dimension(:),
contiguous,
pointer :: cl1
273 real(DP),
dimension(:),
contiguous,
pointer :: cl2
274 real(DP),
dimension(:),
contiguous,
pointer :: hwva
275 real(DP),
dimension(:, :),
contiguous,
pointer :: auxvar
277 integer(I4B) :: ndim1, ndim2
278 character(len=20) :: cellstr1, cellstr2
279 character(len=2) :: cnfloat
280 integer(I4B) :: nerr, iaux
281 integer(I4B) :: iexg, nodem1, nodem2
283 character(len=*),
parameter :: fmtexglabel =
"(1x, 3a10, 50(a16))"
284 character(len=*),
parameter :: fmtexgdata = &
285 "(5x, a, 1x, a ,I10, 50(1pg16.6))"
286 character(len=40) :: fmtexgdata2
288 call mem_setptr(cellidm1,
'CELLIDM1', this%input_mempath)
289 call mem_setptr(cellidm2,
'CELLIDM2', this%input_mempath)
290 call mem_setptr(ihc,
'IHC', this%input_mempath)
291 call mem_setptr(cl1,
'CL1', this%input_mempath)
292 call mem_setptr(cl2,
'CL2', this%input_mempath)
293 call mem_setptr(hwva,
'HWVA', this%input_mempath)
294 call mem_setptr(auxvar,
'AUXVAR', this%input_mempath)
295 call mem_setptr(boundname,
'BOUNDNAME', this%input_mempath)
296 ndim1 =
size(cellidm1, dim=1)
297 ndim2 =
size(cellidm2, dim=1)
299 write (iout,
'(1x,a)')
'PROCESSING EXCHANGEDATA'
301 if (this%iprpak /= 0)
then
302 if (this%inamedbound == 0)
then
303 write (iout, fmtexglabel)
'NODEM1',
'NODEM2',
'IHC', &
304 'CL1',
'CL2',
'HWVA', (adjustr(this%auxname(iaux)), &
307 write (iout, fmtexglabel)
'NODEM1',
'NODEM2',
'IHC',
'CL1',
'CL2', &
308 'HWVA', (adjustr(this%auxname(iaux)), iaux=1, this%naux), &
312 write (cnfloat,
'(i0)') 3 + this%naux
313 fmtexgdata2 =
'(5x, a, 1x, a, i10, '//trim(cnfloat)// &
318 do iexg = 1, this%nexg
320 if (
associated(this%model1))
then
323 nodem1 = this%noder(this%model1, cellidm1(:, iexg), iout)
324 this%nodem1(iexg) = nodem1
327 this%nodem1(iexg) = -1
330 if (
associated(this%model2))
then
333 nodem2 = this%noder(this%model2, cellidm2(:, iexg), iout)
334 this%nodem2(iexg) = nodem2
337 this%nodem2(iexg) = -1
341 this%ihc(iexg) = ihc(iexg)
342 this%cl1(iexg) = cl1(iexg)
343 this%cl2(iexg) = cl2(iexg)
344 this%hwva(iexg) = hwva(iexg)
345 do iaux = 1, this%naux
346 this%auxvar(iaux, iexg) = auxvar(iaux, iexg)
348 if (this%inamedbound == 1)
then
349 this%boundname(iexg) = boundname(iexg)
353 if (this%iprpak /= 0)
then
354 cellstr1 = this%cellstr(ndim1, cellidm1(:, iexg), iout)
355 cellstr2 = this%cellstr(ndim2, cellidm2(:, iexg), iout)
356 if (this%inamedbound == 0)
then
357 write (iout, fmtexgdata) trim(cellstr1), trim(cellstr2), &
358 this%ihc(iexg), this%cl1(iexg), this%cl2(iexg), &
360 (this%auxvar(iaux, iexg), iaux=1, this%naux)
362 write (iout, fmtexgdata2) trim(cellstr1), trim(cellstr2), &
363 this%ihc(iexg), this%cl1(iexg), this%cl2(iexg), &
365 (this%auxvar(iaux, iexg), iaux=1, this%naux), &
366 trim(this%boundname(iexg))
371 if (
associated(this%model1))
then
372 if (nodem1 <= 0)
then
373 cellstr1 = this%cellstr(ndim1, cellidm1(:, iexg), iout)
375 trim(adjustl(this%model1%name))// &
376 ' Cell is outside active grid domain ('// &
377 trim(adjustl(cellstr1))//
').'
383 if (
associated(this%model2))
then
384 if (nodem2 <= 0)
then
385 cellstr2 = this%cellstr(ndim2, cellidm2(:, iexg), iout)
387 trim(adjustl(this%model2%name))// &
388 ' Cell is outside active grid domain ('// &
389 trim(adjustl(cellstr2))//
').'
395 write (iout,
'(1x,a)')
'END OF EXCHANGEDATA'
400 call store_error(
'Errors encountered in exchange input file.')
416 allocate (this%filename)
421 call mem_allocate(this%ianglex,
'IANGLEX', this%memoryPath)
422 call mem_allocate(this%icdist,
'ICDIST', this%memoryPath)
424 call mem_allocate(this%iprpak,
'IPRPAK', this%memoryPath)
425 call mem_allocate(this%iprflow,
'IPRFLOW', this%memoryPath)
426 call mem_allocate(this%ipakcb,
'IPAKCB', this%memoryPath)
427 call mem_allocate(this%inamedbound,
'INAMEDBOUND', this%memoryPath)
428 call mem_allocate(this%dev_ifmod_on,
'DEV_IFMOD_ON', this%memoryPath)
431 'AUXNAME', this%memoryPath)
433 'AUXNAME_CST', this%memoryPath)
445 this%dev_ifmod_on = .false.
458 call mem_allocate(this%nodem1, this%nexg,
'NODEM1', this%memoryPath)
459 call mem_allocate(this%nodem2, this%nexg,
'NODEM2', this%memoryPath)
460 call mem_allocate(this%ihc, this%nexg,
'IHC', this%memoryPath)
461 call mem_allocate(this%cl1, this%nexg,
'CL1', this%memoryPath)
462 call mem_allocate(this%cl2, this%nexg,
'CL2', this%memoryPath)
463 call mem_allocate(this%hwva, this%nexg,
'HWVA', this%memoryPath)
466 'AUXVAR', this%memoryPath)
469 if (this%inamedbound == 1)
then
470 allocate (this%boundname(this%nexg))
472 allocate (this%boundname(1))
474 this%boundname(:) =
''
487 logical(LGP) :: use_im
491 use_im = .not. (this%v_model1%is_local .and. this%v_model2%is_local)
514 deallocate (this%boundname)
520 call mem_deallocate(this%auxname_cst,
'AUXNAME_CST', this%memoryPath)
537 class(*),
pointer,
intent(inout) :: obj
542 if (.not.
associated(obj))
return
556 type(
listtype),
intent(inout) :: list
559 class(*),
pointer :: obj
571 type(
listtype),
intent(inout) :: list
572 integer(I4B),
intent(in) :: idx
576 class(*),
pointer :: obj
578 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.
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.