Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_ModTopologyUtils.F90
Go to the documentation of this file.
1 ! *********************************************************************
2 ! * Rocstar Simulation Suite *
3 ! * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4 ! * *
5 ! * Illinois Rocstar LLC *
6 ! * Champaign, IL *
7 ! * www.illinoisrocstar.com *
8 ! * sales@illinoisrocstar.com *
9 ! * *
10 ! * License: See LICENSE file in top level of distribution package or *
11 ! * http://opensource.org/licenses/NCSA *
12 ! *********************************************************************
13 ! *********************************************************************
14 ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15 ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16 ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17 ! * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18 ! * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19 ! * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20 ! * Arising FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21 ! * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22 ! *********************************************************************
23 ! ******************************************************************************
24 !
25 ! Purpose: Suite of topology routines.
26 !
27 ! Description: None.
28 !
29 ! Notes: None.
30 !
31 ! ******************************************************************************
32 !
33 ! $Id: RFLU_ModTopologyUtils.F90,v 1.9 2008/12/06 08:44:24 mtcampbe Exp $
34 !
35 ! Copyright: (c) 2004-2005 by the University of Illinois
36 !
37 ! ******************************************************************************
38 
40 
41  USE modglobal, ONLY: t_global
42  USE moddatatypes
43  USE modparameters
44  USE moderror
45  USE modgrid, ONLY: t_grid
46  USE modmpi
47 
48  USE modsortsearch
49 
50  IMPLICIT NONE
51 
52  PRIVATE
53  PUBLIC :: rflu_buildcellvertlist, &
57 
58 ! ******************************************************************************
59 ! Declarations and definitions
60 ! ******************************************************************************
61 
62  CHARACTER(CHRLEN) :: &
63  RCSIdentString = '$RCSfile: RFLU_ModTopologyUtils.F90,v $ $Revision: 1.9 $'
64 
65 
66 ! ******************************************************************************
67 ! Routines
68 ! ******************************************************************************
69 
70  CONTAINS
71 
72 
73 
74 
75 
76 ! ******************************************************************************
77 !
78 ! Purpose: Build list of vertices given list of cells.
79 !
80 ! Description: None.
81 !
82 ! Input:
83 ! global Pointer to global data
84 ! pGrid Pointer to grid
85 ! cList List of cells
86 ! cListDim Number of cells
87 ! vListDimMax Maximum number of vertices
88 !
89 ! Output:
90 ! vList List of vertices
91 ! vListDim Actual number of vertices
92 !
93 ! Notes: None.
94 !
95 ! ******************************************************************************
96 
97  SUBROUTINE rflu_buildcellvertlist(global,pGrid,cList,cListDim,vList, &
98  vlistdimmax,vlistdim)
99 
101 
102  IMPLICIT NONE
103 
104 ! ******************************************************************************
105 ! Declarations and definitions
106 ! ******************************************************************************
107 
108 ! ==============================================================================
109 ! Arguments
110 ! ==============================================================================
111 
112  INTEGER, INTENT(IN) :: clistdim,vlistdimmax
113  INTEGER, INTENT(OUT) :: vlistdim
114  INTEGER, INTENT(IN) :: clist(clistdim)
115  INTEGER, INTENT(OUT) :: vlist(vlistdimmax)
116  TYPE(t_grid), POINTER :: pgrid
117  TYPE(t_global), POINTER :: global
118 
119 ! ==============================================================================
120 ! Locals
121 ! ==============================================================================
122 
123  INTEGER :: i,icg,icl,ict,ivl,key,errorflag
124 
125 ! ******************************************************************************
126 ! Start
127 ! ******************************************************************************
128 
129  CALL registerfunction(global,'RFLU_BuildCellVertList',&
130  'RFLU_ModTopologyUtils.F90')
131 
132 ! ******************************************************************************
133 ! Initialize
134 ! ******************************************************************************
135 
136  vlistdim = 0
137 
138  DO i = 1,vlistdimmax
139  vlist(i) = 0
140  END DO ! i
141 
142 ! ******************************************************************************
143 ! Create hash table
144 ! ******************************************************************************
145 
146  CALL rflu_createhashtable(global,vlistdimmax)
147 
148 ! ******************************************************************************
149 ! Build vertex list
150 ! ******************************************************************************
151 
152  DO i = 1,clistdim
153  icg = clist(i)
154 
155  ict = pgrid%cellGlob2Loc(1,icg)
156  icl = pgrid%cellGlob2Loc(2,icg)
157 
158  SELECT CASE ( ict )
159  CASE ( cell_type_tet )
160  DO ivl = 1,4
161  CALL rflu_hashbuildkey(pgrid%tet2v(ivl:ivl,icl),1,key)
162  CALL rflu_hashvertex(global,key,pgrid%tet2v(ivl,icl),vlistdim, &
163  vlist)
164  END DO ! ivl
165  CASE ( cell_type_hex )
166  DO ivl = 1,8
167  CALL rflu_hashbuildkey(pgrid%hex2v(ivl:ivl,icl),1,key)
168  CALL rflu_hashvertex(global,key,pgrid%hex2v(ivl,icl),vlistdim, &
169  vlist)
170  END DO ! ivl
171  CASE ( cell_type_pri )
172  DO ivl = 1,6
173  CALL rflu_hashbuildkey(pgrid%pri2v(ivl:ivl,icl),1,key)
174  CALL rflu_hashvertex(global,key,pgrid%pri2v(ivl,icl),vlistdim, &
175  vlist)
176  END DO ! ivl
177  CASE ( cell_type_pyr )
178  DO ivl = 1,5
179  CALL rflu_hashbuildkey(pgrid%pyr2v(ivl:ivl,icl),1,key)
180  CALL rflu_hashvertex(global,key,pgrid%pyr2v(ivl,icl),vlistdim, &
181  vlist)
182  END DO ! ivl
183  CASE default
184  CALL errorstop(global,err_reached_default,__line__)
185  END SELECT ! ict
186  END DO ! i
187 
188 ! ******************************************************************************
189 ! Destroy hash table
190 ! ******************************************************************************
191 
192  CALL rflu_destroyhashtable(global)
193 
194 ! ******************************************************************************
195 ! Sort list of vertices
196 ! ******************************************************************************
197 
198  CALL quicksortinteger(vlist(1:vlistdim),vlistdim)
199 
200 ! ******************************************************************************
201 ! End
202 ! ******************************************************************************
203 
204  CALL deregisterfunction(global)
205 
206  END SUBROUTINE rflu_buildcellvertlist
207 
208 
209 
210 
211 
212 
213 
214 
215 ! ******************************************************************************
216 !
217 ! Purpose: Build list of vertices given list of cells.
218 !
219 ! Description: None.
220 !
221 ! Input:
222 ! global Pointer to global data
223 ! connList List of entities in connectivity list
224 ! connListDim1 Number of entries per entity
225 ! connListDim2 Number of entities in connectivity
226 ! vListDimMax Maximum number of vertices
227 !
228 ! Output:
229 ! vList List of vertices
230 ! vListDim Actual number of vertices
231 !
232 ! Notes: None.
233 !
234 ! ******************************************************************************
235 
236  SUBROUTINE rflu_buildconnvertlist(global,connList,connListDim1,connListDim2, &
237  vlist,vlistdimmax,vlistdim)
238 
240 
241  IMPLICIT NONE
242 
243 ! ******************************************************************************
244 ! Declarations and definitions
245 ! ******************************************************************************
246 
247 ! ==============================================================================
248 ! Arguments
249 ! ==============================================================================
250 
251  INTEGER, INTENT(IN) :: connlistdim1,connlistdim2,vlistdimmax
252  INTEGER, INTENT(OUT) :: vlistdim
253  INTEGER, INTENT(IN) :: connlist(connlistdim1,connlistdim2)
254  INTEGER, INTENT(OUT) :: vlist(vlistdimmax)
255  TYPE(t_global), POINTER :: global
256 
257 ! ==============================================================================
258 ! Locals
259 ! ==============================================================================
260 
261  INTEGER :: i,i1,i2,ivl,key
262 
263 ! ******************************************************************************
264 ! Start
265 ! ******************************************************************************
266 
267  CALL registerfunction(global,'RFLU_BuildConnVertList',&
268  'RFLU_ModTopologyUtils.F90')
269 
270 ! ******************************************************************************
271 ! Initialize
272 ! ******************************************************************************
273 
274  vlistdim = 0
275 
276  DO i = 1,vlistdimmax
277  vlist(i) = 0
278  END DO ! i
279 
280 ! ******************************************************************************
281 ! Create hash table
282 ! ******************************************************************************
283 
284  CALL rflu_createhashtable(global,vlistdimmax)
285 
286 ! ******************************************************************************
287 ! Build vertex list
288 ! ******************************************************************************
289 
290  DO i2 = 1,connlistdim2
291  DO i1 = 1,connlistdim1
292  CALL rflu_hashbuildkey(connlist(i1:i1,i2),1,key)
293  CALL rflu_hashvertex(global,key,connlist(i1,i2),vlistdim,vlist)
294  END DO ! i1
295  END DO ! i2
296 
297 ! ******************************************************************************
298 ! Destroy hash table
299 ! ******************************************************************************
300 
301  CALL rflu_destroyhashtable(global)
302 
303 ! ******************************************************************************
304 ! Sort list of vertices
305 ! ******************************************************************************
306 
307  CALL quicksortinteger(vlist(1:vlistdim),vlistdim)
308 
309 ! ******************************************************************************
310 ! End
311 ! ******************************************************************************
312 
313  CALL deregisterfunction(global)
314 
315  END SUBROUTINE rflu_buildconnvertlist
316 
317 
318 
319 
320 
321 
322 
323 
324 
325 ! ******************************************************************************
326 !
327 ! Purpose: Build list of vertices given list of faces.
328 !
329 ! Description: None.
330 !
331 ! Input:
332 ! global Pointer to global data
333 ! pGrid Pointer to grid
334 ! fList List of faces
335 ! fListDim Number of faces
336 ! vListDimMax Maximum number of vertices
337 !
338 ! Output:
339 ! vList List of vertices
340 ! vListDim Actual number of vertices
341 ! errorFlag Error flag
342 !
343 ! Notes: None.
344 !
345 ! ******************************************************************************
346 
347  SUBROUTINE rflu_buildfacevertlist(global,pGrid,fList,fListDim,vList, &
348  vlistdimmax,vlistdim,errorflag)
349 
351 
352  IMPLICIT NONE
353 
354 ! ******************************************************************************
355 ! Declarations and definitions
356 ! ******************************************************************************
357 
358 ! ==============================================================================
359 ! Arguments
360 ! ==============================================================================
361 
362  INTEGER, INTENT(IN) :: flistdim,vlistdimmax
363  INTEGER, INTENT(OUT) :: errorflag,vlistdim
364  INTEGER, INTENT(IN) :: flist(flistdim)
365  INTEGER, INTENT(OUT) :: vlist(vlistdimmax)
366  TYPE(t_grid), POINTER :: pgrid
367  TYPE(t_global), POINTER :: global
368 
369 ! ==============================================================================
370 ! Locals
371 ! ==============================================================================
372 
373  INTEGER :: i,ifg,key
374 
375 ! ******************************************************************************
376 ! Start
377 ! ******************************************************************************
378 
379  CALL registerfunction(global,'RFLU_BuildFaceVertList',&
380  'RFLU_ModTopologyUtils.F90')
381 
382 ! ******************************************************************************
383 ! Initialize
384 ! ******************************************************************************
385 
386  vlistdim = 0
387 
388  DO i = 1,vlistdimmax
389  vlist(i) = 0
390  END DO ! i
391 
392 ! ******************************************************************************
393 ! Create hash table
394 ! ******************************************************************************
395 
396  CALL rflu_createhashtable(global,vlistdimmax)
397 
398 ! ******************************************************************************
399 ! Build vertex list
400 ! ******************************************************************************
401 
402  iloop: DO i = 1,flistdim
403  ifg = flist(i)
404 
405  CALL rflu_hashbuildkey(pgrid%f2v(1,ifg:ifg),1,key)
406  CALL rflu_hashvertex(global,key,pgrid%f2v(1,ifg),vlistdim,vlist,errorflag)
407 
408  IF ( errorflag /= err_none ) THEN
409  EXIT iloop
410  END IF ! errorFlag
411 
412  CALL rflu_hashbuildkey(pgrid%f2v(2,ifg:ifg),1,key)
413  CALL rflu_hashvertex(global,key,pgrid%f2v(2,ifg),vlistdim,vlist,errorflag)
414 
415  IF ( errorflag /= err_none ) THEN
416  EXIT iloop
417  END IF ! errorFlag
418 
419  CALL rflu_hashbuildkey(pgrid%f2v(3,ifg:ifg),1,key)
420  CALL rflu_hashvertex(global,key,pgrid%f2v(3,ifg),vlistdim,vlist,errorflag)
421 
422  IF ( errorflag /= err_none ) THEN
423  EXIT iloop
424  END IF ! errorFlag
425 
426  IF ( pgrid%f2v(4,ifg) /= vert_none ) THEN
427  CALL rflu_hashbuildkey(pgrid%f2v(4,ifg:ifg),1,key)
428  CALL rflu_hashvertex(global,key,pgrid%f2v(4,ifg),vlistdim,vlist, &
429  errorflag)
430 
431  IF ( errorflag /= err_none ) THEN
432  EXIT iloop
433  END IF ! errorFlag
434  END IF ! pGrid%f2v
435  END DO iloop
436 
437 ! ******************************************************************************
438 ! Destroy hash table
439 ! ******************************************************************************
440 
441  CALL rflu_destroyhashtable(global)
442 
443 ! ******************************************************************************
444 ! Sort list of vertices
445 ! ******************************************************************************
446 
447  IF ( errorflag == err_none ) THEN
448  CALL quicksortinteger(vlist(1:vlistdim),vlistdim)
449  END IF ! errorFlag
450 
451 ! ******************************************************************************
452 ! End
453 ! ******************************************************************************
454 
455  CALL deregisterfunction(global)
456 
457  END SUBROUTINE rflu_buildfacevertlist
458 
459 
460 
461 
462 
463 
464 
465 
466 
467 ! ******************************************************************************
468 !
469 ! Purpose: Build list of cell neighbors given list of vertices.
470 !
471 ! Description: None.
472 !
473 ! Input:
474 ! global Pointer to global data
475 ! pGrid Pointer to grid
476 ! vListOrig List of vertices
477 ! vListOrigDim Number of vertices in list
478 ! nLayers Number of cell layers to be added
479 ! iReg Target region (see notes)
480 ! cList List of cells (empty)
481 ! cListDimMax Dimension of list of cells
482 !
483 ! Output:
484 ! cList List of cells
485 ! cListDim Actual number of cells in list
486 !
487 ! Notes:
488 ! 1. Cells are added in a different way depending on the value of iReg:
489 ! - If iReg = 0 add cell in any case.
490 ! - If iReg > 0 add cell only if region index of cell after partitioning
491 ! is EQUAL to iReg.
492 ! - If iReg < 0 add cell only if region index of cell after partitioning
493 ! is NOT EQUAL to iReg.
494 ! 2. Routine must work even if sc2r mapping not existent, so have special
495 ! treatment for this case, which can arise if this routine is called
496 ! in connection with building sype virtual cells.
497 !
498 ! ******************************************************************************
499 
500  SUBROUTINE rflu_buildvertcellnghblist(global,pGrid,vListOrig,vListOrigDim, &
501  nlayers,ireg,clist,clistdimmax,clistdim)
502 
503  IMPLICIT NONE
504 
505 ! ******************************************************************************
506 ! Declarations and definitions
507 ! ******************************************************************************
508 
509 ! ==============================================================================
510 ! Arguments
511 ! ==============================================================================
512 
513  INTEGER, INTENT(IN) :: clistdimmax,ireg,nlayers,vlistorigdim
514  INTEGER, INTENT(OUT) :: clistdim
515  INTEGER, INTENT(IN) :: vlistorig(vlistorigdim)
516  INTEGER, INTENT(OUT) :: clist(clistdimmax)
517  TYPE(t_grid), POINTER :: pgrid
518  TYPE(t_global), POINTER :: global
519 
520 ! ==============================================================================
521 ! Locals
522 ! ==============================================================================
523 
524  LOGICAL :: check1,check2,check3
525  INTEGER :: clistdimnew,clisttempdim,clisttempdimmax,errorflag,icg,icl, &
526  ilayer,iloc,ivg,ivl,iv2c,vlistdim,vlisttempdim,vlisttempdim2, &
527  vlisttempdimmax
528  INTEGER, DIMENSION(:), ALLOCATABLE :: clisttemp,vlist,vlisttemp
529 
530 ! ******************************************************************************
531 ! Start
532 ! ******************************************************************************
533 
534  CALL registerfunction(global,'RFLU_BuildVertCellNghbList',&
535  'RFLU_ModTopologyUtils.F90')
536 
537 ! ******************************************************************************
538 ! Allocate temporary memory
539 ! ******************************************************************************
540 
541  clisttempdimmax = clistdimmax/nlayers
542 
543  ALLOCATE(clisttemp(clisttempdimmax),stat=errorflag)
544  global%error = errorflag
545  IF ( global%error /= err_none ) THEN
546  CALL errorstop(global,err_allocate,__line__,'cListTemp')
547  END IF ! global%error
548 
549  vlistdim = vlistorigdim
550 
551  ALLOCATE(vlist(vlistdim),stat=errorflag)
552  global%error = errorflag
553  IF ( global%error /= err_none ) THEN
554  CALL errorstop(global,err_allocate,__line__,'vList')
555  END IF ! global%error
556 
557 ! ******************************************************************************
558 ! Initialize
559 ! ******************************************************************************
560 
561  clistdim = 0
562 
563  DO icl = 1,clistdimmax
564  clist(icl) = 0
565  END DO ! icl
566 
567  DO ivl = 1,vlistdim
568  vlist(ivl) = vlistorig(ivl)
569  END DO ! ivl
570 
571 ! ******************************************************************************
572 ! Loop over layers of cells to be added
573 ! ******************************************************************************
574 
575  DO ilayer = 1,nlayers
576 
577 ! ==============================================================================
578 ! Initialize temporary cell list
579 ! ==============================================================================
580 
581  clisttempdim = 0
582 
583  DO icl = 1,clisttempdimmax
584  clisttemp(icl) = 0
585  END DO ! icl
586 
587 ! ==============================================================================
588 ! Loop through vertex list and build list of new cells
589 ! ==============================================================================
590 
591  DO ivl = 1,vlistdim
592  ivg = vlist(ivl)
593 
594 ! ------------------------------------------------------------------------------
595 ! For given vertex, loop through adjacent cells
596 ! ------------------------------------------------------------------------------
597 
598  DO iv2c = pgrid%v2cInfo(v2c_beg,ivg),pgrid%v2cInfo(v2c_end,ivg)
599  icg = pgrid%v2c(iv2c)
600 
601  IF ( ireg == 0 ) THEN
602  check1 = .true.
603  ELSE
604  check1 = .false.
605  END IF ! iReg
606 
607  IF ( ASSOCIATED(pgrid%sc2r) .EQV. .true. ) THEN
608  IF ( (ireg > 0) .AND. (pgrid%sc2r(icg) == ireg) ) THEN
609  check2 = .true.
610  ELSE
611  check2 = .false.
612  END IF ! iReg
613 
614  IF ( (ireg < 0) .AND. (pgrid%sc2r(icg) /= abs(ireg)) ) THEN
615  check3 = .true.
616  ELSE
617  check3 = .false.
618  END IF ! iReg
619  ELSE
620  check2 = .false.
621  check3 = .false.
622  END IF ! ASSOCIATED(pGrid%sc2r)
623 
624 ! ------- Check whether cell is in target region -------------------------------
625 
626  IF ( (check1 .EQV. .true.) .OR. &
627  (check2 .EQV. .true.) .OR. &
628  (check3 .EQV. .true.) ) THEN
629 
630 ! --------- Add cell to temporary cell list if not already in lists
631 
632  IF ( clistdim > 0 ) THEN
633  CALL binarysearchinteger(clist(1:clistdim),clistdim,icg,iloc)
634  ELSE
635  iloc = element_not_found
636  END IF ! cListDim
637 
638  IF ( iloc == element_not_found ) THEN
639  IF ( clisttempdim > 0 ) THEN
640  CALL binarysearchinteger(clisttemp(1:clisttempdim), &
641  clisttempdim,icg,iloc)
642  ELSE
643  iloc = element_not_found
644  END IF ! cListTempDim
645 
646  IF ( iloc == element_not_found ) THEN
647  IF ( clisttempdim < clisttempdimmax ) THEN
648  clisttempdim = clisttempdim + 1
649 
650  clisttemp(clisttempdim) = icg
651 
652  IF ( clisttempdim > 1 ) THEN
653  CALL quicksortinteger(clisttemp(1:clisttempdim), &
654  clisttempdim)
655  END IF ! cListTempDim
656  ELSE
657  CALL errorstop(global,err_exceed_dimens,__line__,'cListTemp')
658  END IF ! cListTempDim
659  END IF ! iLoc
660  END IF ! iLoc
661 
662  END IF ! iReg
663  END DO ! iv2c
664  END DO ! ivl
665 
666 ! ==============================================================================
667 ! Merge cell lists
668 ! ==============================================================================
669 
670  IF ( clistdim + clisttempdim <= clistdimmax ) THEN
671  DO icl = clistdim+1,clistdim+clisttempdim
672  clist(icl) = clisttemp(icl-clistdim)
673  END DO ! icl
674 
675  clistdim = clistdim + clisttempdim
676 
677  IF ( clistdim /= clisttempdim ) THEN ! Added cells, so need to sort
678  CALL quicksortinteger(clist(1:clistdim),clistdim)
679  END IF ! cListDim
680  ELSE
681  CALL errorstop(global,err_exceed_dimens,__line__,'cList')
682  END IF ! cListDim
683 
684 ! ==============================================================================
685 ! Build new list of vertices from which cells can be added
686 ! ==============================================================================
687 
688  IF( ilayer < nlayers ) THEN
689 
690 ! ------------------------------------------------------------------------------
691 ! Allocate temporary memory
692 ! ------------------------------------------------------------------------------
693 
694  vlisttempdimmax = 8*clisttempdim ! TEMPORARY
695 
696  ALLOCATE(vlisttemp(vlisttempdimmax),stat=errorflag)
697  global%error = errorflag
698  IF ( global%error /= err_none ) THEN
699  CALL errorstop(global,err_allocate,__line__,'vListTemp')
700  END IF ! global%error
701 
702 ! ------------------------------------------------------------------------------
703 ! Build list of vertices from last layer of cells
704 ! ------------------------------------------------------------------------------
705 
706  CALL rflu_buildcellvertlist(global,pgrid,clisttemp(1:clisttempdim), &
707  clisttempdim,vlisttemp,vlisttempdimmax, &
708  vlisttempdim)
709 
710 ! ------------------------------------------------------------------------------
711 ! Remove vertices which are shared with current list of vertices
712 ! ------------------------------------------------------------------------------
713 
714  CALL removecommonsortedintegers(vlist,vlistdim, &
715  vlisttemp(1:vlisttempdim), &
716  vlisttempdim,vlisttempdim2)
717 
718 ! ------------------------------------------------------------------------------
719 ! Build new list of vertices
720 ! ------------------------------------------------------------------------------
721 
722  DEALLOCATE(vlist,stat=errorflag)
723  global%error = errorflag
724  IF ( global%error /= err_none ) THEN
725  CALL errorstop(global,err_deallocate,__line__,'vList')
726  END IF ! global%error
727 
728  vlistdim = vlisttempdim2
729 
730  ALLOCATE(vlist(vlistdim),stat=errorflag)
731  global%error = errorflag
732  IF ( global%error /= err_none ) THEN
733  CALL errorstop(global,err_allocate,__line__,'vList')
734  END IF ! global%error
735 
736  DO ivl = 1,vlistdim
737  vlist(ivl) = vlisttemp(ivl)
738  END DO ! ivl
739 
740 ! ------------------------------------------------------------------------------
741 ! Deallocate temporary memory
742 ! ------------------------------------------------------------------------------
743 
744  DEALLOCATE(vlisttemp,stat=errorflag)
745  global%error = errorflag
746  IF ( global%error /= err_none ) THEN
747  CALL errorstop(global,err_deallocate,__line__,'vListTemp')
748  END IF ! global%error
749  END IF ! iLayer
750  END DO ! iLayer
751 
752 ! ******************************************************************************
753 ! Deallocate temporary memory
754 ! ******************************************************************************
755 
756  DEALLOCATE(vlist,stat=errorflag)
757  global%error = errorflag
758  IF ( global%error /= err_none ) THEN
759  CALL errorstop(global,err_deallocate,__line__,'vList')
760  END IF ! global%error
761 
762  DEALLOCATE(clisttemp,stat=errorflag)
763  global%error = errorflag
764  IF ( global%error /= err_none ) THEN
765  CALL errorstop(global,err_deallocate,__line__,'cListTemp')
766  END IF ! global%error
767 
768 ! ******************************************************************************
769 ! End
770 ! ******************************************************************************
771 
772  CALL deregisterfunction(global)
773 
774  END SUBROUTINE rflu_buildvertcellnghblist
775 
776 
777 
778 
779 
780 ! ******************************************************************************
781 ! End
782 ! ******************************************************************************
783 
784 END MODULE rflu_modtopologyutils
785 
786 
787 ! ******************************************************************************
788 !
789 ! RCS Revision history:
790 !
791 ! $Log: RFLU_ModTopologyUtils.F90,v $
792 ! Revision 1.9 2008/12/06 08:44:24 mtcampbe
793 ! Updated license.
794 !
795 ! Revision 1.8 2008/11/19 22:17:35 mtcampbe
796 ! Added Illinois Open Source License/Copyright
797 !
798 ! Revision 1.7 2006/04/07 15:19:20 haselbac
799 ! Removed tabs
800 !
801 ! Revision 1.6 2006/03/25 21:59:46 haselbac
802 ! Modified building of vert cell nghb list bcos of sype changes
803 !
804 ! Revision 1.5 2005/10/05 20:09:32 haselbac
805 ! Added fn for building vert list from conn table
806 !
807 ! Revision 1.4 2005/06/15 20:49:23 haselbac
808 ! Bug fix: Duplicate declaration of errorFlag in RFLU_BuildFaceVertList
809 !
810 ! Revision 1.3 2005/06/14 17:47:24 haselbac
811 ! Adapted RFLU_BuildFaceVertList for adaptive memory allocation
812 !
813 ! Revision 1.2 2005/01/17 19:55:20 haselbac
814 ! Added routine to build list of vertices from list of faces, cosmetics
815 !
816 ! Revision 1.1 2004/12/29 20:58:17 haselbac
817 ! Initial revision
818 !
819 ! ******************************************************************************
820 
821 
822 
823 
824 
825 
826 
827 
828 
829 
830 
subroutine, public rflu_buildconnvertlist(global, connList, connListDim1, connListDim2, vList, vListDimMax, vListDim)
subroutine, public rflu_createhashtable(global, size)
subroutine, public rflu_buildfacevertlist(global, pGrid, fList, fListDim, vList, vListDimMax, vListDim, errorFlag)
subroutine, public rflu_destroyhashtable(global)
subroutine, public rflu_buildcellvertlist(global, pGrid, cList, cListDim, vList, vListDimMax, vListDim)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine, public rflu_hashbuildkey(a, aSize, key)
subroutine quicksortinteger(a, n)
subroutine binarysearchinteger(a, n, v, i, j)
blockLoc i
Definition: read.cpp:79
subroutine removecommonsortedintegers(a, na, b, nb, nb2)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine, public rflu_buildvertcellnghblist(global, pGrid, vListOrig, vListOrigDim, nLayers, iReg, cList, cListDimMax, cListDim)
static T_Key key
Definition: vinci_lass.c:76
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine, public rflu_hashvertex(global, key, ivg, nVert, vert, errorFlag)