ADflow  v1.0
ADflow is a finite volume RANS solver tailored for gradient-based aerodynamic design optimization.
gridChecking.F90
Go to the documentation of this file.
2 contains
3  subroutine checkfaces
4  !
5  ! checkFaces determines whether or not a boundary condition or
6  ! a connectivity has been specified for all block faces. If this
7  ! is not the case, the corresponding blocks are printed and the
8  ! code terminates.
9  !
10  use constants
11  use blockpointers, only: ndom, nbkglobal
12  use cgnsgrid, only: cgnsndom, cgnsdoms
15  use utils, only: setpointers, terminate
16  use partitionmod, only: sortbadentities
17  use commonformats, only: strings
18  implicit none
19  !
20  ! Local variables.
21  !
22  integer :: ierr, size
23 
24  integer, dimension(nProc) :: recvcounts, displs
25 
26  integer(kind=intType) :: mm, nn, sps, multiple
27  integer(kind=intType) :: nBad, faceID, nBadGlobal
28 
29  integer(kind=intType), dimension(nProc) :: counts
30  integer(kind=intType), &
31  dimension(4, nDom*nTimeIntervalsSpectral) :: bad
32 
33  integer(kind=intType), dimension(:, :), allocatable :: badGlobal
34 
35  real(kind=realtype) :: dummy(1)
36 
37  logical :: blockIsBad
38 
39  character(len=7) :: intString
40 
41  ! Determine the local bad blocks.
42  !
43  ! Loop over the number of spectral solutions to be checked and
44  ! the number of local blocks.
45 
46  nbad = 0
47  do sps = 1, ntimeintervalsspectral
48  do nn = 1, ndom
49 
50  ! Check if the current block is okay.
51 
52  call setpointers(nn, 1_inttype, sps)
53  call checkfacesblock(blockisbad, faceid, multiple)
54 
55  ! If the block is bad, update nBad and store the info in bad.
56 
57  if (blockisbad) then
58  nbad = nbad + 1
59  bad(1, nbad) = nbkglobal
60  bad(2, nbad) = faceid
61  bad(3, nbad) = multiple
62  bad(4, nbad) = sps
63  end if
64 
65  end do
66  end do
67  !
68  ! Determine the global number of bad blocks and gather this
69  ! information.
70  !
71  ! Determine the number of bad blocks per processor.
72 
73  call mpi_allgather(nbad, 1, adflow_integer, counts, 1, &
74  adflow_integer, adflow_comm_world, ierr)
75 
76  ! Determine the global number of bad blocks and the arrays
77  ! recvcounts and displs needed for the call to allgatherv.
78 
79  nbadglobal = counts(1)
80  recvcounts(1) = 4 * counts(1)
81  displs(1) = 0
82 
83  do nn = 2, nproc
84  nbadglobal = nbadglobal + counts(nn)
85  recvcounts(nn) = 4 * counts(nn)
86  displs(nn) = displs(nn - 1) + recvcounts(nn - 1)
87  end do
88 
89  ! Allocate the memory to store all the bad blocks.
90 
91  allocate (badglobal(4, nbadglobal), stat=ierr)
92  if (ierr /= 0) &
93  call terminate("checkFaces", &
94  "Memory allocation failure for badGlobal")
95 
96  ! Gather the data.
97 
98  size = 4 * nbad
99  call mpi_allgatherv(bad, size, adflow_integer, badglobal, &
100  recvcounts, displs, adflow_integer, &
101  adflow_comm_world, ierr)
102 
103  ! Sort the bad blocks and get rid of the multiple entries.
104  ! The last argument is .false. to indicate that only the
105  ! integers must be sorted; dummy is passed for consistency.
106 
107  call sortbadentities(nbadglobal, badglobal, dummy, .false.)
108 
109  ! If bad blocks are present, print them to stdout and terminate.
110 
111  testbadpresent: if (nbadglobal > 0) then
112 
113  ! The data is only written by processor 0.
114 
115  testrootproc: if (myid == 0) then
116 
117  ! Write a header.
118 
119  write (intstring, "(i6)") nbadglobal
120  intstring = adjustl(intstring)
121 
122  print "(a)", "#"
123  print strings, "# Found ", trim(intstring), " blocks for which the boundary or connectivity information"
124  print "(a)", "# is not correct. Here is the list of bad blocks"
125  print "(a)", "#"
126 
127  ! Write the bad blocks.
128 
129  do mm = 1, nbadglobal
130 
131  ! Abbreviate the contents of badGlobal a bit easier.
132 
133  nn = badglobal(1, mm)
134  faceid = badglobal(2, mm)
135  multiple = badglobal(3, mm)
136  sps = badglobal(4, mm)
137 
138  ! If multiple spectral solutions are read, write the info
139  ! about it. Otherwise just start the line with # sign.
140 
141  if (ntimeintervalsspectral > 1) then
142  write (intstring, "(i6)") nbadglobal
143  intstring = adjustl(intstring)
144  write (*, strings, advance="no") "# Spectral grid ", trim(intstring), ", "
145  else
146  write (*, "(a)", advance="no") "# "
147  end if
148 
149  ! Write the error message, depending on the value of
150  ! faceID and multiple.
151 
152  if (multiple == 0) then
153 
154  select case (faceid)
155  case (imin)
156  print strings, "Zone ", trim(cgnsdoms(nn)%zoneName), ": iMin block face not fully described"
157  case (imax)
158  print strings, "Zone ", trim(cgnsdoms(nn)%zoneName), ": iMax block face not fully described"
159  case (jmin)
160  print strings, "Zone ", trim(cgnsdoms(nn)%zoneName), ": jMin block face not fully described"
161  case (jmax)
162  print strings, "Zone ", trim(cgnsdoms(nn)%zoneName), ": jMax block face not fully described"
163  case (kmin)
164  print strings, "Zone ", trim(cgnsdoms(nn)%zoneName), ": kMin block face not fully described"
165  case (kmax)
166  print strings, "Zone ", trim(cgnsdoms(nn)%zoneName), ": kMax block face not fully described"
167  case default
168  print strings, "Zone ", trim(cgnsdoms(nn)%zoneName), &
169  ": Multiple block faces not fully described"
170  end select
171 
172  else
173 
174  select case (faceid)
175  case (imin)
176  print strings, "Zone ", trim(cgnsdoms(nn)%zoneName), ": iMin block face multiple described"
177  case (imax)
178  print strings, "Zone ", trim(cgnsdoms(nn)%zoneName), ": iMax block face multiple described"
179  case (jmin)
180  print strings, "Zone ", trim(cgnsdoms(nn)%zoneName), ": jMin block face multiple described"
181  case (jmax)
182  print strings, "Zone ", trim(cgnsdoms(nn)%zoneName), ": jMax block face multiple described"
183  case (kmin)
184  print strings, "Zone ", trim(cgnsdoms(nn)%zoneName), ": kMin block face multiple described"
185  case (kmax)
186  print strings, "Zone ", trim(cgnsdoms(nn)%zoneName), ": kMax block face multiple described"
187  case default
188  print strings, "Zone ", trim(cgnsdoms(nn)%zoneName), &
189  ": Multiple block faces multiple described"
190  end select
191 
192  end if
193 
194  end do
195 
196  ! Terminate.
197 
198  call terminate("checkFaces", &
199  "Wrong block boundary info found")
200 
201  end if testrootproc
202 
203  ! The other processors wait to get killed.
204 
205  call mpi_barrier(adflow_comm_world, ierr)
206 
207  end if testbadpresent
208 
209  ! Deallocate the memory of badGlobal.
210 
211  deallocate (badglobal, stat=ierr)
212  if (ierr /= 0) &
213  call terminate("checkFaces", &
214  "Deallocation failure for badGlobal")
215 
216  end subroutine checkfaces
217 
218  ! ==================================================================
219 
220  subroutine checkfacesblock(blockIsBad, faceID, multiple)
221  !
222  ! checkFacesBlock checks if for the currently active block all
223  ! the necessary boundary and connectivity info is specified.
224  ! If not, blockIsBad is set to .true. and the block face ID
225  ! which is bad, is returned as well.
226  !
227  use constants
228  use blockpointers
229  implicit none
230  !
231  ! Subroutine arguments.
232  !
233  integer(kind=intType), intent(out) :: faceID, multiple
234  logical, intent(out) :: blockIsBad
235  !
236  ! Local variables.
237  !
238  integer, dimension(2:jl, 2:kl), target :: iMinFace, iMaxFace
239  integer, dimension(2:il, 2:kl), target :: jMinFace, jMaxFace
240  integer, dimension(2:il, 2:jl), target :: kMinFace, kMaxFace
241 
242  integer, dimension(:, :), pointer :: face
243 
244  integer(kind=intType) :: nn, i, j, k, nBad
245  integer(kind=intType) :: istart, iEnd, jStart, jEnd
246 
247  logical :: iMinBad, iMaxBad, jMinBad, jMaxBad
248  logical :: kMinBad, kMaxBad
249 
250  ! Initialize iMinFace, etc to 0. These arrays will contain the
251  ! number of specified connectivities and BC's for each face on
252  ! the block boundary.
253 
254  iminface = 0; imaxface = 0
255  jminface = 0; jmaxface = 0
256  kminface = 0; kmaxface = 0
257 
258  ! Loop over the number of subfaces of this block.
259 
260  do nn = 1, nsubface
261 
262  ! Determine the block face on which the subface is located and
263  ! set a couple of variables accordingly. Note that the nodal
264  ! ranges are used to determine the correct range of faces,
265  ! because the actual cell range can contain halo cells.
266 
267  select case (bcfaceid(nn))
268  case (imin)
269  face => iminface; istart = min(jnbeg(nn), jnend(nn)) + 1
270  iend = max(jnbeg(nn), jnend(nn))
271  jstart = min(knbeg(nn), knend(nn)) + 1
272  jend = max(knbeg(nn), knend(nn))
273  case (imax)
274  face => imaxface; istart = min(jnbeg(nn), jnend(nn)) + 1
275  iend = max(jnbeg(nn), jnend(nn))
276  jstart = min(knbeg(nn), knend(nn)) + 1
277  jend = max(knbeg(nn), knend(nn))
278  case (jmin)
279  face => jminface; istart = min(inbeg(nn), inend(nn)) + 1
280  iend = max(inbeg(nn), inend(nn))
281  jstart = min(knbeg(nn), knend(nn)) + 1
282  jend = max(knbeg(nn), knend(nn))
283  case (jmax)
284  face => jmaxface; istart = min(inbeg(nn), inend(nn)) + 1
285  iend = max(inbeg(nn), inend(nn))
286  jstart = min(knbeg(nn), knend(nn)) + 1
287  jend = max(knbeg(nn), knend(nn))
288  case (kmin)
289  face => kminface; istart = min(inbeg(nn), inend(nn)) + 1
290  iend = max(inbeg(nn), inend(nn))
291  jstart = min(jnbeg(nn), jnend(nn)) + 1
292  jend = max(jnbeg(nn), jnend(nn))
293  case (kmax)
294  face => kmaxface; istart = min(inbeg(nn), inend(nn)) + 1
295  iend = max(inbeg(nn), inend(nn))
296  jstart = min(jnbeg(nn), jnend(nn)) + 1
297  jend = max(jnbeg(nn), jnend(nn))
298  end select
299 
300  ! Loop over the faces and update their counter.
301 
302  do j = jstart, jend
303  do i = istart, iend
304  face(i, j) = face(i, j) + 1
305  end do
306  end do
307 
308  end do
309 
310  ! Determine the bad block faces.
311 
312  multiple = 0
313  iminbad = .false.
314  imaxbad = .false.
315 
316  ! iMin and iMax face.
317 
318  do k = 2, kl
319  do j = 2, jl
320  if (iminface(j, k) /= 1) then
321  multiple = iminface(j, k)
322  faceid = imin
323  iminbad = .true.
324  end if
325 
326  if (imaxface(j, k) /= 1) then
327  multiple = imaxface(j, k)
328  faceid = imax
329  imaxbad = .true.
330  end if
331  end do
332  end do
333 
334  ! jMin and jMax face.
335 
336  jminbad = .false.
337  jmaxbad = .false.
338 
339  do k = 2, kl
340  do i = 2, il
341  if (jminface(i, k) /= 1) then
342  multiple = jminface(i, k)
343  faceid = jmin
344  jminbad = .true.
345  end if
346 
347  if (jmaxface(i, k) /= 1) then
348  multiple = jmaxface(i, k)
349  faceid = jmax
350  jmaxbad = .true.
351  end if
352  end do
353  end do
354 
355  ! kMin and kMax face.
356 
357  kminbad = .false.
358  kmaxbad = .false.
359 
360  do j = 2, jl
361  do i = 2, il
362  if (kminface(i, j) /= 1) then
363  multiple = kminface(i, j)
364  faceid = kmin
365  kminbad = .true.
366  end if
367 
368  if (kmaxface(i, j) /= 1) then
369  multiple = kmaxface(i, j)
370  faceid = kmax
371  kmaxbad = .true.
372  end if
373  end do
374  end do
375 
376  ! Determine the number of bad block faces.
377 
378  nbad = 0
379  if (iminbad) nbad = nbad + 1
380  if (imaxbad) nbad = nbad + 1
381  if (jminbad) nbad = nbad + 1
382  if (jmaxbad) nbad = nbad + 1
383  if (kminbad) nbad = nbad + 1
384  if (kmaxbad) nbad = nbad + 1
385 
386  ! Set blockIsBad if bad faces are present and correct the face
387  ! id to something weird if multiple bad faces are present.
388 
389  blockisbad = .false.
390  if (nbad > 0) blockisbad = .true.
391  if (nbad > 1) faceid = huge(faceid)
392 
393  end subroutine checkfacesblock
394  subroutine check1to1subfaces
395  !
396  ! check1to1Subfaces checks if the 1 to 1 internal subfaces,
397  ! including the periodic ones, match up to a certain tolerance.
398  ! If not, a warning will be printed. The computation is not
399  ! returnFaild, because sometimes gaps are introduced on purpose,
400  ! e.g. near a wing tip in an H-topology in spanwise direction.
401  !
402  use constants
403  use blockpointers, only: ndom, nbocos, inbeg, inend, jnbeg, &
406  neighblock, l1, l2, l3
407  use cgnsgrid, only: cgnsdoms, cgnsndom
410  use inputphysics
412  use utils, only: delta, setpointers, terminate
413  use partitionmod, only: sortbadentities
414  use commonformats, only: strings
415  implicit none
416  !
417  ! Local variables.
418  !
419  integer :: ierr, procId, size
420 
421  integer, dimension(mpi_status_size) :: mpiStatus
422  integer, dimension(nProc) :: sizeMessage
423  integer, dimension(nProc) :: recvcounts, displs
424 
425  integer(kind=intType) :: i, j, k, ll1, ll2, ll3, ic, jc, kc
426  integer(kind=intType) :: sps, nn, mm, ll, ii, proc, nFCheck
427  integer(kind=intType) :: stepI, stepJ, stepK
428  integer(kind=intType) :: nMessagesSend, nMessagesReceive
429  integer(kind=intType) :: nBad, nBadGlobal
430 
431  integer(kind=intType), dimension(3, 3) :: trMat
432 
433  integer(kind=intType), dimension(0:nProc) :: nFSend, nCoor
434  integer(kind=intType), dimension(nProc) :: nFCount, nCCount
435 
436  integer(kind=intType), dimension(:, :), allocatable :: intBuf
437  integer(kind=intType), dimension(:, :), allocatable :: intRecv
438  integer(kind=intType), dimension(:, :), allocatable :: badSubfaces
439  integer(kind=intType), dimension(:, :), allocatable :: badGlobal
440 
441  real(kind=realtype), dimension(:), allocatable :: baddist
442  real(kind=realtype), dimension(:), allocatable :: baddistglobal
443  real(kind=realtype), dimension(:, :), allocatable :: realbuf
444  real(kind=realtype), dimension(:, :), allocatable :: realrecv
445 
446  character(len=7) :: intString
447  character(len=maxStringLen) :: devFormat, spectralDevFormat
448  !
449  ! Determine the local number of faces that must be sent to other
450  ! processors, including to myself. Also determine the number of
451  ! faces I have to check.
452  !
453  nfcheck = 0
454  nfsend = 0
455  ncoor = 0
456 
457  ! Loop over the local blocks and its subfaces of the number of
458  ! spectral solutions to be checked.
459 
460  do sps = 1, ntimeintervalsspectral
461  do nn = 1, ndom
462 
463  call setpointers(nn, 1_inttype, sps)
464 
465  ! Loop over the 1 to 1 subfaces.
466 
467  do mm = 1, n1to1
468 
469  ! Add the offset of nBocos to mm, such that the entries
470  ! in the arrays corresponds to this 1 to 1 subface.
471 
472  ll = mm + nbocos
473 
474  ! Update nFSend and nCoor of the correct processor and
475  ! update nFCheck.
476 
477  ii = (abs(inend(ll) - inbeg(ll)) + 1) &
478  * (abs(jnend(ll) - jnbeg(ll)) + 1) &
479  * (abs(knend(ll) - knbeg(ll)) + 1)
480  ll = neighproc(ll) + 1
481 
482  nfsend(ll) = nfsend(ll) + 1
483  ncoor(ll) = ncoor(ll) + ii
484 
485  nfcheck = nfcheck + 1
486 
487  end do
488  end do
489  end do
490 
491  ! Put nFSend and nCoor in cumulative storage format. Note
492  ! that nFSend and nCoor start at index 0. Store the starting
493  ! value in nFCount and nCCount respectively.
494 
495  do nn = 1, nproc
496  nfcount(nn) = nfsend(nn - 1)
497  nccount(nn) = ncoor(nn - 1)
498 
499  nfsend(nn) = nfsend(nn) + nfsend(nn - 1)
500  ncoor(nn) = ncoor(nn) + ncoor(nn - 1)
501  end do
502  !
503  ! Determine the integer and real buffers to store the subface
504  ! information to be communicated.
505  !
506  ! Allocate the memory for the integer and real buffers to store
507  ! the information of the subfaces to be communicated.
508 
509  nn = nfsend(nproc)
510  mm = ncoor(nproc)
511 
512  allocate (intbuf(10, nn), realbuf(3, mm), stat=ierr)
513  if (ierr /= 0) &
514  call terminate("check1to1Subfaces", &
515  "Memory allocation failure for intBuf and &
516  &realBuf")
517 
518  ! Repeat the loop over the number of local blocks and its subfaces
519  ! of the number of spectral solutions to be checked.
520 
521  do sps = 1, ntimeintervalsspectral
522  do nn = 1, ndom
523 
524  call setpointers(nn, 1_inttype, sps)
525 
526  ! Loop over the 1 to 1 subfaces.
527 
528  do mm = 1, n1to1
529 
530  ! Add the offset of nBocos to mm, such that the entries
531  ! in the arrays corresponds to this 1 to 1 subface.
532 
533  ll = mm + nbocos
534 
535  ! Store the donor range, the local block number, the
536  ! spectral solution and global block ID in intBuf.
537 
538  proc = neighproc(ll) + 1
539  nfcount(proc) = nfcount(proc) + 1
540  ii = nfcount(proc)
541 
542  intbuf(1, ii) = dinbeg(ll)
543  intbuf(2, ii) = dinend(ll)
544  intbuf(3, ii) = djnbeg(ll)
545  intbuf(4, ii) = djnend(ll)
546  intbuf(5, ii) = dknbeg(ll)
547  intbuf(6, ii) = dknend(ll)
548 
549  intbuf(7, ii) = neighblock(ll)
550  intbuf(8, ii) = sps
551 
552  intbuf(9, ii) = nbkglobal
553  intbuf(10, ii) = cgnssubface(ll)
554 
555  ! Determine whether the subface has positive or negative
556  ! running indices. To be sure that the correct sequence is
557  ! stored in realBuf, the loop must be performed over the
558  ! donor range (i, j, and k indices could be swapped and
559  ! therefore stored wrongly in the 1D buffer).
560 
561  stepi = 1; if (dinend(ll) < dinbeg(ll)) stepi = -1
562  stepj = 1; if (djnend(ll) < djnbeg(ll)) stepj = -1
563  stepk = 1; if (dknend(ll) < dknbeg(ll)) stepk = -1
564 
565  ! Determine the transformation matrix between the donor
566  ! and the current face. As the information stored in l1,
567  ! l2 and l3 is for the transformation matrix to the donor
568  ! face, the transpose must be taken.
569 
570  ll1 = l1(ll); ll2 = l2(ll); ll3 = l3(ll)
571 
572  trmat(1, 1) = sign(1_inttype, ll1) * delta(ll1, 1_inttype)
573  trmat(1, 2) = sign(1_inttype, ll1) * delta(ll1, 2_inttype)
574  trmat(1, 3) = sign(1_inttype, ll1) * delta(ll1, 3_inttype)
575 
576  trmat(2, 1) = sign(1_inttype, ll2) * delta(ll2, 1_inttype)
577  trmat(2, 2) = sign(1_inttype, ll2) * delta(ll2, 2_inttype)
578  trmat(2, 3) = sign(1_inttype, ll2) * delta(ll2, 3_inttype)
579 
580  trmat(3, 1) = sign(1_inttype, ll3) * delta(ll3, 1_inttype)
581  trmat(3, 2) = sign(1_inttype, ll3) * delta(ll3, 2_inttype)
582  trmat(3, 3) = sign(1_inttype, ll3) * delta(ll3, 3_inttype)
583 
584  ! Store the coordinates in realBuf by looping over the
585  ! points of the subface.
586 
587  ii = nccount(proc)
588 
589  do k = dknbeg(ll), dknend(ll), stepk
590  do j = djnbeg(ll), djnend(ll), stepj
591  do i = dinbeg(ll), dinend(ll), stepi
592 
593  ! Determine the nodal indices in the current block.
594 
595  ll1 = i - dinbeg(ll)
596  ll2 = j - djnbeg(ll)
597  ll3 = k - dknbeg(ll)
598 
599  ic = inbeg(ll) &
600  + trmat(1, 1) * ll1 + trmat(1, 2) * ll2 + trmat(1, 3) * ll3
601  jc = jnbeg(ll) &
602  + trmat(2, 1) * ll1 + trmat(2, 2) * ll2 + trmat(2, 3) * ll3
603  kc = knbeg(ll) &
604  + trmat(3, 1) * ll1 + trmat(3, 2) * ll2 + trmat(3, 3) * ll3
605 
606  ! Store the coordinates in the buffer.
607 
608  ii = ii + 1
609  realbuf(1, ii) = x(ic, jc, kc, 1)
610  realbuf(2, ii) = x(ic, jc, kc, 2)
611  realbuf(3, ii) = x(ic, jc, kc, 3)
612  end do
613  end do
614  end do
615 
616  ! Set ii to the number of points stored for this subface.
617  ! This number is needed when for the periodic correction.
618 
619  ii = ii - nccount(proc)
620 
621  ! Check if a periodic correction must be applied and if so
622  ! call the routine to do so for the coordinates of this
623  ! subface. Note that internally created subfaces due to
624  ! block splitting must be excluded from this test.
625 
626  k = cgnssubface(ll)
627  if (k > 0) then
628  if (cgnsdoms(nbkglobal)%conn1to1(k)%periodic) then
629 
630  j = nccount(proc) + 1
631  call periodictransformsubface(realbuf(1, j), ii, &
632  cgnsdoms(nbkglobal)%conn1to1(k)%rotationCenter, &
633  cgnsdoms(nbkglobal)%conn1to1(k)%rotationAngles, &
634  cgnsdoms(nbkglobal)%conn1to1(k)%translation)
635  end if
636  end if
637 
638  ! Update the counter nCCount(proc).
639 
640  nccount(proc) = nccount(proc) + ii
641 
642  end do
643  end do
644  end do
645  !
646  ! Determine the number of messages I will send and receive.
647  ! The term message in this routine means a the complete subface
648  ! info, i.e. a combination of an integer and real message.
649  !
650  ! Fill the array nCCount with 0's and 1's. A 0 indicates that no
651  ! message is sent to the corresponding processor.
652 
653  do nn = 1, nproc
654  nccount(nn) = 0
655  if (nfsend(nn) > nfsend(nn - 1)) nccount(nn) = 1
656  end do
657 
658  ! Make sure that no message is sent to myself. An offset of + 1
659  ! must be added, because the processor numbers start at 0 and
660  ! nCCount at 1.
661 
662  nccount(myid + 1) = 0
663 
664  ! Determine the number of message I have to receive.
665 
666  sizemessage = 1
667  call mpi_reduce_scatter(nccount, nmessagesreceive, &
668  sizemessage, adflow_integer, mpi_sum, &
669  adflow_comm_world, ierr)
670 
671  ! Send the data I have to send. Do not send a message to myself.
672  ! That is handled separately. As nonblocking sends must be used
673  ! to avoid deadlock and two messages are sent to a processor,
674  ! the sendRequests (stored in the module communication) are used
675  ! for the integer messages and the recvRequests (same module)
676  ! are used for the real messages.
677 
678  ii = 0
679  do nn = 1, nproc
680 
681  ! Check if something must be sent to this processor.
682 
683  if (nccount(nn) == 1) then
684 
685  ! Send the integer buffer.
686 
687  ii = ii + 1
688  procid = nn - 1
689  size = 10 * (nfsend(nn) - nfsend(nn - 1))
690  mm = nfsend(nn - 1) + 1
691 
692  call mpi_isend(intbuf(1, mm), size, adflow_integer, procid, &
693  procid, adflow_comm_world, sendrequests(ii), &
694  ierr)
695 
696  ! Send the real buffer.
697 
698  size = 3 * (ncoor(nn) - ncoor(nn - 1))
699  mm = ncoor(nn - 1) + 1
700 
701  call mpi_isend(realbuf(1, mm), size, adflow_real, procid, &
702  procid + 1, adflow_comm_world, &
703  recvrequests(ii), ierr)
704 
705  end if
706  end do
707 
708  ! Store the number of messages sent.
709 
710  nmessagessend = ii
711  !
712  ! Check the coordinates of the subfaces which should have been
713  ! sent to myself.
714  !
715  ! Initialize nBad to 0 and allocate the memory to store possible
716  ! bad subfaces.
717 
718  nbad = 0
719  allocate (badsubfaces(4, nfcheck), baddist(nfcheck), stat=ierr)
720  if (ierr /= 0) &
721  call terminate("check1to1Subfaces", &
722  "Memory allocation failure for badSubfaces &
723  &and badDist")
724 
725  ! Determine the number of local subfaces that must be checked.
726  ! If any present, check them.
727 
728  nn = nfsend(myid + 1) - nfsend(myid)
729  if (nn > 0) then
730  ii = nfsend(myid) + 1
731  mm = ncoor(myid) + 1
732  call checksubfacecoor(intbuf(1, ii), realbuf(1, mm), nn, &
733  nbad, badsubfaces, baddist, &
735  end if
736  !
737  ! Check the coordinates of the subfaces which are received from
738  ! other processors.
739  !
740  ! Loop over the number of messages to be received.
741 
742  do ii = 1, nmessagesreceive
743 
744  ! Wait until an integer message arrives and determine the
745  ! source and size of the message.
746 
747  call mpi_probe(mpi_any_source, myid, adflow_comm_world, &
748  mpistatus, ierr)
749 
750  procid = mpistatus(mpi_source)
751  call mpi_get_count(mpistatus, adflow_integer, size, ierr)
752 
753  ! Check in debug mode that the incoming message is of
754  ! correct size.
755 
756  if (debug) then
757  if (size == mpi_undefined .or. mod(size, 10) /= 0) &
758  call terminate("check1to1Subfaces", &
759  "Unexpected size of integer message")
760  end if
761 
762  ! Determine the number of subfaces this message contains and
763  ! allocate the memory for the integer receive buffer.
764 
765  nn = size / 10
766  allocate (intrecv(10, nn), stat=ierr)
767  if (ierr /= 0) &
768  call terminate("check1to1Subfaces", &
769  "Memory allocation failure for intRecv")
770 
771  ! Receive the integer buffer. Blocking receives can be used,
772  ! because the message has already arrived.
773 
774  call mpi_recv(intrecv, size, adflow_integer, procid, &
775  myid, adflow_comm_world, mpistatus, ierr)
776 
777  ! Probe for the corresponding real buffer and determine its
778  ! size.
779 
780  call mpi_probe(procid, myid + 1, adflow_comm_world, &
781  mpistatus, ierr)
782  call mpi_get_count(mpistatus, adflow_real, size, ierr)
783 
784  ! Check in debug mode that the incoming message is of
785  ! correct size.
786 
787  if (debug) then
788  if (size == mpi_undefined .or. mod(size, 3) /= 0) &
789  call terminate("check1to1Subfaces", &
790  "Unexpected size of real message")
791  end if
792 
793  ! Determine the total number of coordinates in the message and
794  ! allocate the memory for the real receive buffer.
795 
796  mm = size / 3
797  allocate (realrecv(3, mm), stat=ierr)
798  if (ierr /= 0) &
799  call terminate("check1to1Subfaces", &
800  "Memory allocation failure for realRecv")
801 
802  ! Receive the real buffer. Blocking receives can be used,
803  ! because the message has already arrived.
804 
805  call mpi_recv(realrecv, size, adflow_real, procid, &
806  myid + 1, adflow_comm_world, mpistatus, ierr)
807 
808  ! Check the subfaces stored in these messages.
809 
810  call checksubfacecoor(intrecv, realrecv, nn, nbad, &
811  badsubfaces, baddist, &
813 
814  ! Release the memory of the integer and real receive buffer.
815 
816  deallocate (intrecv, realrecv, stat=ierr)
817  if (ierr /= 0) &
818  call terminate("check1to1Subfaces", &
819  "Deallocation failure for intRecv &
820  &and realRecv")
821  end do
822 
823  ! Complete the nonblocking sends.
824 
825  size = nmessagessend
826  do nn = 1, nmessagessend
827  call mpi_waitany(size, sendrequests, procid, mpistatus, ierr)
828  call mpi_waitany(size, recvrequests, procid, mpistatus, ierr)
829  end do
830 
831  ! Deallocate the memory for the integer and real buffers.
832 
833  deallocate (intbuf, realbuf, stat=ierr)
834  if (ierr /= 0) &
835  call terminate("check1to1Subfaces", &
836  "Deallocation failure for intBuf and realBuf")
837  !
838  ! Determine the global number of bad subfaces and gather this
839  ! information.
840  !
841  ! Determine the global number of bad subfaces.
842 
843  call mpi_allgather(nbad, 1, adflow_integer, nccount, 1, &
844  adflow_integer, adflow_comm_world, ierr)
845 
846  ! Determine the global number of bad subfaces and the arrays
847  ! recvcounts and displs needed for the call to allgatherv
848 
849  nbadglobal = nccount(1)
850  recvcounts(1) = nccount(1)
851  displs(1) = 0
852 
853  do nn = 2, nproc
854  nbadglobal = nbadglobal + nccount(nn)
855  recvcounts(nn) = nccount(nn)
856  displs(nn) = displs(nn - 1) + recvcounts(nn - 1)
857  end do
858 
859  ! Allocate the memory to store the global bad surfaces.
860 
861  allocate (badglobal(4, nbadglobal), baddistglobal(nbadglobal), &
862  stat=ierr)
863  if (ierr /= 0) &
864  call terminate("check1to1Subfaces", &
865  "Memory allocation failure for badGlobal &
866  &and badDistGlobal")
867 
868  ! Gather the data. First the distance info.
869 
870  size = nbad
871  call mpi_allgatherv(baddist, size, adflow_real, baddistglobal, &
872  recvcounts, displs, adflow_real, &
873  adflow_comm_world, ierr)
874 
875  ! And the integer info. Multiply recvcounts and displs
876  ! by 4, because 4 integers are received.
877 
878  do nn = 1, nproc
879  recvcounts(nn) = 4 * recvcounts(nn)
880  displs(nn) = 4 * displs(nn)
881  end do
882 
883  size = 4 * nbad
884  call mpi_allgatherv(badsubfaces, size, adflow_integer, badglobal, &
885  recvcounts, displs, adflow_integer, &
886  adflow_comm_world, ierr)
887 
888  ! Sort the bad subfaces and get rid of the multiple entries.
889 
890  call sortbadentities(nbadglobal, badglobal, baddistglobal, .true.)
891 
892  ! Check for the presence of any internally created subfaces.
893  ! This only occurs when something goes wrong in the block
894  ! splitting and therefore the program is terminated.
895 
896  do nn = 1, nbadglobal
897  if (badglobal(2, nn) == 0) then
898  if (myid == 0) &
899  call terminate("check1to1Subfaces", &
900  "Non-matching internally created &
901  &face found.")
902  call mpi_barrier(adflow_comm_world, ierr)
903  end if
904  end do
905 
906  ! Print the bad subfaces, if present. Only processor 0 performs
907  ! this task.
908 
909  devformat = "(7(A), ES12.5)"
910  spectraldevformat = "(9(A), ES12.5)"
911 
912  if (myid == 0 .and. nbadglobal > 0) then
913 
914  write (intstring, "(i6)") nbadglobal
915  intstring = adjustl(intstring)
916 
917  print "(a)", "#"
918  print strings, "# Warning"
919  print strings, "# Found ", trim(intstring), " one to one subfaces which do not coincide."
920  print strings, "# Computation continues, but be aware of it."
921  print strings, "# List of nonmatching one to one subfaces."
922  print "(a)", "#"
923 
924  do nn = 1, nbadglobal
925  i = badglobal(1, nn)
926  j = badglobal(2, nn)
927 
928  write (intstring, "(i6)") badglobal(3, nn)
929  intstring = adjustl(intstring)
930 
931  ! Write a different error message if more than one grid has
932  ! been read.
933 
934  if (ntimeintervalsspectral > 1) then
935 
936  if (badglobal(4, nn) == 1) then
937  print spectraldevformat, "# Spectral grid ", trim(intstring), &
938  ", zone ", trim(cgnsdoms(i)%zoneName), &
939  ", periodic subface ", trim(cgnsdoms(i)%conn1to1(j)%connectName), &
940  " does not match donor ", trim(cgnsdoms(i)%conn1to1(j)%donorName), &
941  ". Maximum deviation: ", baddistglobal(nn)
942  else
943  print spectraldevformat, "# Spectral grid ", trim(intstring), &
944  ", zone ", trim(cgnsdoms(i)%zoneName), &
945  ", subface ", trim(cgnsdoms(i)%conn1to1(j)%connectName), &
946  " does not match donor ", trim(cgnsdoms(i)%conn1to1(j)%donorName), &
947  ". Maximum deviation: ", baddistglobal(nn)
948  end if
949 
950  else
951 
952  if (badglobal(4, nn) == 1) then
953  print devformat, "Zone ", trim(cgnsdoms(i)%zoneName), &
954  ", periodic subface ", trim(cgnsdoms(i)%conn1to1(j)%connectName), &
955  " does not match donor ", trim(cgnsdoms(i)%conn1to1(j)%donorName), &
956  ". Maximum deviation: ", baddistglobal(nn)
957  else
958  print devformat, "Zone ", trim(cgnsdoms(i)%zoneName), &
959  ", subface ", trim(cgnsdoms(i)%conn1to1(j)%connectName), &
960  " does not match donor ", trim(cgnsdoms(i)%conn1to1(j)%donorName), &
961  ". Maximum deviation: ", baddistglobal(nn)
962  end if
963 
964  end if
965  end do
966 
967  print "(a)", "#"
968 
969  end if
970 
971  ! Deallocate the memory of to store the bad subfaces.
972 
973  deallocate (badsubfaces, badglobal, baddist, baddistglobal, &
974  stat=ierr)
975  if (ierr /= 0) &
976  call terminate("check1to1Subfaces", &
977  "Deallocation failure for badSubfaces, &
978  &badGlobal, badDist and badDistGlobal")
979 
980  ! Synchronize the processors, because wild cards have been used.
981 
982  call mpi_barrier(adflow_comm_world, ierr)
983 
984  end subroutine check1to1subfaces
985 
986  ! ==================================================================
987 
988  subroutine periodictransformsubface(coor, nn, rotCenter, &
989  rotAngles, translation)
990  !
991  ! periodicTransformSubface transforms the given set of
992  ! coordinates using the periodic transformation defined by
993  ! rotCenter, rotAngles and translation.
994  !
995  use constants
996  implicit none
997  !
998  ! Subroutine arguments.
999  !
1000  integer(kind=intType), intent(in) :: nn
1001 
1002  real(kind=realtype), dimension(3), intent(in) :: rotcenter
1003  real(kind=realtype), dimension(3), intent(in) :: rotangles
1004  real(kind=realtype), dimension(3), intent(in) :: translation
1005 
1006  real(kind=realtype), dimension(3, nn), intent(inout) :: coor
1007  !
1008  ! Local variables.
1009  !
1010  integer(kind=intType) :: i
1011 
1012  real(kind=realtype) :: costheta, cosphi, cospsi
1013  real(kind=realtype) :: sintheta, sinphi, sinpsi
1014  real(kind=realtype) :: dx, dy, dz
1015 
1016  real(kind=realtype), dimension(3) :: trans
1017  real(kind=realtype), dimension(3, 3) :: rotmatrix
1018 
1019  ! Construct from the given rotation angles the rotation matrix
1020  ! from the current coordinates to the donor coordinates.
1021  ! Note that the sequence of rotation is first rotation around the
1022  ! x-axis, followed by rotation around the y-axis and finally
1023  ! rotation around the z-axis.
1024 
1025  costheta = cos(rotangles(1)); sintheta = sin(rotangles(1))
1026  cosphi = cos(rotangles(2)); sinphi = sin(rotangles(2))
1027  cospsi = cos(rotangles(3)); sinpsi = sin(rotangles(3))
1028 
1029  rotmatrix(1, 1) = cosphi * cospsi
1030  rotmatrix(2, 1) = cosphi * sinpsi
1031  rotmatrix(3, 1) = -sinphi
1032 
1033  rotmatrix(1, 2) = sintheta * sinphi * cospsi - costheta * sinpsi
1034  rotmatrix(2, 2) = sintheta * sinphi * sinpsi + costheta * cospsi
1035  rotmatrix(3, 2) = sintheta * cosphi
1036 
1037  rotmatrix(1, 3) = costheta * sinphi * cospsi + sintheta * sinpsi
1038  rotmatrix(2, 3) = costheta * sinphi * sinpsi - sintheta * cospsi
1039  rotmatrix(3, 3) = costheta * cosphi
1040 
1041  ! Store the translation plus the rotation center in trans.
1042 
1043  trans(1) = rotcenter(1) + translation(1)
1044  trans(2) = rotcenter(2) + translation(2)
1045  trans(3) = rotcenter(3) + translation(3)
1046 
1047  ! Loop over the number of coordinates to be corrected.
1048 
1049  do i = 1, nn
1050 
1051  ! Determine the relative position w.R.T. The rotation center.
1052 
1053  dx = coor(1, i) - rotcenter(1)
1054  dy = coor(2, i) - rotcenter(2)
1055  dz = coor(3, i) - rotcenter(3)
1056 
1057  ! Determine the coordinates after the transformation.
1058 
1059  coor(1, i) = rotmatrix(1, 1) * dx + rotmatrix(1, 2) * dy &
1060  + rotmatrix(1, 3) * dz + trans(1)
1061  coor(2, i) = rotmatrix(2, 1) * dx + rotmatrix(2, 2) * dy &
1062  + rotmatrix(2, 3) * dz + trans(2)
1063  coor(3, i) = rotmatrix(3, 1) * dx + rotmatrix(3, 2) * dy &
1064  + rotmatrix(3, 3) * dz + trans(3)
1065 
1066  end do
1067 
1068  end subroutine periodictransformsubface
1069 
1070  ! ==================================================================
1071 
1072  subroutine checksubfacecoor(subfaceInfo, coor, nFace, &
1073  nBad, badSubfaces, badDist, &
1074  nSpectral)
1075  !
1076  ! checkSubfaceCoor checks if the coordinates of the subfaces
1077  ! defined in subfaceInfo and coor match the coordinates stored
1078  ! in flowDoms.
1079  !
1080  use constants
1081  use blockpointers
1082  use cgnsgrid
1083  use communication
1084  use utils, only: setpointers, terminate
1085  use commonformats, only: strings
1086  implicit none
1087  !
1088  ! Subroutine arguments.
1089  !
1090  integer(kind=intType), intent(in) :: nFace, nSpectral
1091  integer(kind=intType), intent(inout) :: nBad
1092 
1093  integer(kind=intType), dimension(10, *), intent(in) :: subfaceInfo
1094  integer(kind=intType), dimension(4, *), intent(inout) :: badSubfaces
1095 
1096  real(kind=realtype), dimension(*), intent(inout) :: baddist
1097  real(kind=realtype), dimension(3, *), intent(in) :: coor
1098  !
1099  ! Local parameter.
1100  !
1101  real(kind=realtype), parameter :: reltol = 0.05_realtype
1102  !
1103  ! Local variables.
1104  !
1105  integer(kind=intType) :: i, j, k, ii, jj, mm, nn
1106  integer(kind=intType) :: stepI, stepJ, stepK
1107  integer(kind=intType) :: im1, ip1, jm1, jp1, km1, kp1
1108  integer(kind=intType) :: iBeg, iEnd, jBeg, jEnd, kBeg, kEnd
1109  integer(kind=intType) :: blockID, sps, globalDonID, subfaceID
1110 
1111  real(kind=realtype) :: dist2, dist2i, dist2j, dist2k, tol
1112  real(kind=realtype) :: facti, factj, factk, diffmax
1113 
1114  character(len=maxStringLen) :: errorMessage
1115  character(len=7) :: intString
1116 
1117  logical :: badFace
1118 
1119  ! Initialize the counter ii for the coordinates and loop over the
1120  ! number of subfaces to be checked.
1121 
1122  ii = 0
1123  subfaceloop: do nn = 1, nface
1124 
1125  ! Store the integer info a bit easier.
1126 
1127  ibeg = subfaceinfo(1, nn)
1128  iend = subfaceinfo(2, nn)
1129  jbeg = subfaceinfo(3, nn)
1130  jend = subfaceinfo(4, nn)
1131  kbeg = subfaceinfo(5, nn)
1132  kend = subfaceinfo(6, nn)
1133 
1134  blockid = subfaceinfo(7, nn)
1135  sps = subfaceinfo(8, nn)
1136  globaldonid = subfaceinfo(9, nn)
1137  subfaceid = subfaceinfo(10, nn)
1138 
1139  ! Set the pointers to the block to be searched.
1140 
1141  call setpointers(blockid, 1_inttype, sps)
1142 
1143  ! Find the matching 1 to 1 subface.
1144 
1145  do mm = 1, n1to1
1146 
1147  ! Add the offset of nBocos to nn such that it contains the
1148  ! correct index of the arrays.
1149 
1150  jj = mm + nbocos
1151 
1152  ! If this is the subface exit the loop.
1153 
1154  if (min(ibeg, iend) == min(inbeg(jj), inend(jj)) .and. &
1155  max(ibeg, iend) == max(inbeg(jj), inend(jj)) .and. &
1156  min(jbeg, jend) == min(jnbeg(jj), jnend(jj)) .and. &
1157  max(jbeg, jend) == max(jnbeg(jj), jnend(jj)) .and. &
1158  min(kbeg, kend) == min(knbeg(jj), knend(jj)) .and. &
1159  max(kbeg, kend) == max(knbeg(jj), knend(jj))) exit
1160 
1161  end do
1162 
1163  ! Check if a subface was found. If not terminate.
1164 
1165  if (mm > n1to1) then
1166 
1167  if (nspectral > 1) then
1168  write (intstring, "(i6)") sps
1169  intstring = adjustl(intstring)
1170  write (errormessage, strings) "Spectral grid ", trim(intstring), &
1171  ", Zone ", trim(cgnsdoms(globaldonid)%zoneName), &
1172  "Connectivity ", trim(cgnsdoms(globaldonid)%conn1to1(subfaceid)%connectName), &
1173  ": 1 to 1 subface not found. Something is seriously wrong with the zone connectivity."
1174 
1175  else
1176  write (errormessage, strings) "Zone ", trim(cgnsdoms(globaldonid)%zoneName), &
1177  "Connectivity", trim(cgnsdoms(globaldonid)%conn1to1(subfaceid)%connectName), &
1178  ": 1 to 1 subface not found. Something is seriously wrong with the zone connectivity."
1179  end if
1180 
1181  call terminate("checkSubfaceCoor", errormessage)
1182 
1183  end if
1184 
1185  ! Determine whether positive or negative running indices must
1186  ! be used for the subface. This depends on the sequence stored
1187  ! in the coordinate buffer and not of the sequence of the
1188  ! 1 to 1 subface mm.
1189 
1190  stepi = 1; if (iend < ibeg) stepi = -1
1191  stepj = 1; if (jend < jbeg) stepj = -1
1192  stepk = 1; if (kend < kbeg) stepk = -1
1193 
1194  ! Initialize badFace to .false. to indicate that it is
1195  ! a correct subface. Set the maximum difference to zero.
1196 
1197  badface = .false.
1198  diffmax = zero
1199 
1200  ! Loop over the coordinates of the subface to see if they
1201  ! match of to a certain tolerance.
1202 
1203  do k = kbeg, kend, stepk
1204 
1205  ! Determine the indices to the left and to the right.
1206  ! Do not exceed the block boundary. Determine the
1207  ! scaling factor of the tolerance accordingly.
1208 
1209  km1 = max(1_inttype, k - 1_inttype)
1210  kp1 = min(kl, k + 1_inttype)
1211 
1212  factk = one
1213  if (km1 == k) factk = factk * four
1214  if (kp1 == k) factk = factk * four
1215 
1216  ! Loop in j-direction.
1217 
1218  do j = jbeg, jend, stepj
1219 
1220  ! Determine the neighbors to the left and right and factJ.
1221 
1222  jm1 = max(1_inttype, j - 1_inttype)
1223  jp1 = min(jl, j + 1_inttype)
1224 
1225  factj = one
1226  if (jm1 == j) factj = factj * four
1227  if (jp1 == j) factj = factj * four
1228 
1229  ! Loop in i-direction.
1230 
1231  do i = ibeg, iend, stepi
1232 
1233  ! Determine the neighbors to the left and right and factI.
1234 
1235  im1 = max(1_inttype, i - 1_inttype)
1236  ip1 = min(il, i + 1_inttype)
1237 
1238  facti = one
1239  if (im1 == i) facti = facti * four
1240  if (ip1 == i) facti = facti * four
1241 
1242  ! Determine the distances squared in i, j and k direction.
1243  ! The reason for squared is that some square roots are
1244  ! avoided this way.
1245 
1246  dist2i = (x(ip1, j, k, 1) - x(im1, j, k, 1))**2 &
1247  + (x(ip1, j, k, 2) - x(im1, j, k, 2))**2 &
1248  + (x(ip1, j, k, 3) - x(im1, j, k, 3))**2
1249 
1250  dist2j = (x(i, jp1, k, 1) - x(i, jm1, k, 1))**2 &
1251  + (x(i, jp1, k, 2) - x(i, jm1, k, 2))**2 &
1252  + (x(i, jp1, k, 3) - x(i, jm1, k, 3))**2
1253 
1254  dist2k = (x(i, j, kp1, 1) - x(i, j, km1, 1))**2 &
1255  + (x(i, j, kp1, 2) - x(i, j, km1, 2))**2 &
1256  + (x(i, j, kp1, 3) - x(i, j, km1, 3))**2
1257 
1258  ! Make sure that singular lines are excluded.
1259 
1260  if (dist2i < eps) dist2i = large
1261  if (dist2j < eps) dist2j = large
1262  if (dist2k < eps) dist2k = large
1263 
1264  ! Determine the tolerance for identical points.
1265  ! Note the multiplication with the square of the relative
1266  ! tolerance, because the distances are squared as well.
1267 
1268  tol = factk * dist2k
1269  tol = min(tol, factj * dist2j)
1270  tol = min(tol, facti * dist2i)
1271 
1272  tol = tol * reltol * reltol
1273 
1274  ! Update the counter for the coordinate in the buffer
1275  ! and determine the distance squared between the points
1276  ! that should be identical.
1277 
1278  ii = ii + 1
1279  dist2 = (x(i, j, k, 1) - coor(1, ii))**2 &
1280  + (x(i, j, k, 2) - coor(2, ii))**2 &
1281  + (x(i, j, k, 3) - coor(3, ii))**2
1282 
1283  ! Flag the subface to bad if the nodes do not coincide
1284  ! within the given tolerance. Store the difference if
1285  ! it is larger than the currently stored value.
1286 
1287  if (dist2 > tol) then
1288  badface = .true.
1289  diffmax = max(diffmax, dist2)
1290  end if
1291 
1292  end do
1293  end do
1294  end do
1295 
1296  ! Store this subface if it is not matching. The following data
1297  ! is stored: global block number of the donor, the subface ID
1298  ! on this block, the spectral solution, whether or not this
1299  ! is a periodic face and the maximum difference.
1300 
1301  if (badface) then
1302  nbad = nbad + 1
1303 
1304  badsubfaces(1, nbad) = globaldonid
1305  badsubfaces(2, nbad) = subfaceid
1306  badsubfaces(3, nbad) = sps
1307 
1308  badsubfaces(4, nbad) = 0
1309  if (subfaceid > 0) then
1310  if (cgnsdoms(globaldonid)%conn1to1(subfaceid)%periodic) &
1311  badsubfaces(4, nbad) = 1
1312  end if
1313 
1314  baddist(nbad) = sqrt(diffmax)
1315 
1316  ! if(subfaceID == 0 .and. myID == 1) then
1317  ! write(*,*) "myID: ", myID, badDist(nBad)
1318  ! write(*,*) blockID, mm, globalDonID, nbkGlobal
1319  ! write(*,"(6I4)") iBegor, iEndor, jBegor, jEndor, kBegor, kEndor
1320 
1321  ! jj = mm + nBocos
1322  ! write(*,"(6I4)") inBeg(jj),inEnd(jj), jnBeg(jj),jnEnd(jj), knBeg(jj),knEnd(jj)
1323  ! endif
1324  end if
1325 
1326  end do subfaceloop
1327 
1328  end subroutine checksubfacecoor
1329 end module gridchecking
integer(kind=inttype), dimension(:), pointer djnbeg
integer(kind=inttype), dimension(:), pointer dinend
integer(kind=inttype) jl
integer(kind=inttype), dimension(:), pointer knend
integer(kind=inttype), dimension(:), pointer inend
integer(kind=inttype), dimension(:), pointer djnend
integer(kind=inttype), dimension(:), pointer knbeg
integer(kind=inttype), dimension(:), pointer jnbeg
integer(kind=inttype), dimension(:), pointer cgnssubface
integer(kind=inttype), dimension(:), pointer neighblock
integer(kind=inttype), dimension(:), pointer neighproc
integer(kind=inttype) nbkglobal
integer(kind=inttype), dimension(:), pointer bcfaceid
integer(kind=inttype), dimension(:), pointer dknend
integer(kind=inttype) nbocos
integer(kind=inttype), dimension(:), pointer jnend
integer(kind=inttype) n1to1
integer(kind=inttype), dimension(:), pointer l1
integer(kind=inttype), dimension(:), pointer l3
integer(kind=inttype), dimension(:), pointer dknbeg
integer(kind=inttype), dimension(:), pointer dinbeg
integer(kind=inttype) nsubface
real(kind=realtype), dimension(:, :, :, :), pointer x
integer(kind=inttype), dimension(:), pointer inbeg
integer(kind=inttype), dimension(:), pointer l2
integer(kind=inttype) kl
integer(kind=inttype) il
type(cgnsblockinfotype), dimension(:), allocatable cgnsdoms
Definition: cgnsGrid.F90:495
integer(kind=inttype) cgnsndom
Definition: cgnsGrid.F90:491
character(len=maxstringlen) strings
integer, dimension(:), allocatable recvrequests
integer, dimension(:), allocatable sendrequests
integer adflow_comm_world
real(kind=realtype), parameter zero
Definition: constants.F90:71
integer(kind=inttype), parameter imax
Definition: constants.F90:293
integer(kind=inttype), parameter kmin
Definition: constants.F90:296
real(kind=realtype), parameter four
Definition: constants.F90:75
integer(kind=inttype), parameter jmax
Definition: constants.F90:295
real(kind=realtype), parameter eps
Definition: constants.F90:23
real(kind=realtype), parameter one
Definition: constants.F90:72
integer(kind=inttype), parameter imin
Definition: constants.F90:292
real(kind=realtype), parameter large
Definition: constants.F90:24
integer(kind=inttype), parameter kmax
Definition: constants.F90:297
integer(kind=inttype), parameter jmin
Definition: constants.F90:294
subroutine check1to1subfaces
subroutine checksubfacecoor(subfaceInfo, coor, nFace, nBad, badSubfaces, badDist, nSpectral)
subroutine checkfacesblock(blockIsBad, faceID, multiple)
subroutine periodictransformsubface(coor, nn, rotCenter, rotAngles, translation)
subroutine checkfaces
Definition: gridChecking.F90:4
integer(kind=inttype) ntimeintervalsspectral
Definition: inputParam.F90:645
subroutine sortbadentities(nEntities, entities, dist, sortDist)
Definition: utils.F90:1
integer(kind=inttype) function delta(val1, val2)
Definition: utils.F90:2534
subroutine setpointers(nn, mm, ll)
Definition: utils.F90:3237
subroutine terminate(routineName, errorMessage)
Definition: utils.F90:502