19 elementType, elementID, &
21 arrDonor, arrInterpol)
59 integer(kind=intType),
intent(in) :: nCoor, nInterpol
60 character(len=*),
intent(in) :: adtID
62 real(kind=realtype),
dimension(:, :),
intent(in) :: coor
63 real(kind=realtype),
dimension(:, :),
intent(in) :: arrdonor
65 integer,
dimension(:),
intent(out) :: procID
66 integer(kind=intType),
dimension(:),
intent(out) :: elementID
68 integer(kind=adtElementType),
dimension(:),
intent(out) :: &
70 real(kind=realtype),
dimension(:, :),
intent(out) :: uvw
71 real(kind=realtype),
dimension(:, :),
intent(out) :: arrinterpol
79 integer(kind=intType) :: jj, nAlloc
81 real(kind=realtype),
dimension(1) :: dummy
87 nalloc = ubound(
adts, 1)
89 if (adtid ==
adts(jj)%adtID)
exit
96 if (jj > nalloc) stop
"ADT to be searched does not exist."
107 "ADT does not contain a volume mesh.")
108 call mpi_barrier(adt%comm, ierr)
114 call initsearch(ncoor, coor, dummy, adt, .true.)
118 call search(ncoor, coor, procid, elementtype, &
119 elementid, uvw, dummy, adt, &
120 .true., ninterpol, arrdonor, arrinterpol)
126 elementType, elementID, &
128 nInterpol, arrDonor, &
178 integer(kind=intType),
intent(in) :: nCoor, nInterpol
179 character(len=*),
intent(in) :: adtID
181 real(kind=realtype),
dimension(:, :),
intent(in) :: coor
182 real(kind=realtype),
dimension(:, :),
intent(in) :: arrdonor
184 integer,
dimension(:),
intent(out) :: procID
185 integer(kind=intType),
dimension(:),
intent(out) :: elementID
187 integer(kind=adtElementType),
dimension(:),
intent(out) :: &
190 real(kind=realtype),
dimension(:, :),
intent(out) :: uvw
191 real(kind=realtype),
dimension(:, :),
intent(out) :: arrinterpol
193 real(kind=realtype),
dimension(:),
intent(inout) :: dist2
198 integer,
dimension(:),
allocatable :: tmpProcID
202 integer(kind=intType) :: i, j, ii, jj, nAlloc, nFail
203 integer(kind=intType),
dimension(:),
allocatable :: tmpElementID
204 integer(kind=intType),
dimension(:),
allocatable :: coorIDs
206 integer(kind=adtElementType),
dimension(:),
allocatable :: &
209 real(kind=realtype),
dimension(1) :: dummy
211 real(kind=realtype),
dimension(:),
allocatable :: tmpdist2
212 real(kind=realtype),
dimension(:, :),
allocatable :: tmpcoor
213 real(kind=realtype),
dimension(:, :),
allocatable :: tmpuvw
214 real(kind=realtype),
dimension(:, :),
allocatable :: tmparrint
220 nalloc = ubound(
adts, 1)
222 if (adtid ==
adts(jj)%adtID)
exit
229 if (jj > nalloc) stop
"ADT to be searched does not exist."
240 "ADT does not contain a volume mesh.")
241 call mpi_barrier(adt%comm, ierr)
246 call initsearch(ncoor, coor, dummy, adt, .true.)
248 call search(ncoor, coor, procid, elementtype, &
249 elementid, uvw, dummy, adt, &
250 .true., ninterpol, arrdonor, arrinterpol)
258 if (procid(i) == -1)
then
267 call mpi_allreduce(nfail, ii, 1, adflow_integer, mpi_max, &
278 allocate (tmpcoor(3, nfail), tmpprocid(nfail), &
279 tmpelementtype(nfail), tmpelementid(nfail), &
280 tmpuvw(3, nfail), tmpdist2(nfail), &
281 coorids(nfail), tmparrint(ninterpol, nfail), &
285 "Memory allocation failure for the arrays &
286 &for the minimum distance search.")
293 if (procid(i) == -1)
then
296 tmpcoor(1, ii) = coor(1, i)
297 tmpcoor(2, ii) = coor(2, i)
298 tmpcoor(3, ii) = coor(3, i)
299 tmpdist2(ii) = dist2(i)
307 call initsearch(nfail, tmpcoor, tmpdist2, adt, .false.)
309 call search(nfail, tmpcoor, tmpprocid, tmpelementtype, &
310 tmpelementid, tmpuvw, tmpdist2, adt, &
311 .false., ninterpol, arrdonor, tmparrint)
318 if (tmpprocid(i) /= -1)
then
321 procid(ii) = tmpprocid(i)
322 elementtype(ii) = tmpelementtype(i)
323 elementid(ii) = -tmpelementid(i)
324 uvw(1, ii) = tmpuvw(1, i)
325 uvw(2, ii) = tmpuvw(2, i)
326 uvw(3, ii) = tmpuvw(3, i)
327 dist2(ii) = tmpdist2(i)
330 arrinterpol(j, ii) = tmparrint(j, i)
337 deallocate (tmpcoor, tmpprocid, tmpelementtype, tmpelementid, &
338 tmpuvw, tmpdist2, coorids, tmparrint, &
342 "Deallocation failure for the arrays &
343 &for the minimum distance search.")
347 subroutine initsearch(nCoor, coor, dist2, ADT, containmentSearch)
377 type(
adttype),
intent(inout) :: adt
378 integer(kind=intType),
intent(in) :: ncoor
380 real(kind=realtype),
dimension(:, :),
intent(in) :: coor
381 real(kind=realtype),
dimension(:),
intent(inout) :: dist2
387 integer :: ierr, nrootleaves, comm, nprocs, myid
388 integer :: myentryinrootprocs
390 integer,
dimension(:),
pointer :: rootleavesprocs
392 integer(kind=intType) :: i, j, k, mm, nn
394 integer(kind=intType),
dimension(:),
allocatable :: ncoorperproc
395 integer(kind=intType),
dimension(:),
allocatable :: ncoorfromproc
397 real(kind=realtype) :: d1, d2, dx, dy, dz
399 real(kind=realtype),
dimension(:, :, :),
pointer :: rootbboxes
403 nrootleaves = adt%nRootLeaves
404 myentryinrootprocs = adt%myEntryInRootProcs
405 rootleavesprocs => adt%rootLeavesProcs
406 rootbboxes => adt%rootBBoxes
416 call mpi_allreduce(ncoor,
ncoormax, 1, adflow_integer, mpi_max, &
436 "Memory allocation failure for &
437 &nCoorPerRootLeaf and mCoorPerRootLeaf.")
445 do j = 1, nrootleaves
447 d1 = abs(coor(1, i) - rootbboxes(1, 1, j))
448 d2 = abs(coor(1, i) - rootbboxes(1, 2, j))
451 d1 = abs(coor(2, i) - rootbboxes(2, 1, j))
452 d2 = abs(coor(2, i) - rootbboxes(2, 2, j))
455 d1 = abs(coor(3, i) - rootbboxes(3, 1, j))
456 d2 = abs(coor(3, i) - rootbboxes(3, 2, j))
459 d2 = dx * dx + dy * dy + dz * dz
460 dist2(i) = min(dist2(i), d2)
464 end if testmindistance
476 loop1rootleaves:
do j = 1, nrootleaves
484 do k = (mm + 1), (rootleavesprocs(j) + 1)
488 mm = rootleavesprocs(j) + 1
501 if (coor(1, i) >= rootbboxes(1, 1, j) .and. &
502 coor(1, i) <= rootbboxes(1, 2, j) .and. &
503 coor(2, i) >= rootbboxes(2, 1, j) .and. &
504 coor(2, i) <= rootbboxes(2, 2, j) .and. &
505 coor(3, i) >= rootbboxes(3, 1, j) .and. &
506 coor(3, i) <= rootbboxes(3, 2, j)) &
510 else test1containment
519 if (coor(1, i) < rootbboxes(1, 1, j))
then
520 dx = coor(1, i) - rootbboxes(1, 1, j)
521 else if (coor(1, i) > rootbboxes(1, 2, j))
then
522 dx = coor(1, i) - rootbboxes(1, 2, j)
527 if (coor(2, i) < rootbboxes(2, 1, j))
then
528 dy = coor(2, i) - rootbboxes(2, 1, j)
529 else if (coor(2, i) > rootbboxes(2, 2, j))
then
530 dy = coor(2, i) - rootbboxes(2, 2, j)
535 if (coor(3, i) < rootbboxes(3, 1, j))
then
536 dz = coor(3, i) - rootbboxes(3, 1, j)
537 else if (coor(3, i) > rootbboxes(3, 2, j))
then
538 dz = coor(3, i) - rootbboxes(3, 2, j)
543 d2 = dx * dx + dy * dy + dz * dz
549 end if test1containment
551 end do loop1rootleaves
555 do k = (mm + 1), nprocs
571 "Memory allocation failure for &
578 loop2rootleaves:
do j = 1, nrootleaves
589 if (coor(1, i) >= rootbboxes(1, 1, j) .and. &
590 coor(1, i) <= rootbboxes(1, 2, j) .and. &
591 coor(2, i) >= rootbboxes(2, 1, j) .and. &
592 coor(2, i) <= rootbboxes(2, 2, j) .and. &
593 coor(3, i) >= rootbboxes(3, 1, j) .and. &
594 coor(3, i) <= rootbboxes(3, 2, j))
then
600 else test2containment
607 if (coor(1, i) < rootbboxes(1, 1, j))
then
608 dx = coor(1, i) - rootbboxes(1, 1, j)
609 else if (coor(1, i) > rootbboxes(1, 2, j))
then
610 dx = coor(1, i) - rootbboxes(1, 2, j)
615 if (coor(2, i) < rootbboxes(2, 1, j))
then
616 dy = coor(2, i) - rootbboxes(2, 1, j)
617 else if (coor(2, i) > rootbboxes(2, 2, j))
then
618 dy = coor(2, i) - rootbboxes(2, 2, j)
623 if (coor(3, i) < rootbboxes(3, 1, j))
then
624 dz = coor(3, i) - rootbboxes(3, 1, j)
625 else if (coor(3, i) > rootbboxes(3, 2, j))
then
626 dz = coor(3, i) - rootbboxes(3, 2, j)
631 d2 = dx * dx + dy * dy + dz * dz
632 if (d2 < dist2(i))
then
638 end if test2containment
640 end do loop2rootleaves
650 ncoorperproc(0:nprocs - 1), ncoorfromproc(0:nprocs - 1), &
654 "Memory allocation failure for help arrays.")
661 do i = 0, (nprocs - 1)
666 ncoorperproc(myid) = 0
670 call mpi_alltoall(ncoorperproc, 1, adflow_integer, &
671 ncoorfromproc, 1, adflow_integer, comm, ierr)
679 do i = 0, (nprocs - 1)
680 if (ncoorfromproc(i) > 0)
then
683 nn = nn + ncoorfromproc(i)
690 i = real(nn, realtype) / real(
ncoormax, realtype)
692 i = max(i, 1_inttype)
694 call mpi_allreduce(i,
nrounds, 1, adflow_integer, mpi_max, &
701 nn = max(nrootleaves, 1_inttype)
702 j = (real(myentryinrootprocs, realtype) / real(nn, realtype)) &
723 deallocate (ncoorperproc, ncoorfromproc, stat=ierr)
726 "Deallocation failure for nCoorPerProc and &
733 elementType, elementID, &
735 nInterpol, arrDonor, &
783 integer(kind=intType),
intent(in) :: ncoor, ninterpol
784 character(len=*),
intent(in) :: adtid
786 real(kind=realtype),
dimension(:, :),
intent(in) :: coor
787 real(kind=realtype),
dimension(:, :),
intent(in) :: arrdonor
789 integer,
dimension(:),
intent(out) :: procid
790 integer(kind=intType),
dimension(:),
intent(out) :: elementid
792 integer(kind=adtElementType),
dimension(:),
intent(out) :: &
795 real(kind=realtype),
dimension(:, :),
intent(out) :: uvw
796 real(kind=realtype),
dimension(:, :),
intent(out) :: arrinterpol
798 real(kind=realtype),
dimension(:),
intent(inout) :: dist2
802 integer(kind=intType) :: jj, nalloc
810 nalloc = ubound(
adts, 1)
812 if (adtid ==
adts(jj)%adtID)
exit
819 if (jj > nalloc) stop
"ADT to be searched does not exist."
828 call initsearch(ncoor, coor, dist2, adt, .false.)
832 call search(ncoor, coor, procid, elementtype, &
833 elementid, uvw, dist2, adt, &
834 .false., ninterpol, arrdonor, arrinterpol)
840 if (dist2(jj) >
zero) elementid(jj) = -elementid(jj)
846 elementType, elementID, uvw, &
847 dist2, ADT, containmentSearch, &
848 nInterpol, arrDonor, arrInterpol)
894 type(
adttype),
intent(inout) :: ADT
895 integer(kind=intType),
intent(in) :: nCoor
896 integer(kind=intType),
intent(in) :: nInterpol
898 real(kind=realtype),
dimension(:, :),
intent(in) :: coor
899 real(kind=realtype),
dimension(:),
intent(inout) :: dist2
901 real(kind=realtype),
dimension(:, :),
intent(in) :: arrdonor
903 integer,
dimension(:),
intent(out) :: procID
904 integer(kind=intType),
dimension(:),
intent(out) :: elementID
906 integer(kind=adtElementType),
dimension(:),
intent(out) :: &
909 real(kind=realtype),
dimension(:, :),
intent(out) :: uvw
910 real(kind=realtype),
dimension(:, :),
intent(out) :: arrinterpol
912 logical,
intent(in) :: containmentSearch
917 integer :: comm, nProcs, myID
918 integer :: nProcRecvCur, nProcSendCur, nVarCoor, nVarUVW
919 integer :: startProcRecv, procCur, sizeMessage
921 integer,
dimension(mpi_status_size) :: mpiStatus
923 integer,
dimension(:),
allocatable :: procSendCur
924 integer,
dimension(:),
allocatable :: sendRequest
925 integer,
dimension(:, :),
allocatable :: sendRecvRequest
927 integer(kind=intType) :: i, j, k, k1, l, m, ii, mm, nn
928 integer(kind=intType) :: nLocalInterpolRound
929 integer(kind=intType) :: iStartLocal, iEndLocal, nCoorRecv
931 integer(kind=intType),
dimension(:),
allocatable :: nCoorPerProc
932 integer(kind=intType),
dimension(:),
allocatable :: nCoorFromProc
934 integer(kind=intType),
dimension(:, :),
allocatable :: intRecv
935 integer(kind=intType),
dimension(:, :),
allocatable :: intBuf
937 real(kind=realtype),
dimension(:, :),
allocatable :: coorbuf
938 real(kind=realtype),
dimension(:, :),
allocatable :: coorrecv
939 real(kind=realtype),
dimension(:, :),
allocatable :: uvwrecv
940 real(kind=realtype),
dimension(:, :),
allocatable :: uvwbuf
942 logical,
dimension(:),
allocatable :: coorRequested
954 if (containmentsearch)
then
963 nvaruvw = nvarcoor + max(ninterpol, 0_inttype)
975 allocate (procsendcur(nprocs - 1), sendrequest(nprocs - 1), &
976 ncoorperproc(0:nprocs - 1), ncoorfromproc(0:nprocs - 1), &
977 sendrecvrequest(2, nprocs - 1), coorrequested(nn), &
981 "Memory allocation failure for help arrays.")
988 coorrequested(j) = .false.
997 do i = 0, (nprocs - 1)
1007 nlocalinterpolround = nn
1010 iendlocal = nlocalinterpolround
1039 nprocrecvcur = nprocrecvcur + 1
1046 ncoorrecv = ncoorrecv + j
1067 call mpi_alltoall(ncoorfromproc, 1, adflow_integer, &
1068 ncoorperproc, 1, adflow_integer, comm, ierr)
1074 do j = startprocrecv, nn
1089 do i = 0, (nprocs - 1)
1090 if (ncoorperproc(i) > 0)
then
1091 nprocsendcur = nprocsendcur + 1
1092 procsendcur(nprocsendcur) = i
1093 nn = nn + ncoorperproc(i)
1100 allocate (coorbuf(nvarcoor, nn), stat=ierr)
1103 "Memory allocation failure for coorBuf.")
1109 sendcoorloop:
do i = 1, nprocsendcur
1114 proccur = procsendcur(i)
1126 test1containment:
if (containmentsearch)
then
1138 if (j == ncoorperproc(proccur) .or. &
1147 if (procid(l) == -1)
then
1155 coorbuf(1, k) = coor(1, l)
1156 coorbuf(2, k) = coor(2, l)
1157 coorbuf(3, k) = coor(3, l)
1162 coorrequested(nn) = .true.
1167 else test1containment
1181 if (j == ncoorperproc(proccur) .or. &
1190 if (dist2(l) >
zero)
then
1198 coorbuf(1, k) = coor(1, l)
1199 coorbuf(2, k) = coor(2, l)
1200 coorbuf(3, k) = coor(3, l)
1201 coorbuf(4, k) = dist2(l)
1206 coorrequested(nn) = .true.
1211 end if test1containment
1216 sizemessage = nvarcoor * (k - k1)
1217 call mpi_isend(coorbuf(1, k1 + 1), sizemessage, adflow_real, &
1218 proccur, proccur, comm, &
1219 sendrequest(i), ierr)
1228 nn = iendlocal - istartlocal
1237 i = max(nn, ncoorrecv)
1238 allocate (coorrecv(nvarcoor, nn), intrecv(3, i), &
1239 uvwrecv(nvaruvw, i), stat=ierr)
1242 "Memory allocation failure for &
1254 test2containment:
if (containmentsearch)
then
1275 if (procid(l) == -1)
then
1278 coorrecv(1, j) = coor(1, l)
1279 coorrecv(2, j) = coor(2, l)
1280 coorrecv(3, j) = coor(3, l)
1282 coorrequested(i) = .true.
1291 uvwrecv, arrdonor, nn, &
1306 if (coorrequested(i))
exit
1312 if (intrecv(1, j) >= 0)
then
1313 procid(l) = intrecv(1, j)
1314 elementtype(l) = intrecv(2, j)
1315 elementid(l) = intrecv(3, j)
1316 uvw(1, l) = uvwrecv(1, j)
1317 uvw(2, l) = uvwrecv(2, j)
1318 uvw(3, l) = uvwrecv(3, j)
1321 arrinterpol(m, l) = uvwrecv(m + nvarcoor, j)
1327 else test2containment
1347 if (dist2(l) >
zero)
then
1350 coorrecv(1, j) = coor(1, l)
1351 coorrecv(2, j) = coor(2, l)
1352 coorrecv(3, j) = coor(3, l)
1353 coorrecv(4, j) = dist2(l)
1355 coorrequested(i) = .true.
1364 uvwrecv, arrdonor, nn, &
1381 if (coorrequested(i))
exit
1389 if (intrecv(1, j) >= 0 .and. uvwrecv(4, j) < dist2(l))
then
1391 procid(l) = intrecv(1, j)
1392 elementtype(l) = intrecv(2, j)
1393 elementid(l) = intrecv(3, j)
1394 uvw(1, l) = uvwrecv(1, j)
1395 uvw(2, l) = uvwrecv(2, j)
1396 uvw(3, l) = uvwrecv(3, j)
1397 dist2(l) = uvwrecv(4, j)
1400 arrinterpol(m, l) = uvwrecv(m + nvarcoor, j)
1406 end if test2containment
1411 deallocate (coorrecv, stat=ierr)
1414 "Deallocation failure for coorRecv.")
1419 istartlocal = iendlocal
1420 iendlocal = iendlocal + nlocalinterpolround
1435 recvsendloop:
do i = 1, nprocrecvcur
1440 call mpi_probe(mpi_any_source, myid, comm, mpistatus, ierr)
1442 proccur = mpistatus(mpi_source)
1443 call mpi_get_count(mpistatus, adflow_real, sizemessage, ierr)
1448 if (sizemessage == mpi_undefined .or. &
1449 mod(sizemessage, nvarcoor) /= 0) &
1451 "Unexpected size of message")
1458 nn = sizemessage / nvarcoor
1459 allocate (coorrecv(nvarcoor, nn), stat=ierr)
1462 "Memory allocation failure for &
1465 call mpi_recv(coorrecv, sizemessage, adflow_real, proccur, &
1466 myid, comm, mpistatus, ierr)
1471 if (containmentsearch)
then
1473 intrecv(:, ii:), uvwrecv(:, ii:), &
1478 intrecv(:, ii:), uvwrecv(:, ii:), &
1483 deallocate (coorrecv, stat=ierr)
1486 "Deallocation failure for coorRecv.")
1491 sizemessage = 3 * nn
1492 call mpi_isend(intrecv(1, ii), sizemessage, adflow_integer, &
1493 proccur, proccur + 1, comm, &
1494 sendrecvrequest(1, i), ierr)
1496 sizemessage = nvaruvw * nn
1497 call mpi_isend(uvwrecv(1, ii), sizemessage, adflow_real, &
1498 proccur, proccur + 2, comm, &
1499 sendrecvrequest(2, i), ierr)
1510 do i = 1, nprocsendcur
1511 call mpi_waitany(nprocsendcur, sendrequest, sizemessage, &
1515 deallocate (coorbuf, stat=ierr)
1518 "Deallocation failure for coorBuf.")
1524 recvloop:
do ii = 1, nprocsendcur
1530 call mpi_probe(mpi_any_source, myid + 1, comm, mpistatus, ierr)
1532 proccur = mpistatus(mpi_source)
1533 call mpi_get_count(mpistatus, adflow_integer, sizemessage, ierr)
1538 if (sizemessage == mpi_undefined .or. &
1539 mod(sizemessage, 3) /= 0) &
1541 "Unexpected size of message")
1547 nn = sizemessage / 3
1548 allocate (intbuf(3, nn), uvwbuf(nvaruvw, nn), stat=ierr)
1551 "Memory allocation failure for intBuf &
1554 call mpi_recv(intbuf, sizemessage, adflow_integer, proccur, &
1555 myid + 1, comm, mpistatus, ierr)
1557 sizemessage = nvaruvw * nn
1558 call mpi_recv(uvwbuf, sizemessage, adflow_real, proccur, &
1559 myid + 2, comm, mpistatus, ierr)
1569 test3containment:
if (containmentsearch)
then
1582 if (coorrequested(i))
exit
1587 if (intbuf(1, j) >= 0)
then
1590 procid(l) = intbuf(1, j)
1591 elementtype(l) = intbuf(2, j)
1592 elementid(l) = intbuf(3, j)
1593 uvw(1, l) = uvwbuf(1, j)
1594 uvw(2, l) = uvwbuf(2, j)
1595 uvw(3, l) = uvwbuf(3, j)
1598 arrinterpol(m, l) = uvwbuf(m + nvarcoor, j)
1604 else test3containment
1618 if (coorrequested(i))
exit
1626 if (intbuf(1, j) >= 0 .and. uvwbuf(4, j) < dist2(l))
then
1628 procid(l) = intbuf(1, j)
1629 elementtype(l) = intbuf(2, j)
1630 elementid(l) = intbuf(3, j)
1631 uvw(1, l) = uvwbuf(1, j)
1632 uvw(2, l) = uvwbuf(2, j)
1633 uvw(3, l) = uvwbuf(3, j)
1634 dist2(l) = uvwbuf(4, j)
1637 arrinterpol(m, l) = uvwbuf(m + nvarcoor, j)
1643 end if test3containment
1650 deallocate (intbuf, uvwbuf, stat=ierr)
1653 "Deallocation failure for intBuf &
1660 do i = 1, nprocrecvcur
1661 call mpi_waitany(nprocrecvcur, sendrecvrequest(1, :), sizemessage, &
1663 call mpi_waitany(nprocrecvcur, sendrecvrequest(2, :), sizemessage, &
1670 deallocate (intrecv, uvwrecv, stat=ierr)
1673 "Deallocation failure for intRecv and &
1679 call mpi_barrier(comm, ierr)
1686 deallocate (procsendcur, sendrequest, ncoorperproc, &
1687 ncoorfromproc, sendrecvrequest, coorrequested, &
1691 "Deallocation failure for help arrays.")
1700 "Deallocation failure for help arrays &
1701 &stored in the module adtData.")
integer(kind=inttype) nrounds
integer(kind=inttype) ncoormax
integer, dimension(:), allocatable procrecv
integer(kind=inttype), dimension(:), allocatable ncoorprocrecv
integer(kind=inttype), dimension(:), allocatable coorperrootleaf
integer(kind=inttype) nlocalinterpol
type(adttype), dimension(:), allocatable, target adts
integer(kind=inttype), dimension(:), allocatable ncoorperrootleaf
integer(kind=inttype), dimension(:), allocatable mcoorperrootleaf
subroutine containmenttreesearch(ADT, coor, intInfo, uvw, arrDonor, nCoor, nInterpol)
subroutine mindistancetreesearch(ADT, coor, intInfo, uvw, arrDonor, nCoor, nInterpol)
subroutine initsearch(nCoor, coor, dist2, ADT, containmentSearch)
subroutine containmentsearch(nCoor, coor, adtID, procID, elementType, elementID, uvw, nInterpol, arrDonor, arrInterpol)
subroutine search(nCoor, coor, procID, elementType, elementID, uvw, dist2, ADT, containmentSearch, nInterpol, arrDonor, arrInterpol)
subroutine mindistancesearch(nCoor, coor, adtID, procID, elementType, elementID, uvw, dist2, nInterpol, arrDonor, arrInterpol)
subroutine failsafesearch(nCoor, coor, adtID, procID, elementType, elementID, uvw, dist2, nInterpol, arrDonor, arrInterpol)
subroutine adtterminate(ADT, routineName, errorMessage)
real(kind=realtype), parameter zero
integer, parameter adtvolumeadt
integer(kind=inttype), parameter ncoormaxlowerlimit