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)
175 integer(I4B),
intent(in) :: iout
180 call mem_set_value(this%nexg,
'NEXG', this%input_mempath, found%nexg)
182 write (iout,
'(1x,a)')
'PROCESSING EXCHANGE DIMENSIONS'
185 write (iout,
'(4x,a,i0)')
'NEXG = ', this%nexg
188 write (iout,
'(1x,a)')
'END OF EXCHANGE DIMENSIONS'
193 function noder(this, model, cellid, iout)
199 integer(I4B),
dimension(:),
intent(in) :: cellid
200 integer(I4B),
intent(in) :: iout
201 integer(I4B) ::
noder, node
203 if (model%dis%ndim == 1)
then
205 elseif (model%dis%ndim == 2)
then
206 node =
get_node(cellid(1), 1, cellid(2), &
207 model%dis%mshape(1), 1, &
210 node =
get_node(cellid(1), cellid(2), cellid(3), &
211 model%dis%mshape(1), &
212 model%dis%mshape(2), &
215 noder = model%dis%get_nodenumber(node, 0)
225 integer(I4B),
dimension(:),
intent(in) :: cellid
226 integer(I4B),
intent(in) :: iout
228 character(len=*),
parameter :: fmtndim1 = &
230 character(len=*),
parameter :: fmtndim2 = &
231 "('(',i0,',',i0,')')"
232 character(len=*),
parameter :: fmtndim3 = &
233 "('(',i0,',',i0,',',i0,')')"
239 write (
cellstr, fmtndim1) cellid(1)
241 write (
cellstr, fmtndim2) cellid(1), cellid(2)
243 write (
cellstr, fmtndim3) cellid(1), cellid(2), cellid(3)
255 integer(I4B),
intent(in) :: iout
257 integer(I4B),
dimension(:, :),
contiguous,
pointer :: cellidm1
258 integer(I4B),
dimension(:, :),
contiguous,
pointer :: cellidm2
259 integer(I4B),
dimension(:),
contiguous,
pointer :: ihc
260 real(DP),
dimension(:),
contiguous,
pointer :: cl1
261 real(DP),
dimension(:),
contiguous,
pointer :: cl2
262 real(DP),
dimension(:),
contiguous,
pointer :: hwva
263 real(DP),
dimension(:, :),
contiguous,
pointer :: auxvar
265 integer(I4B) :: ndim1, ndim2
266 character(len=20) :: cellstr1, cellstr2
267 character(len=2) :: cnfloat
268 integer(I4B) :: nerr, iaux
269 integer(I4B) :: iexg, nodem1, nodem2
271 character(len=*),
parameter :: fmtexglabel =
"(1x, 3a10, 50(a16))"
272 character(len=*),
parameter :: fmtexgdata = &
273 "(5x, a, 1x, a ,I10, 50(1pg16.6))"
274 character(len=40) :: fmtexgdata2
276 call mem_setptr(cellidm1,
'CELLIDM1', this%input_mempath)
277 call mem_setptr(cellidm2,
'CELLIDM2', this%input_mempath)
278 call mem_setptr(ihc,
'IHC', this%input_mempath)
279 call mem_setptr(cl1,
'CL1', this%input_mempath)
280 call mem_setptr(cl2,
'CL2', this%input_mempath)
281 call mem_setptr(hwva,
'HWVA', this%input_mempath)
282 call mem_setptr(auxvar,
'AUXVAR', this%input_mempath)
283 call mem_setptr(boundname,
'BOUNDNAME', this%input_mempath)
284 ndim1 =
size(cellidm1, dim=1)
285 ndim2 =
size(cellidm2, dim=1)
287 write (iout,
'(1x,a)')
'PROCESSING EXCHANGEDATA'
289 if (this%iprpak /= 0)
then
290 if (this%inamedbound == 0)
then
291 write (iout, fmtexglabel)
'NODEM1',
'NODEM2',
'IHC', &
292 'CL1',
'CL2',
'HWVA', (adjustr(this%auxname(iaux)), &
295 write (iout, fmtexglabel)
'NODEM1',
'NODEM2',
'IHC',
'CL1',
'CL2', &
296 'HWVA', (adjustr(this%auxname(iaux)), iaux=1, this%naux), &
300 write (cnfloat,
'(i0)') 3 + this%naux
301 fmtexgdata2 =
'(5x, a, 1x, a, i10, '//trim(cnfloat)// &
306 do iexg = 1, this%nexg
308 if (
associated(this%model1))
then
311 nodem1 = this%noder(this%model1, cellidm1(:, iexg), iout)
312 this%nodem1(iexg) = nodem1
315 this%nodem1(iexg) = -1
318 if (
associated(this%model2))
then
321 nodem2 = this%noder(this%model2, cellidm2(:, iexg), iout)
322 this%nodem2(iexg) = nodem2
325 this%nodem2(iexg) = -1
329 this%ihc(iexg) = ihc(iexg)
330 this%cl1(iexg) = cl1(iexg)
331 this%cl2(iexg) = cl2(iexg)
332 this%hwva(iexg) = hwva(iexg)
333 do iaux = 1, this%naux
334 this%auxvar(iaux, iexg) = auxvar(iaux, iexg)
336 if (this%inamedbound == 1)
then
337 this%boundname(iexg) = boundname(iexg)
341 if (this%iprpak /= 0)
then
342 cellstr1 = this%cellstr(ndim1, cellidm1(:, iexg), iout)
343 cellstr2 = this%cellstr(ndim2, cellidm2(:, iexg), iout)
344 if (this%inamedbound == 0)
then
345 write (iout, fmtexgdata) trim(cellstr1), trim(cellstr2), &
346 this%ihc(iexg), this%cl1(iexg), this%cl2(iexg), &
348 (this%auxvar(iaux, iexg), iaux=1, this%naux)
350 write (iout, fmtexgdata2) trim(cellstr1), trim(cellstr2), &
351 this%ihc(iexg), this%cl1(iexg), this%cl2(iexg), &
353 (this%auxvar(iaux, iexg), iaux=1, this%naux), &
354 trim(this%boundname(iexg))
359 if (
associated(this%model1))
then
360 if (nodem1 <= 0)
then
361 cellstr1 = this%cellstr(ndim1, cellidm1(:, iexg), iout)
363 trim(adjustl(this%model1%name))// &
364 ' Cell is outside active grid domain ('// &
365 trim(adjustl(cellstr1))//
').'
371 if (
associated(this%model2))
then
372 if (nodem2 <= 0)
then
373 cellstr2 = this%cellstr(ndim2, cellidm2(:, iexg), iout)
375 trim(adjustl(this%model2%name))// &
376 ' Cell is outside active grid domain ('// &
377 trim(adjustl(cellstr2))//
').'
383 write (iout,
'(1x,a)')
'END OF EXCHANGEDATA'
388 call store_error(
'Errors encountered in exchange input file.')
401 allocate (this%filename)
406 call mem_allocate(this%ianglex,
'IANGLEX', this%memoryPath)
407 call mem_allocate(this%icdist,
'ICDIST', this%memoryPath)
409 call mem_allocate(this%iprpak,
'IPRPAK', this%memoryPath)
410 call mem_allocate(this%iprflow,
'IPRFLOW', this%memoryPath)
411 call mem_allocate(this%ipakcb,
'IPAKCB', this%memoryPath)
412 call mem_allocate(this%inamedbound,
'INAMEDBOUND', this%memoryPath)
413 call mem_allocate(this%dev_ifmod_on,
'DEV_IFMOD_ON', this%memoryPath)
416 'AUXNAME', this%memoryPath)
418 'AUXNAME_CST', this%memoryPath)
430 this%dev_ifmod_on = .false.
440 call mem_allocate(this%nodem1, this%nexg,
'NODEM1', this%memoryPath)
441 call mem_allocate(this%nodem2, this%nexg,
'NODEM2', this%memoryPath)
442 call mem_allocate(this%ihc, this%nexg,
'IHC', this%memoryPath)
443 call mem_allocate(this%cl1, this%nexg,
'CL1', this%memoryPath)
444 call mem_allocate(this%cl2, this%nexg,
'CL2', this%memoryPath)
445 call mem_allocate(this%hwva, this%nexg,
'HWVA', this%memoryPath)
448 'AUXVAR', this%memoryPath)
451 if (this%inamedbound == 1)
then
452 allocate (this%boundname(this%nexg))
454 allocate (this%boundname(1))
456 this%boundname(:) =
''
466 logical(LGP) :: use_im
470 use_im = .not. (this%v_model1%is_local .and. this%v_model2%is_local)
490 deallocate (this%boundname)
496 call mem_deallocate(this%auxname_cst,
'AUXNAME_CST', this%memoryPath)
510 class(*),
pointer,
intent(inout) :: obj
515 if (.not.
associated(obj))
return
526 type(
listtype),
intent(inout) :: list
529 class(*),
pointer :: obj
538 type(
listtype),
intent(inout) :: list
539 integer(I4B),
intent(in) :: idx
543 class(*),
pointer :: obj
545 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.