Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
rflupart.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: Driver routine for rflupart.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! caseString String with casename
31 ! verbLevel Verbosity level
32 !
33 ! Output: None.
34 !
35 ! Notes:
36 ! 1. There is no call to RFLU_AllocateMemoryWrapper and the corresponding
37 ! call to RFLU_DeallocateMemoryWrapper because the grid quantities are
38 ! determined in the grid conversion routines.
39 !
40 ! ******************************************************************************
41 !
42 ! $Id: rflupart.F90,v 1.22 2008/12/06 08:45:03 mtcampbe Exp $
43 !
44 ! Copyright: (c) 2005-2006 by the University of Illinois
45 !
46 ! ******************************************************************************
47 
48 SUBROUTINE rflupart(caseString,verbLevel)
49 
50  USE moderror
51  USE moddatatypes
52  USE modparameters
53  USE modglobal, ONLY: t_global
54  USE moddatastruct, ONLY: t_level,t_region
55  USE modmpi
56 
79 
80 #ifdef GENX
83 #endif
84 
85  USE modinterfaces, ONLY: rflu_builddatastruct, &
89  rflu_initglobal, &
102 
103  IMPLICIT NONE
104 
105 #ifdef GENX
106  include 'roccomf90.h'
107 #endif
108 
109 ! ******************************************************************************
110 ! Definitions and declarations
111 ! ******************************************************************************
112 
113 ! ==============================================================================
114 ! Arguments
115 ! ==============================================================================
116 
117  CHARACTER(*) :: casestring
118  INTEGER, INTENT(IN) :: verblevel
119 
120 ! ==============================================================================
121 ! Locals
122 ! ==============================================================================
123 
124  CHARACTER(CHRLEN) :: casename
125 #ifdef GENX
126  CHARACTER(CHRLEN) :: surfwinnameinput,volwinnameinput
127 #endif
128  INTEGER :: errorflag,ilev,ireg
129 #ifdef GENX
130  INTEGER :: handleobtain
131 #endif
132  TYPE(t_region), POINTER :: pregion,pregionserial
133  TYPE(t_global), POINTER :: global
134  TYPE(t_level), POINTER :: levels(:)
135 
136 ! TEMPORARY
137 ! INTEGER :: order
138 ! END TEMPORARY
139 
140 ! ******************************************************************************
141 ! Start, initialize global data
142 ! ******************************************************************************
143  ALLOCATE(global,stat=errorflag)
144  IF ( errorflag /= err_none ) THEN
145  WRITE(stderr,'(A,1X,A)') solver_name,'ERROR - Pointer allocation failed.'
146  stop
147  END IF ! errorFlag
148 
149  casename = casestring(1:len(casestring))
150 
151  CALL rflu_initglobal(casename,verblevel,mpi_comm_world,global)
152 
153 
154  CALL registerfunction(global,'rflupart', &
155  'rflupart.F90')
156 
157  CALL rflu_setmoduletype(global,module_type_part)
158 
159 #ifdef GENX
160 ! ******************************************************************************
161 ! Read GENX control file, store communicator and hardcode window name
162 ! ******************************************************************************
163 
164  CALL rflu_genx_readctrlfile(global)
165  CALL rflu_genx_storecommunicator(global,mpi_comm_world)
166  CALL rflu_genx_hardcodewindowname(global)
167 #endif
168 
169  ! MS TODO The verbosity level is not propagated to RFLU properly
170  !global%verbLevel = 3
171  !WRITE (*,*) 'global%verbLevel = ', global%verbLevel
172  ! MS end
173 ! ******************************************************************************
174 ! Print header and write version string
175 ! ******************************************************************************
176 
177  IF ( global%myProcid == masterproc ) THEN
178  CALL rflu_writeversionstring(global)
179  IF ( global%verbLevel /= verbose_none ) THEN
180  CALL rflu_printheader(global)
181  END IF ! global%verbLevel
182  END IF ! global%myProcid
183 
184 ! ******************************************************************************
185 ! Read mapping file, impose serial mapping, and build basic data structure
186 ! ******************************************************************************
187 
188  CALL rflu_readregionmappingfile(global,mapfile_readmode_peek,global%myProcId)
189  CALL rflu_setregionmappingserial(global)
190  CALL rflu_createregionmapping(global,maptype_reg)
191  CALL rflu_imposeregionmappingserial(global)
192 
193  CALL rflu_builddatastruct(global,levels)
194  CALL rflu_applyregionmapping(global,levels)
195  CALL rflu_destroyregionmapping(global,maptype_reg)
196 
197 #ifdef GENX
198 ! ******************************************************************************
199 ! Initialize Roccom and load Rocin and Rocout
200 ! ******************************************************************************
201 
202  CALL com_init
203 ! TEMPORARY
204 ! CALL COM_set_verbose(10)
205 ! END TEMPORARY
206 
207  surfwinnameinput = 'RocfluInputSurf'
208  volwinnameinput = 'RocfluInputVol TEMP'
209 
210  global%winNameIn = trim(global%winName)//'-IN'
211  global%winNameOut = trim(global%winName)//'-OUT'
212 
213  CALL rocin_load_module(trim(global%winNameIn))
214  CALL rocout_load_module(trim(global%winNameOut))
215 
216  handleobtain = com_get_function_handle(trim(global%winNameIn)// &
217  '.obtain_attribute')
218  CALL rflu_genx_storenameshandles(global,surfwinnameinput,volwinnameinput, &
219  handleobtain)
220 
221 ! ******************************************************************************
222 ! Create windows and attributes
223 ! ******************************************************************************
224 
225  pregionserial => levels(1)%regions(0)
226 
227  CALL rflu_genx_createwindows(pregionserial)
228  CALL rflu_genx_createattrgridsurf(pregionserial)
229  CALL rflu_genx_createattrgspeeds(pregionserial)
230 #endif
231 
232 ! ******************************************************************************
233 ! Initialize random number generator. NOTE needed in order to write sensible
234 ! data when writing Rocpart solution files.
235 ! ******************************************************************************
236 
237  CALL rflu_randominit(levels(1)%regions)
238 
239 ! ******************************************************************************
240 ! Read input file and restart info. NOTE need restart info for GENX runs to
241 ! determine whether have a restart.
242 ! ******************************************************************************
243 
244  CALL rflu_getuserinput(levels(1)%regions,.true.)
245  CALL rflu_readrestartinfo(global)
246  CALL rflu_setrestarttimeflag(global)
247 
248 ! ******************************************************************************
249 ! Read and convert grid
250 ! ******************************************************************************
251 
252  pregionserial => levels(1)%regions(0) ! NOTE must set otherwise get core dump
253 
254  CALL rflu_readconvgridwrapper(pregionserial)
255 
256 ! ******************************************************************************
257 ! Read boundary condition file
258 ! ******************************************************************************
259 
260  IF ( pregionserial%grid%nPatches > 0 ) THEN
261  CALL rflu_readbcinputfilewrapper(pregionserial)
262  END IF ! pRegionSerial%grid%nPatches
263 
264 ! ******************************************************************************
265 ! Set maximum dimensions
266 ! ******************************************************************************
267 
268  CALL rflu_setmaxdimensions(pregionserial)
269 
270 ! ******************************************************************************
271 ! Impose patch coordinates, scale and rotate if desired
272 ! ******************************************************************************
273 
274  IF ( global%enforceFlag .EQV. .true. ) THEN
275  CALL rflu_user_enforcepatchcoords(pregionserial)
276  END IF ! global%enforceFlag
277 
278  IF ( global%transformFlag .EQV. .true. ) THEN
279  CALL scalerotatevector(global,pregionserial%grid%xyz)
280  END IF ! global%transformFlag
281 
282  IF ( global%verbLevel > verbose_none ) THEN
283  CALL rflu_printgridinfo(pregionserial)
284  END IF ! global%verbLevel
285 
286 ! ******************************************************************************
287 ! Build data structures
288 ! ******************************************************************************
289 
290  CALL rflu_createcellmapping(pregionserial)
291  CALL rflu_buildloc2globcellmapping(pregionserial)
292  CALL rflu_buildglob2loccellmapping(pregionserial)
293 
294  CALL rflu_createbvertexlists(pregionserial)
295  CALL rflu_buildbvertexlists(pregionserial)
296 
297  CALL rflu_createfacelist(pregionserial)
298  CALL rflu_buildfacelist(pregionserial)
299  CALL rflu_renumberbfacelists(pregionserial)
300 
301 ! ******************************************************************************
302 ! Distort grid (NOTE needs to be done after having boundary vertex lists)
303 ! ******************************************************************************
304 
305  IF ( global%distortFlag .EQV. .true. ) THEN
306  CALL rflu_distortgrid(pregionserial)
307  END IF ! global%distortFlag
308 
309 ! ******************************************************************************
310 ! Add virtual cells on symmetry and periodic boundaries
311 ! ******************************************************************************
312 
313  IF ( rflu_sype_havesypepatches(pregionserial) .EQV. .true. ) THEN
314  CALL rflu_createpatchneighbormaps(pregionserial)
315  CALL rflu_buildpatchneighbormaps(pregionserial)
316 
317  CALL rflu_comm_countbordersserial(pregionserial)
318  CALL rflu_comm_createborders(pregionserial)
319 
320  CALL rflu_creategeometry(pregionserial)
321  CALL rflu_buildgeometry(pregionserial,.false.)
322 
323  CALL rflu_computepatchnormalslocal(pregionserial)
324  CALL rflu_checkpatchbcconsistency(pregionserial)
325  CALL rflu_sype_buildtransforms(pregionserial)
326  CALL rflu_sype_writetransforms(pregionserial)
327 
328  CALL rflu_sype_createvertexmaps(pregionserial)
329  CALL rflu_sype_buildvertexmaps(pregionserial)
330 
331  CALL rflu_createvert2celllist(pregionserial)
332  CALL rflu_buildvert2celllist(pregionserial)
333 
334  CALL rflu_sype_addvirtualcells(pregionserial)
335  CALL rflu_sype_buildp2vclistserial(pregionserial)
336 
337  CALL rflu_destroyvert2celllist(pregionserial)
338  CALL rflu_destroygeometry(pregionserial)
339 
340  CALL rflu_destroypatchneighbormaps(pregionserial)
341 
342  CALL rflu_printgridinfo(pregionserial)
343 
344  CALL rflu_comm_writecommlists(pregionserial)
345 
346  CALL rflu_destroybvertexlists(pregionserial)
347  CALL rflu_destroyfacelist(pregionserial)
348 
349  CALL rflu_createbvertexlists(pregionserial)
350  CALL rflu_buildbvertexlists(pregionserial)
351 
352  CALL rflu_createfacelist(pregionserial)
353  CALL rflu_buildfacelist(pregionserial)
354  CALL rflu_renumberbfacelists(pregionserial)
355  END IF ! RFLU_SYPE_HaveSyPePatches
356 
357 ! ******************************************************************************
358 ! Allocate memory
359 ! ******************************************************************************
360 
361  IF ( rflu_decideneedgridspeeds(pregionserial) .EQV. .true. ) THEN
362  CALL rflu_allocatememorygspeeds(pregionserial)
363  END IF ! RFLU_DecideNeedGridSpeeds
364 
365 ! ******************************************************************************
366 ! Write dimensions. Also write cell mapping for serial grid, which is needed by
367 ! post-processor if the regions are merged. Write grid if running in serial or
368 ! if running with particles. In the latter case, the serial grid is needed to
369 ! initialize the particle field.
370 ! ******************************************************************************
371 
372  CALL rflu_writedimensions(pregionserial)
373  CALL rflu_writeloc2globcellmapping(pregionserial)
374 
375  IF ( (global%nRegionsLocal == 1) .OR. (global%plagUsed .EQV. .true.) ) THEN
376 #ifdef GENX
377  CALL rflu_genx_creategridsurf(pregionserial)
378  CALL rflu_genx_registergrid(pregionserial)
379  CALL rflu_genx_buildgridsurf(pregionserial)
380 #endif
381  CALL rflu_writegridwrapper(pregionserial)
382 #ifdef GENX
383  CALL rflu_genx_destroygridsurf(pregionserial)
384 #endif
385  END IF ! global%nRegionsLocal
386 
387 ! ******************************************************************************
388 ! Build coloring for implicit solver, write for serial runs
389 ! ******************************************************************************
390 
391 ! TO DO
392 ! Need to integrate this better with partitioning so that there is no need to
393 ! build geometry twice. This probably means that need to have two calls to
394 ! build coloring, one for purely serial runs and another for parallel runs.
395 ! END TO DO
396 
397  IF ( global%solverType == solv_implicit_nk ) THEN
398  IF ( pregionserial%mixtInput%spaceOrder > 1 ) THEN
399  CALL rflu_createvert2celllist(pregionserial)
400  CALL rflu_buildvert2celllist(pregionserial)
401 
402  CALL rflu_creategeometry(pregionserial)
403  CALL rflu_buildgeometry(pregionserial)
404 
405  CALL rflu_setinfoc2cstencilwrapper(pregionserial, &
406  pregionserial%mixtInput%spaceOrder-1)
407  CALL rflu_createc2cstencilwrapper(pregionserial)
408  CALL rflu_buildc2cstencilwrapper(pregionserial,constrinput=constr_none)
409 
410  CALL rflu_destroygeometry(pregionserial)
411  CALL rflu_destroyvert2celllist(pregionserial)
412  END IF ! pRegionSerial%mixtInput%spaceOrder
413 
414  CALL rflu_createcell2facelist(pregionserial)
415  CALL rflu_buildcell2facelist(pregionserial)
416 
417  CALL rflu_col_createcoloring(pregionserial)
418  CALL rflu_col_buildcoloring(pregionserial)
419 
420  IF ( pregionserial%mixtInput%spaceOrder > 1 ) THEN
421  CALL rflu_destroyc2cstencilwrapper(pregionserial)
422  ELSE
423  CALL rflu_destroycell2facelist(pregionserial)
424  END IF ! pRegionSerial%mixtInput%spaceOrder
425 
426  IF ( global%nRegionsLocal == 1 ) THEN
427  CALL rflu_col_writecoloring(pregionserial)
428  END IF ! global%nRegionsLocal
429  END IF ! global%solverType
430 
431 ! ******************************************************************************
432 ! Partition
433 ! ******************************************************************************
434 
435  IF ( global%nRegionsLocal > 1 ) THEN
436 
437 ! ==============================================================================
438 ! Partition region and build lists
439 ! ==============================================================================
440 
441  CALL rflu_rnmb_createsc2rmap(pregionserial)
442  CALL rflu_part_partitionregion(pregionserial)
443  CALL rflu_rnmb_writesc2rmap(pregionserial)
444 
445  CALL rflu_part_createreg2cellmap(pregionserial)
446  CALL rflu_part_buildreg2cellmap(pregionserial)
447 
448  CALL rflu_part_buildborderfacelist(pregionserial)
449 
450  CALL rflu_createvert2celllist(pregionserial)
451  CALL rflu_buildvert2celllist(pregionserial)
452 
453  CALL rflu_createbcellmlist(pregionserial)
454  CALL rflu_buildbcellmlist(pregionserial)
455 
456  IF ( pregionserial%mixtInput%spaceOrder > 1 ) THEN
457  CALL rflu_creategeometry(pregionserial)
458  CALL rflu_buildgeometry(pregionserial)
459  END IF ! pRegionSerial
460 
461 ! ==============================================================================
462 ! Write out grid, solution, and renumbering lists for each region
463 ! ==============================================================================
464 
465  DO ireg = 1,global%nRegionsLocal
466  pregion => levels(1)%regions(ireg)
467 
468  CALL rflu_part_createcelllists(pregion,pregionserial)
469  CALL rflu_rnmb_createpc2scmap(pregion)
470 
471  CALL rflu_createcellmapping(pregion)
472  CALL rflu_buildloc2globcellmapping(pregion)
473  CALL rflu_buildglob2loccellmapping(pregion)
474 
475  CALL rflu_part_buildcelllists(pregion,pregionserial)
476  CALL rflu_part_addvirtualcells(pregion,pregionserial)
477  CALL rflu_rnmb_buildsc2pcmap(pregion)
478 
479  CALL rflu_part_buildvertexlists(pregion,pregionserial)
480  CALL rflu_rnmb_buildsv2pvmap(pregion)
481 
482  CALL rflu_rnmb_buildsbc2pcmap(pregion,pregionserial)
483  CALL rflu_part_createpatchlists(pregion,pregionserial)
484  CALL rflu_rnmb_createpbf2sbfmap(pregion)
485  CALL rflu_part_buildpatchlists(pregion,pregionserial)
486  CALL rflu_rnmb_destroysbc2pcmap(pregion)
487  CALL rflu_part_renumbervertexlists(pregion)
488 
489  CALL rflu_part_buildvertexdata(pregion,pregionserial)
490 
491  CALL rflu_setmaxdimensions(pregion)
492  CALL rflu_writedimensions(pregion)
493  CALL rflu_writeloc2globcellmapping(pregion)
494 
495 #ifdef GENX
496  CALL rflu_createbvertexlists(pregion)
497  CALL rflu_buildbvertexlists(pregion)
498 
499  CALL rflu_genx_creategridsurf(pregion)
500  CALL rflu_genx_registergridsurf(pregion)
501  CALL rflu_genx_registergridvol(pregion)
502  CALL rflu_genx_buildgridsurf(pregion)
503 #endif
504 
505  CALL rflu_writegridwrapper(pregion)
506 
507 #ifdef GENX
508  CALL rflu_genx_destroygridsurf(pregion)
509  CALL rflu_destroybvertexlists(pregion)
510 #endif
511 
512  CALL rflu_rnmb_writepxx2sxxmaps(pregion)
513 
514  IF ( global%solverType == solv_implicit_nk ) THEN
515  CALL rflu_col_createcoloring(pregion)
516  CALL rflu_col_buildcoloring(pregion,pregionserial)
517  CALL rflu_col_writecoloring(pregion)
518  CALL rflu_col_destroycoloring(pregion)
519  END IF ! global%solverType
520 
521  CALL rflu_destroycellmapping(pregion)
522 
523  CALL rflu_part_destroyvertexdata(pregion)
524 
525  CALL rflu_rnmb_destroypc2scmap(pregion)
526  CALL rflu_rnmb_destroypbf2sbfmap(pregion)
527  CALL rflu_rnmb_destroypv2svmap(pregion)
528 
529  CALL rflu_rnmb_destroysc2pcmap(pregion)
530  CALL rflu_rnmb_destroysv2pvmap(pregion)
531 
532  CALL rflu_part_destroypatchlists(pregion)
533  CALL rflu_part_destroycelllists(pregion)
534  END DO ! iReg
535 
536  CALL rflu_destroybcellmlist(pregionserial)
537  CALL rflu_destroyvert2celllist(pregionserial)
538  CALL rflu_part_buildborderfacelist(pregionserial)
539 
540  IF ( pregionserial%mixtInput%spaceOrder > 1 ) THEN
541  CALL rflu_destroygeometry(pregionserial)
542  END IF ! pRegionSerial
543 
544 ! ==============================================================================
545 ! Build communication lists
546 ! ==============================================================================
547 
548 ! ------------------------------------------------------------------------------
549 ! Read dimensions and renumbering lists. NOTE need to read bc file because of
550 ! sype cases, in which mapping from patches to virtual cells is constructed
551 ! below.
552 ! ------------------------------------------------------------------------------
553 
554  DO ireg = 1,global%nRegionsLocal
555  pregion => levels(1)%regions(ireg)
556 
557  CALL rflu_readdimensions(pregion)
558 ! TEMPORARY - THIS IS A BUG - MUST NOT BE CALLED BEFORE CREATEGRID BCOS
559 ! PATCHES NOT YET CREATED - MAX DIMS READ FROM FILE ANYWAY
560 ! CALL RFLU_SetMaxDimensions(pRegion)
561 ! END TEMPORARY
562 
563  CALL rflu_creategrid(pregion)
564 
565  IF ( pregion%grid%nPatches > 0 ) THEN
566  CALL rflu_readbcinputfilewrapper(pregion)
567  END IF ! pRegion%grid%nPatches
568 
569 #ifdef GENX
570  CALL rflu_genx_readwindow(pregion,genx_window_type_surf)
571  CALL rflu_genx_readwindow(pregion,genx_window_type_vol)
572  CALL rflu_genx_getdimensionsderived(pregion)
573  CALL rflu_genx_creategridsurf(pregion)
574  CALL rflu_genx_registergridsurf(pregion)
575  CALL rflu_genx_registergridvol(pregion)
576 #endif
577 
578  CALL rflu_readgridwrapper(pregion)
579 
580  CALL rflu_createcellmapping(pregion)
581  CALL rflu_readloc2globcellmapping(pregion)
582  CALL rflu_buildglob2loccellmapping(pregion)
583 
584  CALL rflu_rnmb_createpc2scmap(pregion)
585  CALL rflu_rnmb_createpv2svmap(pregion)
586  CALL rflu_rnmb_createpbf2sbfmap(pregion)
587 
588  CALL rflu_rnmb_readpxx2sxxmaps(pregion)
589 
590  CALL rflu_rnmb_buildsc2pcmap(pregion)
591  CALL rflu_rnmb_buildsv2pvmap(pregion)
592 
593 ! TO DO DELETE WINDOW
594 !
595 ! END TO DO DELETE WINDOW
596  END DO ! iReg
597 
598 ! ------------------------------------------------------------------------------
599 ! Count number of borders, create borders, and build communication lists
600 ! ------------------------------------------------------------------------------
601 
602  DO ireg = 1,global%nRegionsLocal
603  pregion => levels(1)%regions(ireg)
604 
605  CALL rflu_comm_createbordercntr(pregion)
606  CALL rflu_comm_countborders(pregion,pregionserial)
607  END DO ! iReg
608 
609  CALL rflu_comm_checkcountborders(levels(1)%regions)
610 
611  DO ireg = 1,global%nRegionsLocal
612  pregion => levels(1)%regions(ireg)
613 
614  CALL rflu_comm_createborders(pregion,create_borders_mode_dim_unknown)
615  END DO ! iReg
616 
617  CALL rflu_comm_buildcommlists(levels(1)%regions)
618 
619  DO ireg = 1,global%nRegionsLocal
620  pregion => levels(1)%regions(ireg)
621 
622  CALL rflu_comm_destroybordercntr(pregion)
623  END DO ! iReg
624 
625 ! ------------------------------------------------------------------------------
626 ! Write communication lists, destroy renumbering and communication lists.
627 ! NOTE need to write dimensions again because now also have information about
628 ! number of borders.
629 ! ------------------------------------------------------------------------------
630 
631  DO ireg = 1,global%nRegionsLocal
632  pregion => levels(1)%regions(ireg)
633 
634  CALL rflu_writedimensionsborders(pregion)
635 
636  CALL rflu_comm_writecommlists(pregion)
637 
638  IF ( rflu_sype_havesypepatches(pregion) .EQV. .true. ) THEN
639  CALL rflu_sype_buildp2vclist(pregion,pregionserial)
640  CALL rflu_writedimensions(pregion)
641  CALL rflu_writegridwrapper(pregion)
642  CALL rflu_sype_destroyp2vclist(pregion)
643  END IF ! RFLU_SYPE_HaveSyPePatches
644 
645 #ifdef GENX
646  CALL rflu_createbvertexlists(pregion)
647  CALL rflu_buildbvertexlists(pregion)
648 
649  CALL rflu_genx_createpconn(pregion)
650  CALL rflu_genx_buildpconn(pregion)
651 
652  CALL rflu_genx_registergridsurf(pregion)
653  CALL rflu_genx_registergridvol(pregion)
654 
655  CALL rflu_writegridwrapper(pregion)
656 #endif
657 
658  CALL rflu_destroycellmapping(pregion)
659 
660  CALL rflu_rnmb_destroypc2scmap(pregion)
661  CALL rflu_rnmb_destroypv2svmap(pregion)
662  CALL rflu_rnmb_destroypbf2sbfmap(pregion)
663 
664  CALL rflu_rnmb_destroysc2pcmap(pregion)
665  CALL rflu_rnmb_destroysv2pvmap(pregion)
666 
667 #ifdef GENX
668  CALL rflu_genx_destroypconn(pregion)
669  CALL rflu_genx_destroygridsurf(pregion)
670 
671  CALL rflu_destroybvertexlists(pregion)
672 #endif
673  CALL rflu_destroygrid(pregion)
674  END DO ! iReg
675 
676 ! ==============================================================================
677 ! Destroy partition mapping
678 ! ==============================================================================
679 
680  CALL rflu_rnmb_destroysc2rmap(pregionserial)
681  END IF ! global%nRegionsLocal
682 
683 ! ******************************************************************************
684 ! Write restart info file
685 ! ******************************************************************************
686 
687  CALL rflu_writerestartinfo(global)
688 
689 ! ******************************************************************************
690 ! Deallocate memory
691 ! ******************************************************************************
692 
693  IF ( rflu_sype_havesypepatches(pregionserial) .EQV. .true. ) THEN
694  CALL rflu_sype_destroyp2vclist(pregionserial)
695  END IF ! RFLU_SYPE_HaveSyPePatches
696 
697  IF ( rflu_decideneedgridspeeds(pregionserial) .EQV. .true. ) THEN
698  CALL rflu_deallocatememorygspeeds(pregionserial)
699  END IF ! RFLU_DecideNeedGridSpeeds
700 
701  IF ( global%solverType == solv_implicit_nk ) THEN
702  CALL rflu_col_destroycoloring(pregionserial)
703  END IF ! global%solverType
704 
705  CALL rflu_destroyfacelist(pregionserial)
706  CALL rflu_destroybvertexlists(pregionserial)
707  CALL rflu_destroycellmapping(pregionserial)
708 
709 ! ******************************************************************************
710 ! Print info about warnings
711 ! ******************************************************************************
712 
713  CALL rflu_printwarninfo(global)
714 
715 ! ******************************************************************************
716 ! End
717 ! ******************************************************************************
718 
719  CALL deregisterfunction(global)
720 
721  WRITE (*,*) "rflumap finished sucessfully"
722 END SUBROUTINE rflupart
723 
724 ! ******************************************************************************
725 !
726 ! RCS Revision history:
727 !
728 ! $Log: rflupart.F90,v $
729 ! Revision 1.22 2008/12/06 08:45:03 mtcampbe
730 ! Updated license.
731 !
732 ! Revision 1.21 2008/11/19 22:18:14 mtcampbe
733 ! Added Illinois Open Source License/Copyright
734 !
735 ! Revision 1.20 2006/08/18 14:05:26 haselbac
736 ! Added call to write transforms
737 !
738 ! Revision 1.19 2006/08/04 03:06:52 haselbac
739 ! Added grid distortion capability
740 !
741 ! Revision 1.18 2006/04/17 19:57:50 haselbac
742 ! Bug fix: Must read bc file before building patch-to-virtual cell mapping
743 !
744 ! Revision 1.17 2006/04/15 17:02:12 haselbac
745 ! Bug fix: bc file must be read before face list construction
746 !
747 ! Revision 1.16 2006/03/25 22:06:23 haselbac
748 ! Added capability of dealing with sype patches
749 !
750 ! Revision 1.15 2006/02/06 23:55:55 haselbac
751 ! Added comm argument to RFLU_InitGlobal
752 !
753 ! Revision 1.14 2006/01/06 22:17:38 haselbac
754 ! Adapted to name changes
755 !
756 ! Revision 1.13 2005/10/27 19:21:39 haselbac
757 ! Adapted to changes in stencil routine names
758 !
759 ! Revision 1.12 2005/10/05 14:25:51 haselbac
760 ! Adapted to changes in stencil modules, added use of vertex list module
761 !
762 ! Revision 1.11 2005/09/22 17:13:59 hdewey2
763 ! Moved stencil building calls for the implicit solver so the Jacobian can always be colored based on the 1st order stencils.
764 !
765 ! Revision 1.10 2005/09/19 18:41:24 haselbac
766 ! Bug fix for asymmetric borders: Now check and correct
767 !
768 ! Revision 1.9 2005/08/24 01:39:28 haselbac
769 ! Added capability to build coloring for second-order runs
770 !
771 ! Revision 1.8 2005/08/19 16:37:53 haselbac
772 ! Bug fix: Added calls to build cell-to-face list before coloring
773 !
774 ! Revision 1.7 2005/08/19 02:36:54 haselbac
775 ! Added calls to coloring routines
776 !
777 ! Revision 1.6 2005/07/01 16:19:47 haselbac
778 ! Set max dims bfor writing to reduce mem in rfluinit and rflump
779 !
780 ! Revision 1.5 2005/05/09 17:44:25 haselbac
781 ! Bug fix: Call RFLU_ReadDimensions, not wrapper
782 !
783 ! Revision 1.4 2005/05/05 18:38:39 haselbac
784 ! Removed MPI calls after bug in Rocin/out fixed
785 !
786 ! Revision 1.3 2005/05/04 03:36:46 haselbac
787 ! Added init and finalize of MPI when running within GENX
788 !
789 ! Revision 1.2 2005/05/03 03:11:31 haselbac
790 ! Converted to C++ reading of command-line
791 !
792 ! Revision 1.1 2005/04/15 15:09:15 haselbac
793 ! Initial revision
794 !
795 ! ******************************************************************************
796 
797 
798 
799 
800 
801 
802 
subroutine, public rflu_buildcell2facelist(pRegion)
subroutine, public rflu_rnmb_destroysv2pvmap(pRegion)
subroutine, public rflu_destroycell2facelist(pRegion)
subroutine rflu_creategrid(pRegion)
subroutine, public rflu_sype_buildtransforms(pRegion)
subroutine, public rflu_buildbvertexlists(pRegion)
subroutine, public rflu_rnmb_readpxx2sxxmaps(pRegion)
subroutine, public rflu_comm_countbordersserial(pRegion)
subroutine, public rflu_genx_creategridsurf(pRegion)
subroutine, public rflu_createc2cstencilwrapper(pRegion)
subroutine, public rflu_genx_destroygridsurf(pRegion)
subroutine, public rflu_genx_hardcodewindowname(global)
subroutine rflu_destroygrid(pRegion)
subroutine rflu_printwarninfo(global)
subroutine, public rflu_checkpatchbcconsistency(pRegion)
subroutine, public rflu_deallocatememorygspeeds(pRegion)
subroutine, public rflu_destroyregionmapping(global, mapType)
subroutine, public rflu_genx_registergridsurf(pRegion)
subroutine, public rflu_genx_createattrgridsurf(pRegion)
subroutine, public rflu_part_buildvertexlists(pRegion, pRegionSerial)
subroutine, public rflu_destroyfacelist(pRegion)
subroutine, public rflu_rnmb_destroypbf2sbfmap(pRegion)
subroutine, public rflu_sype_buildvertexmaps(pRegion)
subroutine, public rflu_createcell2facelist(pRegion)
subroutine, public rflu_rnmb_buildsv2pvmap(pRegion)
subroutine, public rflu_part_buildcelllists(pRegion, pRegionSerial)
subroutine, public rflu_part_destroypatchlists(pRegion)
subroutine rflu_readconvgridwrapper(pRegion)
subroutine, public rflu_destroygeometry(pRegion)
subroutine, public rflu_genx_buildpconn(pRegion)
subroutine rflu_getuserinput(regions, inPrep)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine, public rflu_writeloc2globcellmapping(pRegion)
subroutine, public rflu_part_buildpatchlists(pRegion, pRegionSerial)
subroutine, public rflu_comm_checkcountborders(regions)
subroutine, public rflu_genx_storenameshandles(global, surfWinNameInput, volWinNameInput, handleObtain)
subroutine, public rflu_col_createcoloring(pRegion)
subroutine, public rflu_comm_writecommlists(pRegion)
subroutine, public rflu_setmaxdimensions(pRegion)
subroutine, public rflu_comm_destroybordercntr(pRegion)
subroutine, public rflu_readgridwrapper(pRegion)
subroutine rflu_printheader(global)
subroutine rflu_setrestarttimeflag(global)
subroutine, public rflu_createvert2celllist(pRegion)
subroutine, public rflu_buildgeometry(pRegion, sypeFaceFlag)
subroutine, public rflu_readbcinputfilewrapper(pRegion)
subroutine, public rflu_rnmb_destroypc2scmap(pRegion)
subroutine rflupart(caseString, verbLevel)
Definition: rflupart.F90:48
subroutine, public rflu_sype_destroyp2vclist(pRegion)
LOGICAL function, public rflu_decideneedgridspeeds(pRegion)
subroutine, public rflu_part_renumbervertexlists(pRegion)
subroutine scalerotatevector(global, vect)
subroutine, public rflu_rnmb_buildsc2pcmap(pRegion, sortFlag)
subroutine, public rflu_setregionmappingserial(global)
subroutine, public rflu_comm_createborders(pRegion, createMode)
subroutine, public rflu_readloc2globcellmapping(pRegion)
subroutine, public rflu_destroybcellmlist(pRegion)
subroutine, public rflu_part_addvirtualcells(pRegion, pRegionSerial)
subroutine, public rflu_rnmb_destroysc2rmap(pRegion)
subroutine, public rflu_part_destroycelllists(pRegion)
subroutine, public rflu_genx_createwindows(pRegion, communicator)
subroutine, public rflu_createfacelist(pRegion)
subroutine, public rflu_rnmb_buildsbc2pcmap(pRegion, pRegionSerial)
subroutine, public rflu_createpatchneighbormaps(pRegion)
subroutine, public rflu_part_destroyvertexdata(pRegion)
subroutine, public rflu_buildglob2loccellmapping(pRegion)
subroutine, public rflu_part_partitionregion(pRegion)
subroutine, public rflu_comm_createbordercntr(pRegion, nBordersMaxOpt)
subroutine, public rflu_destroyc2cstencilwrapper(pRegion)
subroutine, public rflu_destroypatchneighbormaps(pRegion)
subroutine, public rflu_rnmb_destroysc2pcmap(pRegion)
subroutine, public rflu_genx_createattrgspeeds(pRegion)
subroutine, public rflu_genx_buildgridsurf(pRegion)
subroutine, public rflu_buildbcellmlist(pRegion)
subroutine, public rflu_buildfacelist(pRegion)
subroutine, public rflu_renumberbfacelists(pRegion)
subroutine, public rflu_genx_getdimensionsderived(pRegion)
subroutine, public rflu_sype_addvirtualcells(pRegion)
subroutine, public rflu_rnmb_destroypv2svmap(pRegion)
subroutine, public rflu_rnmb_writesc2rmap(pRegion)
subroutine, public rflu_genx_storecommunicator(global, communicator)
subroutine, public rflu_readregionmappingfile(global, readMode, myProcId)
subroutine, public rflu_destroycellmapping(pRegion)
subroutine, public rflu_col_destroycoloring(pRegion)
subroutine rflu_builddatastruct(global, levels)
subroutine, public rflu_rnmb_createsc2rmap(pRegion)
subroutine, public rflu_genx_registergrid(pRegion)
subroutine, public rflu_col_writecoloring(pRegion)
subroutine, public rflu_sype_buildp2vclist(pRegion, pRegionSerial)
subroutine, public rflu_sype_createvertexmaps(pRegion)
subroutine, public rflu_writegridwrapper(pRegion)
subroutine, public rflu_rnmb_createpc2scmap(pRegion)
subroutine, public rflu_destroyvert2celllist(pRegion)
subroutine, public rflu_destroybvertexlists(pRegion)
subroutine rflu_user_enforcepatchcoords(pRegion)
subroutine, public rflu_createbvertexlists(pRegion)
subroutine, public rflu_setinfoc2cstencilwrapper(pRegion, orderNominal)
subroutine, public rflu_genx_createpconn(pRegion)
subroutine, public rflu_part_createreg2cellmap(pRegion)
subroutine rflu_setmoduletype(global, moduleType)
subroutine, public rflu_buildc2cstencilwrapper(pRegion, icgInput, constrInput)
subroutine rflu_randominit(regions)
subroutine rflu_printgridinfo(pRegion)
subroutine, public rflu_readdimensions(pRegion)
subroutine, public rflu_distortgrid(pRegion)
subroutine, public rflu_genx_registergridvol(pRegion)
subroutine, public rflu_rnmb_createpv2svmap(pRegion)
subroutine, public rflu_genx_readctrlfile(global)
subroutine, public rflu_buildpatchneighbormaps(pRegion)
subroutine, public rflu_part_buildborderfacelist(pRegion)
subroutine, public rflu_part_buildvertexdata(pRegion, pRegionSerial)
subroutine, public rflu_writedimensions(pRegion)
subroutine, public rflu_genx_readwindow(pRegion, windowType)
subroutine, public rflu_computepatchnormalslocal(pRegion)
subroutine, public rflu_sype_writetransforms(pRegion)
subroutine, public rflu_writedimensionsborders(pRegion)
subroutine, public rflu_part_buildreg2cellmap(pRegion)
subroutine, public rflu_sype_buildp2vclistserial(pRegion)
subroutine, public rflu_createcellmapping(pRegion)
subroutine, public rflu_rnmb_destroysbc2pcmap(pRegion)
subroutine, public rflu_allocatememorygspeeds(pRegion)
subroutine, public rflu_rnmb_createpbf2sbfmap(pRegion)
subroutine, public rflu_part_createpatchlists(pRegion, pRegionSerial)
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine, public rflu_creategeometry(pRegion)
subroutine rflu_writeversionstring(global)
subroutine, public rflu_applyregionmapping(global, levels)
subroutine, public rflu_part_createcelllists(pRegion, pRegionSerial)
subroutine rflu_initglobal(casename, verbLevel, communicator, global)
subroutine rflu_writerestartinfo(global)
LOGICAL function, public rflu_sype_havesypepatches(pRegion)
subroutine, public rflu_comm_countborders(pRegion, pRegionSerial)
subroutine rflu_readrestartinfo(global)
subroutine, public rflu_imposeregionmappingserial(global)
subroutine, public rflu_buildvert2celllist(pRegion)
subroutine, public rflu_genx_destroypconn(pRegion)
subroutine, public rflu_comm_buildcommlists(regions)
subroutine, public rflu_rnmb_writepxx2sxxmaps(pRegion)
subroutine, public rflu_createregionmapping(global, mapType)
subroutine, public rflu_buildloc2globcellmapping(pRegion)
subroutine, public rflu_createbcellmlist(pRegion)