Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_PostProcessRegions_ENS.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: Wrapper for postprocessing results without merging the regions
26 ! specific to EnSight.
27 !
28 ! Description: None.
29 !
30 ! Input:
31 ! levels Level data
32 !
33 ! Output: None.
34 !
35 ! Notes:
36 ! 1. This routine is specific to EnSight because the requirement that data be
37 ! written out for a certain number of servers means sharing code with
38 ! routine for Tecplot becomes cumbersome.
39 !
40 ! ******************************************************************************
41 !
42 ! $Id: RFLU_PostProcessRegions_ENS.F90,v 1.5 2008/12/06 08:45:06 mtcampbe Exp $
43 !
44 ! Copyright: (c) 2005 by the University of Illinois
45 !
46 ! ******************************************************************************
47 
48 SUBROUTINE rflu_postprocessregions_ens(levels)
49 
50  USE moddatatypes
51  USE modglobal, ONLY: t_global
52  USE moderror
53  USE moddatastruct, ONLY: t_level,t_region
54  USE modbndpatch, ONLY: t_patch
55  USE modparameters
56 
58  USE rflu_modensight
60 
61  USE modinterfaces, ONLY: rflu_closepostinfo, &
62  rflu_creategrid, &
68 
69  IMPLICIT NONE
70 
71 ! ******************************************************************************
72 ! Declarations and definitions
73 ! ******************************************************************************
74 
75 ! ==============================================================================
76 ! Arguments
77 ! ==============================================================================
78 
79  TYPE(t_level), POINTER :: levels(:)
80 
81 ! ==============================================================================
82 ! Local variables
83 ! ==============================================================================
84 
85  LOGICAL :: postinfofileexists
86  CHARACTER(CHRLEN) :: casename,rcsidentstring
87  INTEGER :: errorflag,ireg,iserver,iservertarget
88  TYPE(t_region), POINTER :: pregion
89  TYPE(t_global), POINTER :: global
90 
91 ! ******************************************************************************
92 ! Start
93 ! ******************************************************************************
94 
95  rcsidentstring = '$RCSfile: RFLU_PostProcessRegions_ENS.F90,v $ $Revision: 1.5 $'
96 
97  global => levels(1)%regions(1)%global
98 
99  CALL registerfunction(global,'RFLU_PostProcessRegions_ENS',&
100  'RFLU_PostProcessRegions_ENS.F90')
101 
102 ! ******************************************************************************
103 ! Open post info file
104 ! ******************************************************************************
105 
106  CALL rflu_openpostinfo(global,file_status_old,postinfofileexists)
107 
108 ! ******************************************************************************
109 ! Loop over servers
110 ! ******************************************************************************
111 
112  DO iserver = 1,global%postNServers
113  pregion => levels(1)%regions(1)
114 
115  CALL rflu_countplottingvars(pregion)
116  CALL rflu_createplottingvarmaps(pregion)
117  CALL rflu_buildplottingvarmaps(pregion)
118  CALL rflu_printplottingvarsinfo(pregion)
119 
120  CALL rflu_ens_builddatainfo(pregion,iserver)
121 
122  CALL rflu_destroyplottingvarmaps(pregion)
123 
124  CALL rflu_ens_writefilecase(global,iserver)
125  CALL rflu_ens_initpartnumber(global)
126 
127  CALL rflu_ens_openfilegeometry(global,iserver)
128  CALL rflu_ens_openfileflowwrapper(global,iserver)
129 
130 ! ==============================================================================
131 ! Open post info
132 ! ==============================================================================
133 
134  CALL rflu_openpostinfo(global,file_status_old,postinfofileexists)
135 
136 ! ==============================================================================
137 ! Loop over regions
138 ! ==============================================================================
139 
140  DO ireg = 1,global%nRegionsLocal
141  IF ( global%nRegions == 1 ) THEN ! single region
142  pregion => levels(1)%regions(0)
143  ELSE
144  pregion => levels(1)%regions(ireg)
145  END IF ! global%nRegions
146 
147  IF ( postinfofileexists .EQV. .true. ) THEN
148  CALL rflu_readpostinfo(pregion,infofile_readmode_flag)
149  END IF ! postInfoFileExists
150 
151 ! ------------------------------------------------------------------------------
152 ! Check for activation status
153 ! ------------------------------------------------------------------------------
154 
155  IF ( pregion%postActiveFlag .EQV. .true. ) THEN
156  iservertarget = rflu_ens_mapregion2server(ireg,global%nRegions, &
157  global%postNServers)
158 
159 ! ----- If target server not equal to this server, write empty parts -----------
160 
161  IF ( iservertarget /= iserver ) THEN
162  CALL rflu_readdimensionswrapper(pregion)
163  CALL rflu_creategrid(pregion)
164 
165  CALL rflu_ens_storepartnumber(pregion%global)
166  CALL rflu_ens_writegridwrapper(pregion,.true.)
167  CALL rflu_ens_writeflowwrapper(pregion,.true.)
168 
169  CALL rflu_destroygrid(pregion)
170 
171 ! ----- If target server equal to this server, write parts ---------------------
172 
173  ELSE
174  CALL rflu_postprocessregionscommon1(pregion,postinfofileexists)
175 
176  CALL rflu_ens_storepartnumber(pregion%global)
177  CALL rflu_ens_writegridwrapper(pregion)
178  CALL rflu_ens_writeflowwrapper(pregion)
179 
180  CALL rflu_postprocessregionscommon2(pregion)
181  END IF ! ! iServerTarget
182  END IF ! pRegion%postActiveFlag
183  END DO ! iReg
184 
185 ! ==============================================================================
186 ! Close files
187 ! ==============================================================================
188 
189  IF ( postinfofileexists .EQV. .true. ) THEN
190  CALL rflu_closepostinfo(global)
191  END IF ! postInfoFileExists
192 
193  CALL rflu_ens_closefilegeometry(global)
194  CALL rflu_ens_closefileflowwrapper(global)
195  CALL rflu_ens_destroydatainfo(global)
196  END DO ! iServer
197 
198 ! ******************************************************************************
199 ! End
200 ! ******************************************************************************
201 
202  CALL deregisterfunction(global)
203 
204 END SUBROUTINE rflu_postprocessregions_ens
205 
206 ! ******************************************************************************
207 !
208 ! RCS Revision history:
209 !
210 ! $Log: RFLU_PostProcessRegions_ENS.F90,v $
211 ! Revision 1.5 2008/12/06 08:45:06 mtcampbe
212 ! Updated license.
213 !
214 ! Revision 1.4 2008/11/19 22:18:17 mtcampbe
215 ! Added Illinois Open Source License/Copyright
216 !
217 ! Revision 1.3 2007/03/19 21:46:05 haselbac
218 ! Bug fix: Enabled use of plotting variables, done as part of changes to pv
219 !
220 ! Revision 1.2 2006/01/24 21:21:15 mparmar
221 ! Now pass pRegion instead of global into RFLU_ENS_BuildDataInfo
222 !
223 ! Revision 1.1 2005/10/05 20:23:34 haselbac
224 ! Initial revision
225 !
226 ! ******************************************************************************
227 
228 
229 
230 
231 
232 
233 
subroutine rflu_creategrid(pRegion)
subroutine rflu_ens_closefileflowwrapper(global)
subroutine rflu_destroygrid(pRegion)
subroutine, public rflu_readdimensionswrapper(pRegion)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
INTEGER function, public rflu_ens_mapregion2server(iReg, nRegions, nServers)
subroutine, public rflu_printplottingvarsinfo(pRegion)
subroutine, public rflu_ens_openfilegeometry(global, iServer)
subroutine rflu_postprocessregionscommon1(pRegion, postInfoFileExists)
subroutine, public rflu_countplottingvars(pRegion)
subroutine rflu_ens_writefilecase(global, iServer)
subroutine rflu_ens_openfileflowwrapper(global, iServer)
subroutine rflu_ens_storepartnumber(global)
subroutine rflu_openpostinfo(global, fileStatus, fileExists)
subroutine rflu_closepostinfo(global)
subroutine, public rflu_ens_writegridwrapper(pRegion, emptyPartFlagIn)
subroutine, public rflu_ens_writeflowwrapper(pRegion, emptyPartFlagIn)
subroutine, public rflu_ens_destroydatainfo(global)
subroutine, public rflu_ens_closefilegeometry(global)
subroutine, public rflu_buildplottingvarmaps(pRegion)
subroutine rflu_postprocessregions_ens(levels)
subroutine, public rflu_destroyplottingvarmaps(pRegion)
subroutine rflu_readpostinfo(pRegion, readMode)
subroutine, public rflu_ens_builddatainfo(pRegion, iServer)
subroutine, public rflu_ens_initpartnumber(global)
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine, public rflu_createplottingvarmaps(pRegion)
subroutine rflu_postprocessregionscommon2(pRegion)