Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_InitFlowSolver.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: Main initialization routine of Rocflu-MP.
26 !
27 ! Description: None.
28 !
29 ! Input: None.
30 !
31 ! Output: None.
32 !
33 ! Notes: None.
34 !
35 ! ******************************************************************************
36 !
37 ! $Id: RFLU_InitFlowSolver.F90,v 1.123 2008/12/06 08:44:30 mtcampbe Exp $
38 ! Copyright: (c) 2001-2006 by the University of Illinois
39 !
40 ! ******************************************************************************
41 
42 #ifdef GENX
43 SUBROUTINE rflu_initflowsolver(globalGenx,initialTime,communicator,genxHandle, &
44  surfwinnameinput,volwinnameinput,handleobtain)
45 #else
46 SUBROUTINE rflu_initflowsolver(casename,verbLevel,global,levels)
47 #endif
48 
49  USE moddatatypes
50 #ifdef GENX
51  USE modrocstar, ONLY: t_globalgenx
52 #endif
53  USE modbndpatch, ONLY: t_patch
54  USE moddatastruct, ONLY: t_level,t_region
55  USE modmixture, ONLY: t_mixt_input
56  USE modglobal, ONLY: t_global
57  USE modgrid, ONLY: t_grid
58  USE modbndpatch, ONLY: t_patch
59  USE moderror
60  USE modmpi
61  USE modparameters
62 
71  USE rflu_modedgelist
78  USE rflu_modmpi
79  USE rflu_modoles
82  USE rflu_modprobes
97  USE rflu_modweights
98 
99 #ifdef GENX
104 #endif
105 
106 #ifdef PETSC
108 ! USE RFLU_ModPETScPoisson
110 #endif
111 
112 #ifdef PLAG
115 #endif
116 
118 
124  rflu_creategrid, &
127  rflu_initglobal, &
135  rflu_randominit, &
149 
150 #ifdef GENX
155 #endif
156 #ifdef STATS
158 #endif
159 
160  IMPLICIT NONE
161 
162 #ifdef GENX
163  include 'roccomf90.h'
164 #endif
165 
166 ! ******************************************************************************
167 ! Arguments
168 ! ******************************************************************************
169 
170 #ifdef GENX
171  CHARACTER(*), INTENT(IN) :: surfwinnameinput,volwinnameinput
172  INTEGER, INTENT(IN) :: communicator,genxhandle,handleobtain
173  DOUBLE PRECISION, INTENT(IN) :: initialtime
174  TYPE(t_globalgenx), POINTER :: globalgenx
175 #else
176  CHARACTER(CHRLEN), INTENT(IN) :: casename
177  INTEGER, INTENT(IN) :: verblevel
178  TYPE(t_global), POINTER :: global
179 #endif
180  TYPE(t_level), POINTER :: levels(:)
181 
182 ! ******************************************************************************
183 ! Locals
184 ! ******************************************************************************
185 
186  CHARACTER(CHRLEN) :: rcsidentstring,msg
187  LOGICAL :: fileexists,movegrid
188  INTEGER :: errorflag,ipatch,ireg
189  REAL(RFREAL) :: currenttime
190  TYPE(t_grid) :: grid
191  TYPE(t_grid), POINTER :: pgrid
192  TYPE(t_level), POINTER :: plevel
193  TYPE(t_mixt_input), POINTER :: pmixtinput
194  TYPE(t_patch), POINTER :: ppatch
195  TYPE(t_region), POINTER :: pregion
196 
197 #ifdef GENX
198  INTEGER :: verblevel
199  CHARACTER(CHRLEN) :: casename
200  TYPE(t_global), POINTER :: global
201 #endif
202 
203 ! ******************************************************************************
204 ! Start, initialize some variables
205 ! ******************************************************************************
206 
207  rcsidentstring = '$RCSfile: RFLU_InitFlowSolver.F90,v $ $Revision: 1.123 $'
208 
209  movegrid = .false.
210 
211 ! ******************************************************************************
212 ! Set global pointer and initialize global type, register function
213 ! ******************************************************************************
214 
215 #ifdef GENX
216  global => globalgenx%global
217 
218  CALL rflu_initglobal(" ",verbose_low,communicator,global)
219  CALL rflu_genx_readctrlfile(global)
221 
222 ! ******************************************************************************
223 ! Initialize MPI - ROCSTAR
224 ! ******************************************************************************
225 
226  CALL mpi_comm_size(global%mpiComm,global%nProcAlloc,errorflag)
227  global%error = errorflag
228  IF ( global%error /= err_none ) THEN
229  CALL errorstop(global,err_mpi_output,__line__)
230  END IF ! global%error
231 
232  CALL mpi_comm_rank(global%mpiComm,global%myProcid,errorflag)
233  global%error = errorflag
234  IF ( global%error /= err_none ) THEN
235  CALL errorstop(global,err_mpi_output,__line__)
236  END IF ! global%error
237 
238  CALL rflu_genx_storenameshandles(global,surfwinnameinput,volwinnameinput, &
239  handleobtain)
240 
241  CALL com_set_verbose(global%verbLevelCOM)
242 
243  global%timeStamp = initialtime
244  global%currentTime = initialtime
245 #else
246  CALL rflu_initglobal(casename,verblevel,mpi_comm_world,global)
247 
248 ! ******************************************************************************
249 ! Initialize MPI Native
250 ! ******************************************************************************
251 
252  CALL mpi_init(errorflag)
253  global%error = errorflag
254  IF ( global%error /= err_none ) THEN
255  CALL errorstop(global,err_mpi_output,__line__)
256  END IF ! global%error
257 
258  CALL mpi_comm_size(global%mpiComm,global%nProcAlloc,errorflag)
259  global%error = errorflag
260  IF ( global%error /= err_none ) THEN
261  CALL errorstop(global,err_mpi_output,__line__)
262  END IF ! global%error
263 
264  CALL mpi_comm_rank(global%mpiComm,global%myProcid,errorflag)
265  global%error = errorflag
266  IF ( global%error /= err_none ) THEN
267  CALL errorstop(global,err_mpi_output,__line__)
268  END IF ! global%error
269 
270 #endif
271 
272  CALL rflu_setmoduletype(global,module_type_solver)
273 
274  CALL registerfunction(global,'RFLU_InitFlowSolver',&
275  'RFLU_InitFlowSolver.F90')
276 
277 #ifndef GENX
278 #ifdef ROCPROF
279 ! ******************************************************************************
280 ! Initialize Rocprof. NOTE done here so everything can be profiled and also bcos
281 ! RFLU_SetVars is called here.
282 ! ******************************************************************************
283 
284  CALL rocprof_init("Rocflu",global%myProcid)
285 #endif
286 #endif
287 
288 ! ******************************************************************************
289 ! Print header and check for stop file
290 ! ******************************************************************************
291 
292  IF ( global%myProcid == masterproc ) THEN
293  CALL rflu_writeversionstring(global)
294 
295  IF ( global%verbLevel /= verbose_none ) THEN
296  CALL rflu_printheader(global)
297  END IF ! global%verbLevel
298  END IF ! global
299 
300  IF ( global%myProcid == masterproc ) THEN
301  INQUIRE(file="STOP",exist=fileexists)
302  IF ( fileexists .EQV. .true. ) THEN
303  CALL errorstop(global,err_stopfile_found,__line__)
304  END IF ! fileExists
305  END IF ! global%myProcid
306 
307 ! ******************************************************************************
308 ! Read processor mapping file, prepare data structure, set level pointer
309 ! ******************************************************************************
310 
311  CALL rflu_readregionmappingfile(global,mapfile_readmode_peek,global%myProcId)
312  CALL rflu_createregionmapping(global,maptype_reg)
313  CALL rflu_readregionmappingfile(global,mapfile_readmode_all,global%myProcId)
314 
315  IF ( global%nRegions == 1 ) THEN
316  CALL rflu_imposeregionmappingserial(global)
317  END IF ! global
318 
319  IF ( global%nProcs /= global%nProcAlloc ) THEN
320  CALL errorstop(global,err_proc_mismatch,__line__)
321  END IF ! global%nProcs
322 
323  CALL rflu_builddatastruct(global,levels)
324  CALL rflu_applyregionmapping(global,levels)
325  CALL rflu_destroyregionmapping(global,maptype_reg)
326 
327 #ifdef GENX
328  globalgenx%levels => levels
329  plevel => globalgenx%levels(1) ! single-level grids for now
330 #else
331  plevel => levels(1) ! single-level grids for now
332 #endif
333 
334 #ifdef GENX
335 ! ******************************************************************************
336 ! Create windows and new attributes. NOTE must only be done once for every
337 ! process.
338 ! ******************************************************************************
339 
340  pregion => plevel%regions(1)
342  CALL rflu_genx_createattrwrapper(pregion)
343 
344 ! ******************************************************************************
345 ! Load modules
346 ! ******************************************************************************
347 
348  CALL rocmop_load_module(trim(global%winName)//'-MOP')
349 #endif
350 
351 ! ******************************************************************************
352 ! Read user input
353 ! ******************************************************************************
354 
355  CALL rflu_getuserinput(plevel%regions)
356 
357 ! ******************************************************************************
358 ! Initialize random number generator
359 ! ******************************************************************************
360 
361  CALL rflu_randominit(plevel%regions)
362 
363 ! ******************************************************************************
364 ! Read restart info. NOTE must not read restart info file for GENx runs because
365 ! will overwrite global%currentTime.
366 ! ******************************************************************************
367 
368 #ifndef GENX
369  CALL rflu_readrestartinfo(global)
370 #endif
371  CALL rflu_setrestarttimeflag(global)
372 
373 ! ******************************************************************************
374 ! Read dimensions file
375 ! ******************************************************************************
376 
377  DO ireg = 1,global%nRegionsLocal
378  pregion => plevel%regions(ireg)
379  CALL rflu_readdimensionswrapper(pregion)
380  END DO ! iReg
381 
382 ! ******************************************************************************
383 ! Determine whether have moving grid
384 ! ******************************************************************************
385 
386  movegridloop: DO ireg = 1,global%nRegionsLocal
387  pregion => plevel%regions(ireg)
388 
389  IF ( pregion%mixtInput%movegrid .EQV. .true. ) THEN
390  movegrid = .true.
391  EXIT movegridloop
392  END IF ! pRegion
393  END DO movegridloop
394 
395 ! ******************************************************************************
396 ! Allocate memory for grid and borders
397 ! ******************************************************************************
398 
399  DO ireg = 1,global%nRegionsLocal
400  pregion => plevel%regions(ireg)
401 
402  CALL rflu_creategrid(pregion)
403  CALL rflu_comm_createborders(pregion,create_borders_mode_dim_known)
404  END DO ! iReg
405 
406 ! ******************************************************************************
407 ! Read boundary condition file, must be done after creation of grid, because
408 ! grid and patches are created there.
409 ! ******************************************************************************
410 
411  DO ireg = 1,global%nRegionsLocal
412  pregion => plevel%regions(ireg)
413 
414  IF ( pregion%grid%nPatches > 0 ) THEN
415  CALL rflu_readbcinputfilewrapper(pregion)
416  CALL rflu_allocatememorytbc(pregion)
417  CALL rflu_readtbcinputfile(pregion)
418  END IF ! pRegion%grid%nPatches
419  END DO ! iReg
420 
421 #ifdef GENX
422 ! ******************************************************************************
423 ! Create surface and and register volume and surface grid. NOTE must be done
424 ! after having read comm lists because of pconn.
425 ! ******************************************************************************
426 
427  DO ireg = 1,global%nRegionsLocal
428  pregion => plevel%regions(ireg)
429 
430  CALL rflu_genx_getdimensionsderived(pregion)
431  CALL rflu_genx_creategridsurf(pregion)
432  CALL rflu_genx_createpconn(pregion)
433  CALL rflu_genx_registergridvol(pregion)
434  CALL rflu_genx_registergridsurf(pregion)
435  END DO ! iReg
436 #endif
437 
438 ! ******************************************************************************
439 ! Read grid file
440 ! ******************************************************************************
441 
442  DO ireg = 1,global%nRegionsLocal
443  pregion => plevel%regions(ireg)
444  CALL rflu_readgridwrapper(pregion)
445  END DO ! iReg
446 
447 ! ******************************************************************************
448 ! Print grid information
449 ! ******************************************************************************
450 
451  IF ( global%myProcid == masterproc .AND. &
452  global%verbLevel > verbose_none ) THEN
453  DO ireg = 1,global%nRegionsLocal
454  pregion => plevel%regions(ireg)
455  CALL rflu_printgridinfo(pregion)
456  END DO ! iReg
457  END IF ! global%verbLevel
458 
459 !*******************************************************************************
460 ! Register Time Zooming Parameter
461 !*******************************************************************************
462 
463 #ifdef GENX
464  CALL rflu_genx_getglobaldata(global)
465 #endif
466 
467 ! ******************************************************************************
468 ! Build data stucture, part 1
469 ! ******************************************************************************
470 
471  DO ireg = 1,global%nRegionsLocal
472  pregion => plevel%regions(ireg)
473  CALL rflu_createcellmapping(pregion)
474  CALL rflu_readloc2globcellmapping(pregion)
475  CALL rflu_buildglob2loccellmapping(pregion)
476  END DO ! iReg
477 
478 ! ******************************************************************************
479 ! Create and read comm lists, set proc ids for borders. Must be done before
480 ! face list is constructed because reorientation of actual-virtual faces
481 ! requires knowledge of communication lists.
482 ! ******************************************************************************
483 
484  DO ireg = 1,global%nRegionsLocal
485  pregion => plevel%regions(ireg)
486  pgrid => pregion%grid
487 
488  IF ( pgrid%nBorders > 0 ) THEN
489  CALL rflu_comm_createcommlists(pregion)
490  CALL rflu_comm_readcommlists(pregion)
491  CALL rflu_comm_getproclocregids(pregion)
492  END IF ! pRegion%grid%nBorders
493  END DO ! iReg
494 
495 ! ******************************************************************************
496 ! Build data stucture, part 2. Building the face list must be done after the
497 ! communication lists have been updated to take into account renumbering of
498 ! cells. Build cell-to-face list anyway, although only needed when have probes
499 ! or when running with higher-order scheme.
500 ! ******************************************************************************
501 
502  DO ireg = 1,global%nRegionsLocal
503  pregion => plevel%regions(ireg)
504  CALL rflu_createbvertexlists(pregion)
505  CALL rflu_buildbvertexlists(pregion)
506  END DO ! iReg
507 
508  DO ireg = 1,global%nRegionsLocal
509  pregion => plevel%regions(ireg)
510  CALL rflu_createfacelist(pregion)
511  CALL rflu_buildfacelist(pregion)
512  CALL rflu_renumberbfacelists(pregion)
513 
514 ! TEMPORARY
515 ! IF ( pRegion%grid%nCellsTot > pRegion%grid%nCells ) THEN
516 ! CALL RFLU_RNMB_CreatePBF2SBFMap(pRegion)
517 ! CALL RFLU_RNMB_CreatePC2SCMap(pRegion)
518 ! CALL RFLU_RNMB_CreatePV2SVMap(pRegion)
519 ! CALL RFLU_RNMB_ReadPxx2SxxMaps(pRegion)
520 ! CALL RFLU_ReorientFaces(pRegion)
521 !! TEMPORARY
522 !! CALL RFLU_RNMB_DestroyPBF2SBFMap(pRegion)
523 !! CALL RFLU_RNMB_DestroyPC2SCMap(pRegion)
524 !! CALL RFLU_RNMB_DestroyPV2SVMap(pRegion)
525 !! END TEMPORARY
526 ! END IF ! pGrid%nCellsTot
527 ! END TEMPORARY
528  END DO ! iReg
529 
530  DO ireg = 1,global%nRegionsLocal
531  pregion => plevel%regions(ireg)
532  CALL rflu_createcell2facelist(pregion)
533  CALL rflu_buildcell2facelist(pregion)
534  END DO ! iReg
535 
536 #ifdef PLAG
537  DO ireg = 1,global%nRegionsLocal
538  pregion => plevel%regions(ireg)
539 
540  IF ( (pregion%global%plagUsed .EQV. .true.) .AND. &
541  (pregion%grid%nFacesAV > 0) ) THEN
542  CALL rflu_createavface2borderlist(pregion)
543  CALL rflu_buildavface2borderlist(pregion)
544 
545  CALL rflu_createavface2patchlist(pregion)
546  CALL rflu_buildavface2patchlist(pregion)
547  END IF ! pRegion%global%plagUsed
548  END DO ! iReg
549 #endif
550 
551 ! ******************************************************************************
552 ! Build data stucture, part 3
553 ! ******************************************************************************
554 
555  IF ( movegrid .EQV. .true. ) THEN
556  DO ireg = 1,global%nRegionsLocal
557  pregion => plevel%regions(ireg)
558  CALL rflu_createedgelist(pregion)
559  CALL rflu_buildedgelist(pregion)
560  CALL rflu_createedge2celllist(pregion)
561  CALL rflu_buildedge2celllist(pregion)
562  CALL rflu_destroyedge2celllist(pregion)
563  END DO ! iReg
564  END IF ! moveGrid
565 
566 ! ******************************************************************************
567 ! Check topology
568 ! ******************************************************************************
569 
570  DO ireg = 1,global%nRegionsLocal
571  pregion => plevel%regions(ireg)
572  CALL rflu_123d_checktopology(pregion)
573  END DO ! iReg
574 
575 ! ******************************************************************************
576 ! Build boundary-face gradient access list for viscous flows
577 ! ******************************************************************************
578 
579  DO ireg = 1,global%nRegionsLocal
580  pregion => plevel%regions(ireg)
581 
582  IF ( pregion%mixtInput%flowModel == flow_navst ) THEN
583  CALL rflu_createbfacegradaccesslist(pregion)
584  CALL rflu_buildbfacegradaccesslist(pregion)
585  END IF ! pRegion%mixtInput
586  END DO ! iReg
587 
588 ! ******************************************************************************
589 ! Allocate memory. NOTE must be done after having built face lists and after
590 ! reading boundary-condition file because of particle module.
591 ! ******************************************************************************
592 
593  DO ireg = 1,global%nRegionsLocal
594  pregion => plevel%regions(ireg)
595  CALL rflu_allocatememorywrapper(pregion)
596 
597  CALL rflu_createpatchcoeffs(pregion)
598 
599  IF ( global%forceFlag .EQV. .true. ) THEN
600  CALL rflu_createforcesmoments(pregion)
601  CALL rflu_createglobalthrustflags(pregion)
602  END IF ! global%forceFlag
603  END DO ! iReg
604 
605 ! ------------------------------------------------------------------------------
606 ! Set Global thrust flags from local thrust flags
607 ! ------------------------------------------------------------------------------
608 
609  CALL rflu_setglobalthrustflags(plevel%regions)
610 
611 ! ------------------------------------------------------------------------------
612 ! Allocate memory for boundary variables if required, i.e., if NSCBC==1
613 ! ------------------------------------------------------------------------------
614 
615  DO ireg = 1,global%nRegionsLocal
616  pregion => plevel%regions(ireg)
617  IF ( rflu_nscbc_decidehavenscbc(pregion) .EQV. .true. ) THEN
618  CALL rflu_bxv_createvarscv(pregion)
619  CALL rflu_bxv_createvarsdv(pregion)
620  CALL rflu_bxv_createvarststep(pregion)
621  END IF ! RFLU_NSCBC_DecideHaveNSCBC(pRegion)
622 
623 #ifdef PLAG
624  IF ( global%plagUsed .EQV. .true. ) THEN
625  CALL plag_createsurfstats(pregion)
626  END IF ! global%plagUsed
627 #endif
628  END DO ! iReg
629 
630 ! ******************************************************************************
631 ! Set variable info. NOTE must be done after allocation of memory for solution.
632 ! ******************************************************************************
633 
634  DO ireg = 1,global%nRegionsLocal
635  pregion => plevel%regions(ireg)
636  CALL rflu_setvarinfowrapper(pregion)
637  END DO ! iReg
638 
639 #ifdef STATS
640 ! ******************************************************************************
641 ! Statistics mapping (must be done before RFLU_GENX_RegisterData)
642 ! ******************************************************************************
643 
644  IF (global%flowType == flow_unsteady .AND. global%doStat==active) THEN
645  CALL statmapping( global )
646  ENDIF
647 #endif
648 
649 #ifdef GENX
650 ! ******************************************************************************
651 ! Register data with Roccom for interaction in GENX. NOTE must be done after
652 ! memory allocation.
653 ! ******************************************************************************
654 
655  DO ireg = 1,global%nRegionsLocal
656  pregion => plevel%regions(ireg)
657 
658  CALL rflu_genx_registerdatawrapper(pregion)
659  CALL rflu_genx_createwindowsdone(pregion)
660  END DO ! iReg
661 #endif
662 
663 ! ******************************************************************************
664 ! Compute geometry
665 ! ******************************************************************************
666 
667  DO ireg = 1,global%nRegionsLocal
668  pregion => plevel%regions(ireg)
669  CALL rflu_creategeometry(pregion)
670  CALL rflu_buildgeometry(pregion)
671  CALL rflu_123d_checkgeometrywrapper(pregion)
672  END DO ! iReg
673 
674  DO ireg = 1,global%nRegionsLocal
675  pregion => plevel%regions(ireg)
676  CALL rflu_computepatchnormalslocal(pregion)
677  END DO ! iReg
678 
679  CALL rflu_computepatchnormalsglobal(plevel%regions)
680 
681  DO ireg = 1,global%nRegionsLocal
682  pregion => plevel%regions(ireg)
683  CALL rflu_checkpatchbcconsistency(pregion)
684  END DO ! iReg
685 
686  DO ireg = 1,global%nRegionsLocal
687  pregion => plevel%regions(ireg)
688  pmixtinput => pregion%mixtInput
689 
690  IF ( pmixtinput%fluidModel == fluid_model_incomp ) THEN
691  CALL rflu_createfacedist(pregion)
692  CALL rflu_computefacedist(pregion)
693  END IF ! pMixtInput%fluidModel
694  END DO ! iReg
695 
696  DO ireg = 1,global%nRegionsLocal
697  pregion => plevel%regions(ireg)
698 
699  IF ( rflu_sype_havesypepatches(pregion) .EQV. .true. ) THEN
700  CALL rflu_sype_readtransforms(pregion)
701  END IF ! RFLU_SYPE_HaveSyPePatches
702  END DO ! iReg
703 
704 ! ******************************************************************************
705 ! Build stencils. NOTE This must be done after the geometry is computed
706 ! because the stencils are now tested for singularity, which requires the
707 ! computation of the weights and hence the geometry.
708 ! ******************************************************************************
709 
710  DO ireg = 1,global%nRegionsLocal
711  pregion => plevel%regions(ireg)
712  pmixtinput => pregion%mixtInput
713 
714  CALL rflu_createvert2celllist(pregion)
715  CALL rflu_buildvert2celllist(pregion)
716 
717  IF ( pmixtinput%spaceOrder > 1 ) THEN
718  CALL rflu_setinfoc2cstencilwrapper(pregion,pmixtinput%spaceOrder-1)
719  CALL rflu_createc2cstencilwrapper(pregion)
720  CALL rflu_buildc2cstencilwrapper(pregion)
721  CALL rflu_buildlistcc2cstencil(pregion)
722  END IF ! pMixtInput%spaceOrder
723 
724  IF ( pmixtinput%flowModel == flow_navst ) THEN
725  CALL rflu_setinfof2cstencilwrapper(pregion,pmixtinput%spaceOrder-1)
726  CALL rflu_createf2cstencilwrapper(pregion)
727  CALL rflu_buildf2cstencilwrapper(pregion)
728  CALL rflu_buildlistcf2cstencil(pregion)
729  END IF ! pMixtInput%flowModel
730 
731  DO ipatch = 1,pregion%grid%nPatches
732  ppatch => pregion%patches(ipatch)
733 
734  IF ( rflu_decideneedbgradface(pregion,ppatch) .EQV. .true. ) THEN
735  CALL rflu_setinfobf2cstencilwrapper(pregion,ppatch, &
736  ppatch%spaceOrder)
737  CALL rflu_createbf2cstencilwrapper(pregion,ppatch)
738  CALL rflu_buildbf2cstencilwrapper(pregion,ppatch)
739  END IF ! RFLU_DecideNeedBGradFace
740  END DO ! iPatch
741 
742  CALL rflu_destroyvert2celllist(pregion)
743  END DO ! iReg
744 
745 ! ******************************************************************************
746 ! Compute weights. NOTE must be done after stencils are built.
747 ! ******************************************************************************
748 
749 ! ==============================================================================
750 ! Weights for cell and face gradients
751 ! ==============================================================================
752 
753  DO ireg = 1,global%nRegionsLocal
754  pregion => plevel%regions(ireg)
755  pmixtinput => pregion%mixtInput
756 
757  IF ( pmixtinput%spaceOrder > 1 ) THEN
758  CALL rflu_createwtsc2cwrapper(pregion,pmixtinput%spaceOrder-1)
759  CALL rflu_computewtsc2cwrapper(pregion,pmixtinput%spaceOrder-1)
760  END IF ! pMixtInput%spaceOrder
761 
762  IF ( pmixtinput%flowModel == flow_navst ) THEN
763  CALL rflu_createwtsf2cwrapper(pregion,pmixtinput%spaceOrder-1)
764  CALL rflu_computewtsf2cwrapper(pregion,pmixtinput%spaceOrder-1)
765  END IF ! pMixtInput%flowModel
766 
767  DO ipatch = 1,pregion%grid%nPatches
768  ppatch => pregion%patches(ipatch)
769 
770  IF ( rflu_decideneedbgradface(pregion,ppatch) .EQV. .true. ) THEN
771  CALL rflu_createwtsbf2cwrapper(pregion,ppatch,ppatch%spaceOrder)
772  CALL rflu_computewtsbf2cwrapper(pregion,ppatch,ppatch%spaceOrder)
773  END IF ! RFLU_DecideNeedBGradFace
774  END DO ! iPatch
775  END DO ! iReg
776 
777 ! ==============================================================================
778 ! Weights for optimal LES approach. NOTE that at present, this will work only
779 ! for non-moving grids.
780 ! ==============================================================================
781 
782  DO ireg = 1,global%nRegionsLocal
783  pregion => plevel%regions(ireg)
784  pmixtinput => pregion%mixtInput
785 
786  IF ( pmixtinput%spaceDiscr == discr_opt_les ) THEN
787  CALL rflu_findprototypefacesoles(pregion)
788  CALL rflu_buildstencilsoles(pregion)
789  CALL rflu_computegeometrictermsoles(pregion)
790  CALL rflu_buildsymmetrymapsoles(pregion)
791 
792 ! CALL RFLU_ComputeIntegrals1245OLES(pRegion)
793 ! CALL RFLU_EnforceSymmetryOLES(pRegion)
794 ! CALL RFLU_WriteIntegrals1245OLES(pRegion)
795 
796  CALL rflu_readintegrals1245oles(pregion)
797  CALL rflu_enforcesymmetryoles(pregion)
798 ! CALL RFLU_WriteIntegrals1245OLES(pRegion)
799  END IF ! pMixtInput
800  END DO ! iReg
801 
802 #ifdef PLAG
803 ! ******************************************************************************
804 ! Compute in-cell test tolerance
805 ! ******************************************************************************
806 
807  DO ireg = 1,global%nRegionsLocal
808  pregion => plevel%regions(ireg)
809 
810  IF ( pregion%global%plagUsed .EQV. .true. ) THEN
811  CALL rflu_ict_computetolerance(pregion)
812  END IF ! pRegion%global%plagUsed
813  END DO ! iReg
814 #endif
815 
816 ! ******************************************************************************
817 ! Read solution data files
818 ! ******************************************************************************
819 
820  DO ireg = 1,global%nRegionsLocal
821  pregion => plevel%regions(ireg)
822  CALL rflu_readflowwrapper(pregion)
823 
824 #ifdef PLAG
825  IF ( global%plagUsed .EQV. .true. ) THEN
826  CALL plag_readsurfstatswrapper(pregion)
827  END IF ! plagUsed
828 #endif
829  END DO ! iReg
830 
831 #ifdef GENX
832 ! ******************************************************************************
833 ! Get interface data
834 ! ******************************************************************************
835 
836  DO ireg = 1,global%nRegionsLocal
837  pregion => plevel%regions(ireg)
838  CALL rflu_genx_getdatainterf(pregion)
839  END DO ! iReg
840 #endif
841 
842 ! ******************************************************************************
843 ! Read boundary condition data (only relevant if distribution specified)
844 ! Also Read boundary variables if required, i.e., if NSCBC==1
845 ! ******************************************************************************
846 
847  DO ireg = 1,global%nRegionsLocal
848  pregion => plevel%regions(ireg)
849 
850  CALL rflu_bxv_readvarswrapper(pregion)
851 
852  IF ( rflu_decidereadwritebcdatafile(pregion) .EQV. .true. ) THEN
853  CALL rflu_readbcdatafile(pregion)
854  END IF ! RFLU_DecideReadWriteBcDataFile
855  END DO ! iReg
856 
857 ! ******************************************************************************
858 ! Read grid speeds. NOTE must be done after face list is constructed, because
859 ! need to know number of faces to be able to read grid speeds.
860 ! ******************************************************************************
861 
862  DO ireg = 1,global%nRegionsLocal
863  pregion => plevel%regions(ireg)
864 
865  IF ( rflu_decideneedgridspeeds(pregion) .EQV. .true. ) THEN
866  CALL rflu_readgridspeedswrapper(pregion)
867  END IF ! RFLU_DecideNeedGridSpeeds
868  END DO ! iReg
869 
870 ! ******************************************************************************
871 ! Initialize grid speed scaling factor. NOTE needs to be done for steady flows
872 ! to work properly because grid speed is used together with scaling routines.
873 ! ******************************************************************************
874 
875  DO ireg = 1,global%nRegionsLocal
876  pregion => plevel%regions(ireg)
877 
878  CALL rflu_initgridspeedscalefactor(pregion)
879  END DO ! iReg
880 
881 #ifdef STATS
882 ! ******************************************************************************
883 ! Statistics initialization
884 ! ******************************************************************************
885 
886  CALL initstatistics(plevel%regions)
887 #endif
888 
889 ! ******************************************************************************
890 ! Create buffers and tags for communication
891 ! ******************************************************************************
892 
893  DO ireg = 1,global%nRegionsLocal
894  pregion => plevel%regions(ireg)
895  pgrid => pregion%grid
896 
897  IF ( pgrid%nBorders > 0 ) THEN
898  CALL rflu_mpi_createbufferswrapper(pregion)
899  CALL rflu_mpi_settagswrapper(pregion)
900 
901 #ifdef PLAG
902  IF ( pregion%global%plagUsed .EQV. .true. ) THEN
903  CALL rflu_mpi_createbufferipclsend(pregion)
904  END IF ! pRegion%global%plagUsed
905 #endif
906  END IF ! pRegion%grid%nBorders
907  END DO ! iReg
908 
909 ! *****************************************************************************
910 ! Initialize virtual-cell data via communication (done for GENX runs after
911 ! remeshing because remeshing tool does not initialize ghosts)
912 ! *****************************************************************************
913 
914  DO ireg = 1,global%nRegionsLocal
915  pregion => plevel%regions(ireg)
916  CALL rflu_mpi_isendwrapper(pregion)
917  END DO ! iReg
918 
919  CALL rflu_mpi_copywrapper(plevel%regions)
920 
921  DO ireg = 1,global%nRegionsLocal
922  pregion => plevel%regions(ireg)
923  CALL rflu_mpi_recvwrapper(pregion)
924  END DO ! iReg
925 
926  DO ireg = 1,global%nRegionsLocal
927  pregion => plevel%regions(ireg)
928  CALL rflu_mpi_clearrequestwrapper(pregion)
929  END DO ! iReg
930 
931 ! ******************************************************************************
932 ! Initialize dependent variables
933 ! ******************************************************************************
934 
935  DO ireg = 1,global%nRegionsLocal
936  pregion => plevel%regions(ireg)
937  CALL rflu_setvarswrapper(pregion,1,pregion%grid%nCellsTot)
938 
939 ! TEMPORARY : move it to proper place ....
940  IF ( rflu_nscbc_decidehavenscbc(pregion) .EQV. .true. ) THEN
941  CALL rflu_bxv_setdependentvars(pregion)
942  END IF !
943 ! END TEMPORARY
944  END DO ! iReg
945 
946 #ifdef GENX
947 ! ******************************************************************************
948 ! Initialize Rocman
949 ! ******************************************************************************
950 
951  DO ireg = 1,global%nRegionsLocal
952  pregion => plevel%regions(ireg)
953  CALL rflu_genx_initrocman(pregion,genxhandle)
954  END DO ! iReg
955 
956 ! ******************************************************************************
957 ! Check that have coupled boundaries defined, must be done after field flags
958 ! are created
959 ! ******************************************************************************
960 
961 ! TEMPORARY - Breaks intermittently, without this you need to make sure that
962 ! your input files are correct; there is no checking...
963 ! CALL RFLU_CheckCouplingInput(pLevel%regions)
964 ! END TEMPORARY
965 
966 ! ******************************************************************************
967 ! Put initial data into GENX buffers. NOTE no longer get data to fill incoming
968 ! buffers to make sure restarts are always the same regardless of the time.
969 ! Incoming buffers are filled at beginning of time-stepping routine
970 ! ******************************************************************************
971 
972  DO ireg = 1,global%nRegionsLocal
973  pregion => plevel%regions(ireg)
974  IF ( global%currentTime /= 0.0_rfreal ) THEN
975  CALL rflu_genx_initbflag(pregion)
976  CALL rflu_getboundaryvalues(plevel%regions(ireg))
977  END IF
978 
979  CALL rflu_putboundaryvalues(plevel%regions(ireg))
980  END DO ! iReg
981 #endif
982 
983 ! ******************************************************************************
984 ! Set options for grid motion, must be done after boundary normals are built
985 ! and data fields for communication are created
986 ! ******************************************************************************
987 
988 ! TEMPORARY - Disabled until merged with changes for periodic and symmetry
989 ! boundaries
990 ! IF ( moveGrid .EQV. .TRUE. ) THEN
991 ! DO iReg = 1,global%nRegionsLocal
992 ! pRegion => pLevel%regions(iReg)
993 ! CALL RFLU_SetMoveGridOptions(pRegion)
994 ! END DO ! iReg
995 ! END IF ! moveGrid
996 ! END TEMPORARY
997 
998 ! ******************************************************************************
999 ! Find probe cells and print information on probe locations
1000 ! ******************************************************************************
1001 
1002  IF ( global%nProbes > 0 ) THEN
1003  DO ireg = 1,global%nRegionsLocal
1004  pregion => plevel%regions(ireg)
1005  CALL rflu_findprobecells(pregion)
1006  END DO ! iReg
1007 
1008  CALL rflu_printprobeinfo(global)
1009  END IF ! global
1010 
1011 ! ******************************************************************************
1012 ! Open files for convergence data, probe data, and OLES output
1013 ! ******************************************************************************
1014 
1015  CALL rflu_openconverfile(global)
1016 
1017 #ifndef GENX
1018  IF ( movegrid .EQV. .true. ) THEN
1019  CALL rflu_opentotalmassfile(global)
1020  END IF ! moveGrid
1021 #endif
1022 
1023  IF ( global%nProbes > 0 ) THEN
1024  DO ireg = 1,global%nRegionsLocal
1025  pregion => plevel%regions(ireg)
1026  CALL rflu_openprobefiles(pregion)
1027  END DO ! iReg
1028  END IF ! global
1029 
1030 ! BEGIN TEMPORARY - only works for single regions at the moment
1031  DO ireg = 1,global%nRegionsLocal
1032  pregion => plevel%regions(ireg)
1033 
1034  IF ( pregion%mixtInput%spaceDiscr == discr_opt_les ) THEN
1035  CALL rflu_openstatsfileoles(global)
1036  END IF ! pRegion%mixtInput
1037  END DO ! iReg
1038 ! END TEMPORARY
1039 
1040 #ifndef GENX
1041 ! ******************************************************************************
1042 ! Compute integral values and write to file
1043 ! ******************************************************************************
1044 
1045  global%massIn = 0.0_rfreal
1046  global%massOut = 0.0_rfreal
1047 
1048  IF ( movegrid .EQV. .true. ) THEN
1049  CALL rflu_computeintegralvalues(plevel%regions)
1050  CALL writetotalmass(plevel%regions)
1051  END IF ! moveGrid
1052 #endif
1053 
1054 #ifdef PETSC
1055 ! ******************************************************************************
1056 ! Initialize PETSc-related arrays and quantities
1057 ! ******************************************************************************
1058 
1059 ! pRegion => pLevel%regions(1)
1060 ! CALL RFLU_PETSC_Init(global)
1061 ! CALL RFLU_PETSC_CreatePoisson(pRegion)
1062 ! CALL RFLU_PETSC_BuildPoisson(pRegion)
1063 ! CALL RFLU_PETSC_SetSolverPoisson(pRegion)
1064 ! CALL RFLU_PETSC_SolvePressurePoisson(pRegion)
1065 ! CALL RFLU_PETSC_Finalize(global)
1066 
1067  IF ( global%solverType == solv_implicit_nk ) THEN
1068  pregion => plevel%regions(1)
1069  CALL rflu_petsc_init(global)
1070  CALL rflu_petsc_createvectors(pregion)
1071  CALL rflu_petsc_createjacobian(pregion)
1072  END IF ! global%solverType
1073 #endif
1074 
1075 ! ******************************************************************************
1076 ! End
1077 ! ******************************************************************************
1078 
1079  IF ( global%myProcid == masterproc .AND. &
1080  global%verbLevel >= verbose_high ) THEN
1081  WRITE(stdout,'(A)') solver_name
1082  WRITE(stdout,'(A,1X,A)') solver_name,'Initialization done.'
1083  WRITE(stdout,'(A)') solver_name
1084  END IF ! global%myProcid
1085 
1086  CALL deregisterfunction(global)
1087 
1088 END SUBROUTINE rflu_initflowsolver
1089 
1090 ! ******************************************************************************
1091 !
1092 ! RCS Revision history:
1093 !
1094 ! $Log: RFLU_InitFlowSolver.F90,v $
1095 ! Revision 1.123 2008/12/06 08:44:30 mtcampbe
1096 ! Updated license.
1097 !
1098 ! Revision 1.122 2008/11/19 22:17:42 mtcampbe
1099 ! Added Illinois Open Source License/Copyright
1100 !
1101 ! Revision 1.121 2007/04/20 16:07:49 mtcampbe
1102 ! Updating for burnout support function RFLU_GENX_InitBFLAG
1103 !
1104 ! Revision 1.120 2007/04/14 14:33:35 mtcampbe
1105 ! Updated for TZ
1106 !
1107 ! Revision 1.119 2007/02/27 13:12:29 haselbac
1108 ! Adapted to changes in RFLU_ModDimensionality
1109 !
1110 ! Revision 1.118 2006/12/21 12:22:12 haselbac
1111 ! Added call to check patch-bc consistency
1112 !
1113 ! Revision 1.117 2006/10/20 21:32:23 mparmar
1114 ! Added calls to create and compute global thrustFlags
1115 !
1116 ! Revision 1.116 2006/08/19 15:46:27 mparmar
1117 ! Changed because of NSCBC implementation
1118 !
1119 ! Revision 1.115 2006/08/18 14:04:50 haselbac
1120 ! Added calls to build AVFace2Patch list, read transforms, cosmetics
1121 !
1122 ! Revision 1.114 2006/06/23 21:37:47 mtcampbe
1123 ! Added a GetBoundary call for genx restarts - makes surface data correct.
1124 !
1125 ! Revision 1.113 2006/06/16 19:39:30 mtcampbe
1126 ! Fixed MPI_Init sequencing for Rocstar/Native initialization
1127 !
1128 ! Revision 1.112 2006/06/06 21:36:04 mtcampbe
1129 ! Remeshing/Rocstar mods DummyCell population, time 0 inits
1130 !
1131 ! Revision 1.111 2006/04/07 16:04:03 haselbac
1132 ! Adapted to changes in bf2c wts computation
1133 !
1134 ! Revision 1.110 2006/04/07 15:19:22 haselbac
1135 ! Removed tabs
1136 !
1137 ! Revision 1.109 2006/04/07 14:53:27 haselbac
1138 ! Adapted to changes in bface stencil routines
1139 !
1140 ! Revision 1.108 2006/03/25 22:03:26 haselbac
1141 ! Fix comment
1142 !
1143 ! Revision 1.107 2006/03/25 22:02:51 haselbac
1144 ! Changes bcos of sype patches: Comment out Rxx2Sxx maps and face
1145 ! reorientation, compute patch normals
1146 !
1147 ! Revision 1.106 2006/03/09 14:10:03 haselbac
1148 ! Now call wrapper routines for stencils
1149 !
1150 ! Revision 1.105 2006/02/06 23:55:54 haselbac
1151 ! Added comm argument to RFLU_InitGlobal
1152 !
1153 ! Revision 1.104 2006/01/10 05:04:58 wasistho
1154 ! moved InitStatistics to before InitRocman
1155 !
1156 ! Revision 1.103 2006/01/06 22:15:36 haselbac
1157 ! Adapted to name changes
1158 !
1159 ! Revision 1.102 2006/01/03 06:32:03 wasistho
1160 ! moved Genx new-attr and registr. routines to wrappers
1161 !
1162 ! Revision 1.101 2005/12/24 21:34:49 haselbac
1163 ! Added computation of ICT tolerance
1164 !
1165 ! Revision 1.100 2005/12/24 02:25:31 wasistho
1166 ! moved statistics mapping befor Genx registration
1167 !
1168 ! Revision 1.99 2005/12/24 02:15:22 wasistho
1169 ! activated statistics mapping
1170 !
1171 ! Revision 1.98 2005/12/01 17:14:36 fnajjar
1172 ! Moved call to RFLU_RandomInit after reading user input
1173 !
1174 ! Revision 1.97 2005/11/10 16:51:29 fnajjar
1175 ! Added plagUsed IF statement around PLAG routines
1176 !
1177 ! Revision 1.96 2005/11/04 14:07:24 haselbac
1178 ! Renamed dim check routine, added dim geom check routine
1179 !
1180 ! Revision 1.95 2005/10/28 19:18:15 haselbac
1181 ! Added check for nProcs not being equal to nProcAlloc
1182 !
1183 ! Revision 1.94 2005/10/27 19:20:19 haselbac
1184 ! Adapted to changes in stencil routine names
1185 !
1186 ! Revision 1.93 2005/10/25 19:39:23 haselbac
1187 ! Added IF on forceFlag
1188 !
1189 ! Revision 1.92 2005/10/05 14:19:23 haselbac
1190 ! Adapted to changes in stencil mods, added call to create and comp bface wts
1191 !
1192 ! Revision 1.91 2005/09/14 15:59:33 haselbac
1193 ! Minor clean-up
1194 !
1195 ! Revision 1.90 2005/09/13 20:39:39 mtcampbe
1196 ! Moved profiling call into this file
1197 !
1198 ! Revision 1.89 2005/08/03 18:42:39 hdewey2
1199 ! Enclosed PETSc init calls inside IF
1200 !
1201 ! Revision 1.88 2005/08/02 18:57:58 hdewey2
1202 ! Temporarily commented out USE RFLU_ModPETScPoisson
1203 !
1204 ! Revision 1.87 2005/08/02 18:29:17 hdewey2
1205 ! Added init of PETSc data and quantities
1206 !
1207 ! Revision 1.86 2005/07/01 15:15:17 haselbac
1208 ! Added setting of Roccom verbosity level
1209 !
1210 ! Revision 1.85 2005/06/09 20:30:14 haselbac
1211 ! Disabled checking of move grid options
1212 !
1213 ! Revision 1.84 2005/05/18 22:13:27 fnajjar
1214 ! ACH: Added creation of iPclSend buffers, now use nFacesAV
1215 !
1216 ! Revision 1.83 2005/05/12 18:02:53 haselbac
1217 ! Removed call to COM_set_verbose
1218 !
1219 ! Revision 1.82 2005/04/29 23:02:54 haselbac
1220 ! Added building of avf2b list
1221 !
1222 ! Revision 1.81 2005/04/29 13:00:56 haselbac
1223 ! Fixed bug in name of routine for opening probe files
1224 !
1225 ! Revision 1.80 2005/04/29 12:49:31 haselbac
1226 ! Added USE RFLU_ModProbes, removed interfaces for probe routines
1227 !
1228 ! Revision 1.79 2005/04/15 16:31:18 haselbac
1229 ! Removed calls to XyzEdge2RegionDegrList routines
1230 !
1231 ! Revision 1.78 2005/04/15 15:07:18 haselbac
1232 ! Converted to MPI, integrated MPI code with GENx
1233 !
1234 ! Revision 1.77 2005/03/09 15:08:25 haselbac
1235 ! Added dimensionality check
1236 !
1237 ! Revision 1.76 2005/01/18 15:18:18 haselbac
1238 ! Commented out COMM calls for now
1239 !
1240 ! Revision 1.75 2005/01/14 21:35:29 haselbac
1241 ! Added calls to create and read comm lists
1242 !
1243 ! Revision 1.74 2005/01/13 21:40:29 haselbac
1244 ! Bug fix in setting pRegion for PETSc testing
1245 !
1246 ! Revision 1.73 2005/01/07 19:25:56 fnajjar
1247 ! Added call to PLAG_ReadSurfStatsWrapper
1248 !
1249 ! Revision 1.72 2005/01/03 15:58:34 haselbac
1250 ! Adapted to changes in RFLU_ModStencils
1251 !
1252 ! Revision 1.71 2004/12/28 20:28:13 wasistho
1253 ! moved statistics routines into module ModStatsRoutines
1254 !
1255 ! Revision 1.70 2004/12/21 23:34:32 fnajjar
1256 ! Added definition of pMixtInput pointer in incompressible part
1257 !
1258 ! Revision 1.69 2004/12/21 15:05:11 fnajjar
1259 ! Included calls for PLAG surface statistics
1260 !
1261 ! Revision 1.68 2004/12/19 15:49:50 haselbac
1262 ! Added incompressible stuff
1263 !
1264 ! Revision 1.67 2004/12/04 03:34:04 haselbac
1265 ! Adapted to changes in RFLU_ModCellMapping
1266 !
1267 ! Revision 1.66 2004/11/29 17:17:20 wasistho
1268 ! use ModInterfacesStatistics
1269 !
1270 ! Revision 1.65 2004/11/14 19:47:15 haselbac
1271 ! Now call RFLU_SetVarsWrapper instead of UpdateDependentVarsMP
1272 !
1273 ! Revision 1.64 2004/11/03 17:05:08 haselbac
1274 ! Removed HACK_PERIODIC ifdef and call to RFLU_GENX_CreateAttrGridVol
1275 !
1276 ! Revision 1.63 2004/11/02 02:32:51 haselbac
1277 ! Added call to RFLU_SetVarInfoWrapper
1278 !
1279 ! Revision 1.62 2004/10/21 15:54:13 haselbac
1280 ! Added ifdef for static linking
1281 !
1282 ! Revision 1.61 2004/10/20 15:01:13 haselbac
1283 ! Bug fix: Changes made to allow compilation within GENx without CHARM=1
1284 !
1285 ! Revision 1.60 2004/10/19 19:29:19 haselbac
1286 ! Substantial changes because of new GENX logic
1287 !
1288 ! Revision 1.59 2004/07/06 15:14:52 haselbac
1289 ! Adapted to changes in libflu and modflu, cosmetics
1290 !
1291 ! Revision 1.58 2004/06/25 20:08:25 haselbac
1292 ! Added call to RFLU_SetRestartTimeFlag
1293 !
1294 ! Revision 1.57 2004/06/22 15:55:05 haselbac
1295 ! Bug fix for running serial jobs with Charm code
1296 !
1297 ! Revision 1.56 2004/06/16 20:01:09 haselbac
1298 ! Added allocation of patch and force and moment coeffs, cosmetics
1299 !
1300 ! Revision 1.55 2004/06/07 23:09:57 wasistho
1301 ! moved statistics mapping from initStatistics to before initGenxInterfaces
1302 !
1303 ! Revision 1.54 2004/04/14 02:09:24 haselbac
1304 ! Added initialization of grid-speed factor
1305 !
1306 ! Revision 1.53 2004/02/26 21:02:09 haselbac
1307 ! Added PLAG support, changed alloc logic, added updateDependentVarsMP
1308 !
1309 ! Revision 1.52 2004/01/29 22:59:22 haselbac
1310 ! Added call to reading of bc data file, clean-up
1311 !
1312 ! Revision 1.51 2004/01/22 16:04:33 haselbac
1313 ! Changed declaration to eliminate warning on ALC
1314 !
1315 ! Revision 1.50 2003/12/07 04:59:22 jiao
1316 ! When GENX is defined, added a local variable "levels" to be
1317 ! used when calling RFLU_BuildDataStruct and RFLU_AssignRegionMapping
1318 ! to work around a complaint of PGI compiler.
1319 !
1320 ! Revision 1.49 2003/12/04 03:30:04 haselbac
1321 ! Added calls for stencils and weights, cleaned up
1322 !
1323 ! Revision 1.48 2003/11/25 21:04:41 haselbac
1324 ! Added call to RFLU_ReadBcInputFileWrapper, commented out communication
1325 !
1326 ! Revision 1.47 2003/11/03 03:51:31 haselbac
1327 ! Added call to build boundary-face gradient access list
1328 !
1329 ! Revision 1.46 2003/09/12 21:35:51 haselbac
1330 ! Fixed bug: Needed fem files for 1 proc cases
1331 !
1332 ! Revision 1.45 2003/08/29 22:48:33 haselbac
1333 ! mpif.h should not be included directly here...
1334 !
1335 ! Revision 1.44 2003/08/28 20:27:19 olawlor
1336 ! Minor tweaks for non-genx compilation--
1337 ! - We need mpif.h
1338 ! - Read input files from current directory, not Rocflu/inDir/.
1339 !
1340 ! Revision 1.43 2003/08/27 15:38:00 haselbac
1341 ! Removed single and double quotes from last comments
1342 !
1343 ! Revision 1.42 2003/08/26 22:48:56 olawlor
1344 ! Changes to startup sequence for latest Charm++/FEM framework:
1345 ! - Call FEM_Init with an MPI communicator to set up FEM.
1346 ! This replaces the old FEM_Attach call, and corresponding
1347 ! -fem parameter in genx.C.
1348 !
1349 ! - Get partition number and number of partitions from MPI.
1350 ! The FEM partition numbers are not needed any more.
1351 !
1352 ! - Read in the FEM input files yourself, using FEM_Mesh_read.
1353 ! This allows the FEM input files to reside in the Rocflu
1354 ! directory.
1355 !
1356 ! Revision 1.41 2003/08/13 20:29:01 haselbac
1357 ! Fixed bug with writing probe data within GENx
1358 !
1359 ! Revision 1.40 2003/07/22 15:39:50 haselbac
1360 ! Added Nullify routines
1361 !
1362 ! Revision 1.39 2003/06/20 22:35:43 haselbac
1363 ! Added call to RFLU_ReadRestartInfo
1364 !
1365 ! Revision 1.38 2003/06/04 20:05:53 jferry
1366 ! re-worked implementation of TBCs in unstructured code
1367 !
1368 ! Revision 1.37 2003/05/16 21:51:29 mtcampbe
1369 ! ACH: Temporarily disabled checking of coupling input
1370 !
1371 ! Revision 1.36 2003/05/13 23:49:46 haselbac
1372 ! Changed format for writing out number of procs
1373 !
1374 ! Revision 1.35 2003/05/01 14:11:19 haselbac
1375 ! Added call to RFLU_CheckCouplingInput
1376 !
1377 ! Revision 1.34 2003/04/24 15:43:13 haselbac
1378 ! Adapted interface to RFLU_PutBoundaryValues
1379 !
1380 ! Revision 1.33 2003/04/12 21:38:08 haselbac
1381 ! Added setting of FEMRocfluGrid, verb and check level now read
1382 !
1383 ! Revision 1.32 2003/04/07 14:26:50 haselbac
1384 ! Added cell-to-face list and probe info calls
1385 !
1386 ! Revision 1.31 2003/03/31 16:17:21 haselbac
1387 ! Added writing of version string
1388 !
1389 ! Revision 1.30 2003/03/25 19:16:58 haselbac
1390 ! Changed calling sequence for reorientation of AV faces
1391 !
1392 ! Revision 1.29 2003/03/18 21:34:28 haselbac
1393 ! Modified call to RFLU_AllocateMemoryWrapper
1394 !
1395 ! Revision 1.28 2003/03/15 18:38:12 haselbac
1396 ! Some adaptations for || gm, added serial mapping imposition
1397 !
1398 ! Revision 1.27 2003/02/17 19:31:12 jferry
1399 ! Implemented portable random number generator ModRandom
1400 !
1401 ! Revision 1.26 2003/01/31 13:53:57 haselbac
1402 ! Removed call to RFLU_GetBoundaryValues if not restarting
1403 !
1404 ! Revision 1.25 2003/01/28 14:40:33 haselbac
1405 ! Extensive reorganization to get GENx restart to work with gm
1406 !
1407 ! Revision 1.24 2002/11/27 20:25:14 haselbac
1408 ! Moved RFLU_SetMoveGridOptions to after having read bc file
1409 !
1410 ! Revision 1.23 2002/11/26 15:27:55 haselbac
1411 ! Added RFLU_SetMoveGridOptions
1412 !
1413 ! Revision 1.22 2002/11/26 15:18:39 haselbac
1414 ! Added ifdef to opening of total mass file
1415 !
1416 ! Revision 1.21 2002/11/08 21:32:01 haselbac
1417 ! Added opening of total-mass file
1418 !
1419 ! Revision 1.20 2002/10/27 19:13:03 haselbac
1420 ! New calls for grid motion, cosmetic redesign
1421 !
1422 ! Revision 1.19 2002/10/19 16:15:19 haselbac
1423 ! Cosmetic changes to output
1424 !
1425 ! Revision 1.18 2002/10/17 22:35:03 jiao
1426 ! ACH: Deactivate RFLU_PrintFlowInfo with GENX, gives small discrepancy for restart
1427 !
1428 ! Revision 1.17 2002/10/17 14:14:00 haselbac
1429 ! Removed RFLU_GetBValues: Moved to RFLU_FlowSolver (discussion with Jim J.)
1430 !
1431 ! Revision 1.16 2002/10/16 21:17:37 haselbac
1432 ! Added writing of header when running
1433 !
1434 ! Revision 1.15 2002/10/12 14:59:13 haselbac
1435 ! Changed order of BC and GENX, added call to RFLU_GetBValues
1436 !
1437 ! Revision 1.14 2002/10/05 19:22:53 haselbac
1438 ! GENX integration, added interface for RFLU_CreateFields
1439 !
1440 ! Revision 1.13 2002/09/09 16:27:12 haselbac
1441 ! CVS appears to have got confused...
1442 !
1443 ! Revision 1.12 2002/09/09 15:51:56 haselbac
1444 ! RFLU_HACK_PeriodicCellMapping.F90
1445 !
1446 ! Revision 1.11 2002/08/16 21:33:48 jblazek
1447 ! Changed interface to MixtureProperties.
1448 !
1449 ! Revision 1.10 2002/07/25 14:20:51 haselbac
1450 ! Added call to OLES routines, completed CHARM code segment
1451 !
1452 ! Revision 1.9 2002/06/27 15:28:22 haselbac
1453 ! Added CHARM stuff, deleted MPI stuff
1454 !
1455 ! Revision 1.8 2002/06/14 21:54:35 wasistho
1456 ! Added time avg statistics
1457 !
1458 ! Revision 1.7 2002/06/14 20:21:26 haselbac
1459 ! Deleted ModLocal, changed local%nRegions to global%nRegionsLocal
1460 !
1461 ! Revision 1.6 2002/06/10 21:31:14 haselbac
1462 ! Added call to RFLU_PrintHeader, changed flag to CHECK_UNIFLOW
1463 !
1464 ! Revision 1.5 2002/06/05 18:59:53 haselbac
1465 ! Added RFLU_PrintGridInfo and changed version number
1466 !
1467 ! Revision 1.4 2002/05/04 17:10:20 haselbac
1468 ! Added memory allocation, mixture properties, and checking
1469 !
1470 ! Revision 1.3 2002/04/11 19:03:45 haselbac
1471 ! Added calls and cosmetic changes
1472 !
1473 ! Revision 1.2 2002/03/26 19:23:39 haselbac
1474 ! Some cleaning and added reading of input files
1475 !
1476 ! Revision 1.1 2002/03/14 19:12:48 haselbac
1477 ! Initial revision
1478 !
1479 ! ******************************************************************************
1480 
1481 
1482 
1483 
1484 
1485 
1486 
subroutine, public rflu_buildcell2facelist(pRegion)
subroutine, public rflu_comm_readcommlists(pRegion)
subroutine rflu_creategrid(pRegion)
subroutine, public rflu_createwtsf2cwrapper(pRegion, order)
subroutine, public rflu_bxv_createvarststep(pRegion)
subroutine rflu_movegridwrapper(regions)
subroutine, public rflu_buildbf2cstencilwrapper(pRegion, pPatch, constrInput)
subroutine, public rflu_buildbvertexlists(pRegion)
subroutine, public rflu_readbcdatafile(pRegion)
subroutine, public rflu_genx_creategridsurf(pRegion)
subroutine, public rflu_createc2cstencilwrapper(pRegion)
subroutine, public rflu_buildedge2celllist(pRegion)
subroutine, public rflu_computegeometrictermsoles(pRegion)
subroutine, public rflu_createwtsc2cwrapper(pRegion, order)
subroutine, public rflu_genx_getglobaldata(Global)
subroutine rflu_setvarswrapper(pRegion, icgBeg, icgEnd)
subroutine, public rflu_genx_createwindowsdone(pRegion)
subroutine, public rflu_checkpatchbcconsistency(pRegion)
subroutine, public rflu_genx_getdatainterf(pRegion)
subroutine, public rflu_destroyregionmapping(global, mapType)
LOGICAL function, public rflu_decidereadwritebcdatafile(pRegion)
subroutine, public rflu_genx_registergridsurf(pRegion)
subroutine, public rflu_readdimensionswrapper(pRegion)
subroutine, public rflu_mpi_createbufferipclsend(pRegion, pBorder)
subroutine, public rflu_buildf2cstencilwrapper(pRegion, constrInput)
subroutine rflu_computeintegrals1245oles(pRegion)
subroutine, public rflu_createbf2cstencilwrapper(pRegion, pPatch)
subroutine, public rflu_setinfof2cstencilwrapper(pRegion, orderNominal)
subroutine, public rflu_buildavface2borderlist(pRegion)
subroutine, public rflu_computefacedist(pRegion)
subroutine, public rflu_createcell2facelist(pRegion)
LOGICAL function rflu_decideneedbgradface(pRegion, pPatch)
subroutine, public initstatistics(regions)
subroutine, public rflu_createfacedist(pRegion)
subroutine, public rflu_genx_initrocman(pRegion, handle)
subroutine, public rflu_mpi_isendwrapper(pRegion)
subroutine, public rflu_createbfacegradaccesslist(pRegion)
subroutine rflu_allocatememorywrapper(pRegion)
subroutine, public rflu_createavface2borderlist(pRegion)
subroutine rflu_writeintegrals1245oles(pRegion)
subroutine rflu_getuserinput(regions, inPrep)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine, public rflu_comm_getproclocregids(pRegion)
subroutine, public rflu_genx_storenameshandles(global, surfWinNameInput, volWinNameInput, handleObtain)
subroutine, public rflu_buildlistcc2cstencil(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_readgridspeedswrapper(pRegion)
subroutine, public rflu_petsc_createvectors(pRegion)
subroutine, public rflu_readbcinputfilewrapper(pRegion)
subroutine, public rflu_createwtsbf2cwrapper(pRegion, pPatch, order)
subroutine, public rflu_mpi_clearrequestwrapper(pRegion)
subroutine rflu_putboundaryvalues(region)
subroutine, public rflu_genx_registerdatawrapper(pRegion)
subroutine, public rflu_buildbfacegradaccesslist(pRegion)
subroutine, public rflu_findprototypefacesoles(pRegion)
MPI_Comm communicator() const
Definition: Function.h:119
LOGICAL function, public rflu_decideneedgridspeeds(pRegion)
subroutine, public rflu_findprobecells(pRegion)
subroutine, public rflu_createforcesmoments(pRegion)
subroutine rflu_setmovegridoptions(pRegion)
subroutine, public rflu_123d_checkgeometrywrapper(pRegion)
subroutine rflu_setvarinfowrapper(pRegion)
subroutine, public rflu_ict_computetolerance(pRegion)
subroutine, public rflu_computewtsbf2cwrapper(pRegion, pPatch, order)
subroutine rflu_allocatememorytbc(pRegion)
subroutine, public rflu_comm_createborders(pRegion, createMode)
subroutine, public rflu_readloc2globcellmapping(pRegion)
subroutine, public rflu_123d_checktopology(pRegion)
subroutine, public rflu_openprobefiles(pRegion)
LOGICAL function, public rflu_nscbc_decidehavenscbc(pRegion)
subroutine, public rflu_genx_createwindows(pRegion, communicator)
subroutine rflu_openstatsfileoles(global)
subroutine, public rflu_printprobeinfo(global)
subroutine, public rflu_createfacelist(pRegion)
subroutine, public rflu_bxv_createvarsdv(pRegion)
subroutine, public rflu_enforcesymmetryoles(pRegion)
subroutine, public rflu_buildglob2loccellmapping(pRegion)
subroutine, public rflu_computepatchnormalsglobal(regions)
subroutine, public rflu_comm_createcommlists(pRegion)
subroutine rflu_computeintegralvalues(regions)
subroutine, public statmapping(global)
subroutine, public plag_readsurfstatswrapper(pRegion)
subroutine, public rflu_genx_initbflag(pRegion)
subroutine, public rflu_setglobalthrustflags(regions)
subroutine, public rflu_initgridspeedscalefactor(pRegion)
subroutine, public rflu_createedgelist(pRegion)
subroutine, public plag_createsurfstats(pRegion)
subroutine, public rflu_mpi_recvwrapper(pRegion)
subroutine, public rflu_buildfacelist(pRegion)
subroutine, public rflu_bxv_readvarswrapper(pRegion)
subroutine, public rflu_renumberbfacelists(pRegion)
subroutine, public rflu_genx_getdimensionsderived(pRegion)
subroutine, public rflu_relp_transformwrapper(pRegion)
subroutine, public rflu_mpi_settagswrapper(pRegion)
subroutine, public rflu_genx_storecommunicator(global, communicator)
subroutine, public rflu_mpi_createbufferswrapper(pRegion)
subroutine, public rflu_readregionmappingfile(global, readMode, myProcId)
subroutine rflu_printflowinfo(pRegion)
subroutine rflu_builddatastruct(global, levels)
subroutine, public rflu_readflowwrapper(pRegion)
subroutine, public rflu_bxv_setdependentvars(pRegion)
subroutine, public rflu_buildlistcf2cstencil(pRegion)
subroutine, public rflu_destroyvert2celllist(pRegion)
subroutine, public rflu_buildedgelist(pRegion)
subroutine, public rflu_createpatchcoeffs(pRegion)
subroutine, public rflu_genx_createattrwrapper(pRegion)
subroutine rflu_setvarscontwrapper(pRegion, icgBeg, icgEnd)
subroutine, public rflu_computewtsc2cwrapper(pRegion, order)
subroutine, public rflu_createbvertexlists(pRegion)
subroutine, public rflu_setinfoc2cstencilwrapper(pRegion, orderNominal)
subroutine, public rflu_genx_createpconn(pRegion)
subroutine rflu_setmoduletype(global, moduleType)
subroutine, public rflu_buildc2cstencilwrapper(pRegion, icgInput, constrInput)
subroutine rflu_randominit(regions)
subroutine, public rflu_buildavface2patchlist(pRegion)
subroutine, public rflu_petsc_createjacobian(pRegion)
subroutine rflu_printgridinfo(pRegion)
subroutine, public rflu_genx_registergridvol(pRegion)
subroutine, public rflu_petsc_init(global)
subroutine, public rflu_genx_readctrlfile(global)
subroutine rflu_getboundaryvalues(region)
subroutine rflu_opentotalmassfile(global)
subroutine rflu_openconverfile(global)
subroutine rflu_checkcouplinginput(regions)
subroutine, public rflu_buildsymmetrymapsoles(pRegion)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine rflu_setvarsdiscwrapper(pRegion)
subroutine, public rflu_computewtsf2cwrapper(pRegion, order)
subroutine, public rflu_mpi_copywrapper(regions)
subroutine, public rflu_computepatchnormalslocal(pRegion)
subroutine, public rflu_buildstencilsoles(pRegion)
subroutine, public rflu_sype_readtransforms(pRegion)
subroutine rflu_readtbcinputfile(pRegion)
subroutine, public rflu_createcellmapping(pRegion)
subroutine, public rflu_createavface2patchlist(pRegion)
subroutine rflu_readintegrals1245oles(pRegion)
subroutine grid(bp)
Definition: setup_py.f90:257
subroutine writetotalmass(regions)
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine, public rflu_creategeometry(pRegion)
subroutine rflu_writeversionstring(global)
subroutine, public rflu_applyregionmapping(global, levels)
subroutine rflu_initglobal(casename, verbLevel, communicator, global)
subroutine, public rflu_createf2cstencilwrapper(pRegion)
subroutine, public rflu_setinfobf2cstencilwrapper(pRegion, pPatch, orderNominal)
LOGICAL function, public rflu_sype_havesypepatches(pRegion)
subroutine rflu_readrestartinfo(global)
subroutine, public rflu_createedge2celllist(pRegion)
subroutine, public rflu_imposeregionmappingserial(global)
subroutine, public rflu_buildvert2celllist(pRegion)
subroutine, public rflu_destroyedge2celllist(pRegion)
subroutine, public rflu_createregionmapping(global, mapType)
subroutine, public rflu_createglobalthrustflags(pRegion)
subroutine rflu_initflowsolver(casename, verbLevel, global, levels)
subroutine, public rflu_bxv_createvarscv(pRegion)