252
255
256 class(DisConnExchangeType) :: this
257 integer(I4B), intent(in) :: iout
258
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
266 type(CharacterStringType), dimension(:), contiguous, pointer :: boundname
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
272
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
277
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)
288
289 write (iout, '(1x,a)') 'PROCESSING EXCHANGEDATA'
290
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)), &
295 iaux=1, this%naux)
296 else
297 write (iout, fmtexglabel) 'NODEM1', 'NODEM2', 'IHC', 'CL1', 'CL2', &
298 'HWVA', (adjustr(this%auxname(iaux)), iaux=1, this%naux), &
299 ' BOUNDNAME '
300
301
302 write (cnfloat, '(i0)') 3 + this%naux
303 fmtexgdata2 = '(5x, a, 1x, a, i10, '//trim(cnfloat)// &
304 '(1pg16.6), 1x, a)'
305 end if
306 end if
307
308 do iexg = 1, this%nexg
309
310 if (associated(this%model1)) then
311
312
313 nodem1 = this%noder(this%model1, cellidm1(:, iexg), iout)
314 this%nodem1(iexg) = nodem1
315
316 else
317 this%nodem1(iexg) = -1
318 end if
319
320 if (associated(this%model2)) then
321
322
323 nodem2 = this%noder(this%model2, cellidm2(:, iexg), iout)
324 this%nodem2(iexg) = nodem2
325
326 else
327 this%nodem2(iexg) = -1
328 end if
329
330
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)
337 end do
338 if (this%inamedbound == 1) then
339 this%boundname(iexg) = boundname(iexg)
340 end if
341
342
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), &
349 this%hwva(iexg), &
350 (this%auxvar(iaux, iexg), iaux=1, this%naux)
351 else
352 write (iout, fmtexgdata2) trim(cellstr1), trim(cellstr2), &
353 this%ihc(iexg), this%cl1(iexg), this%cl2(iexg), &
354 this%hwva(iexg), &
355 (this%auxvar(iaux, iexg), iaux=1, this%naux), &
356 trim(this%boundname(iexg))
357 end if
358 end if
359
360
361 if (associated(this%model1)) then
362 if (nodem1 <= 0) then
363 cellstr1 = this%cellstr(ndim1, cellidm1(:, iexg), iout)
364 write (errmsg, *) &
365 trim(adjustl(this%model1%name))// &
366 ' Cell is outside active grid domain ('// &
367 trim(adjustl(cellstr1))//').'
368 call store_error(errmsg)
369 end if
370 end if
371
372
373 if (associated(this%model2)) then
374 if (nodem2 <= 0) then
375 cellstr2 = this%cellstr(ndim2, cellidm2(:, iexg), iout)
376 write (errmsg, *) &
377 trim(adjustl(this%model2%name))// &
378 ' Cell is outside active grid domain ('// &
379 trim(adjustl(cellstr2))//').'
380 call store_error(errmsg)
381 end if
382 end if
383 end do
384
385 write (iout, '(1x,a)') 'END OF EXCHANGEDATA'
386
387
388 nerr = count_errors()
389 if (nerr > 0) then
390 call store_error('Errors encountered in exchange input file.')
391 call store_error_filename(this%filename)
392 end if
393
subroutine, public memorystore_release(varname, memory_path)
Release a single variable from the memory store.