Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_PostProcessRegions.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 !
27 ! Description: None.
28 !
29 ! Input:
30 ! levels Level data
31 !
32 ! Output: None.
33 !
34 ! Notes: None.
35 !
36 ! ******************************************************************************
37 !
38 ! $Id: RFLU_PostProcessRegions.F90,v 1.26 2008/12/06 08:45:06 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2004-2005 by the University of Illinois
41 !
42 ! ******************************************************************************
43 
44 SUBROUTINE rflu_postprocessregions(levels)
45 
46  USE moddatatypes
47  USE modglobal, ONLY: t_global
48  USE moderror
49  USE moddatastruct, ONLY: t_level,t_region
50  USE modbndpatch, ONLY: t_patch
51  USE modparameters
52 
54 
55 #ifndef NO_TECPLOT
56  USE rflu_modtecplot
57 #endif
58 
59 #ifdef PLAG
61 #endif
62 
63  USE modinterfaces, ONLY: rflu_closepostinfo, &
70 
71  IMPLICIT NONE
72 
73 ! ******************************************************************************
74 ! Declarations and definitions
75 ! ******************************************************************************
76 
77 ! ==============================================================================
78 ! Arguments
79 ! ==============================================================================
80 
81  TYPE(t_level), POINTER :: levels(:)
82 
83 ! ==============================================================================
84 ! Local variables
85 ! ==============================================================================
86 
87  LOGICAL :: postinfofileexists
88  CHARACTER(CHRLEN) :: casename,rcsidentstring
89  INTEGER :: errorflag,ipatch,ireg
90  TYPE(t_region), POINTER :: pregion
91  TYPE(t_global), POINTER :: global
92  TYPE(t_patch), POINTER :: ppatch
93 
94 ! ******************************************************************************
95 ! Start
96 ! ******************************************************************************
97 
98  rcsidentstring = '$RCSfile: RFLU_PostProcessRegions.F90,v $ $Revision: 1.26 $'
99 
100  global => levels(1)%regions(1)%global
101 
102  CALL registerfunction(global,'RFLU_PostProcessRegions',&
103  'RFLU_PostProcessRegions.F90')
104 
105 ! ******************************************************************************
106 ! Open files
107 ! ******************************************************************************
108 
109  CALL rflu_openpostinfo(global,file_status_old,postinfofileexists)
110 
111 ! ******************************************************************************
112 ! Open files for plotting. NOTE for TECPLOT, initialize interface and need to
113 ! count number of plotting variables first.
114 ! ******************************************************************************
115 
116  SELECT CASE ( global%postOutputFormat )
117 #ifndef NO_TECPLOT
118  CASE ( post_output_format_tecplot )
119  CALL rflu_tec_init(global)
120 
121  IF ( global%nRegions == 1 ) THEN ! single region
122  pregion => levels(1)%regions(0)
123  ELSE
124  pregion => levels(1)%regions(1)
125  END IF ! global%nRegions
126 
127  CALL rflu_countplottingvars(pregion)
128  CALL rflu_createplottingvarmaps(pregion)
129  CALL rflu_buildplottingvarmaps(pregion)
130  CALL rflu_printplottingvarsinfo(pregion)
131 
132  CALL rflu_tec_openfilefield(pregion)
133 
134  CALL rflu_destroyplottingvarmaps(pregion)
135 
136  IF ( global%patchCoeffFlag .EQV. .true. ) THEN
137  CALL rflu_tec_openfilepatch(pregion)
138  END IF ! global%patchCoeffFlag
139 
140 #ifdef PLAG
141  IF ( global%plagUsed .EQV. .true. ) THEN
142  CALL rflu_tec_openfilepnt(pregion)
143  CALL rflu_tec_openfilepatchstats(pregion)
144  END IF ! global%plagUsed
145 #endif
146 #endif
147  CASE default
148  CALL errorstop(global,err_reached_default,__line__)
149  END SELECT ! global%postOutputFormat
150 
151 ! ******************************************************************************
152 ! Loop over regions
153 ! ******************************************************************************
154 
155  DO ireg = 1,global%nRegionsLocal
156  IF ( global%nRegions == 1 ) THEN ! single region
157  pregion => levels(1)%regions(0)
158  ELSE
159  pregion => levels(1)%regions(ireg)
160  END IF ! global%nRegions
161 
162  IF ( postinfofileexists .EQV. .true. ) THEN
163  CALL rflu_readpostinfo(pregion,infofile_readmode_flag)
164  END IF ! postInfoFileExists
165 
166 ! ==============================================================================
167 ! Check for activation status and write files
168 ! ==============================================================================
169 
170  IF ( pregion%postActiveFlag .EQV. .true. ) THEN
171  CALL rflu_postprocessregionscommon1(pregion,postinfofileexists)
172 
173  SELECT CASE ( global%postOutputFormat )
174 #ifndef NO_TECPLOT
175  CASE ( post_output_format_tecplot )
176  IF ( global%postPlotVolFlag .EQV. .true. ) THEN
177  CALL rflu_tec_builddatafieldvol(pregion)
178  CALL rflu_tec_writefilefieldvol(pregion)
179  CALL rflu_tec_destroydatafieldvol(pregion)
180  END IF ! global%postPlotVolFlag
181 
182  CALL rflu_setpatchplotflags(pregion)
183 
184  DO ipatch = 1,pregion%grid%nPatches
185  ppatch => pregion%patches(ipatch)
186 
187  IF ( ppatch%plotFlag .EQV. .true. ) THEN
188  CALL rflu_tec_builddatafieldsurf(pregion,ppatch)
189  CALL rflu_tec_writefilefieldsurf(pregion,ppatch)
190  CALL rflu_tec_destroydatafieldsurf(pregion,ppatch)
191  END IF ! pPatch%plotFlag
192  END DO ! iPatch
193 
194  IF ( global%patchCoeffFlag .EQV. .true. ) THEN
195  DO ipatch = 1,pregion%grid%nPatches
196  ppatch => pregion%patches(ipatch)
197 
198  CALL rflu_tec_builddatapatch(pregion,ppatch)
199  CALL rflu_tec_writefilepatch(pregion,ppatch)
200  CALL rflu_tec_destroydatapatch(pregion,ppatch)
201  END DO ! iPatch
202  END IF ! global%patchCoeffFlag
203 
204 #ifdef PLAG
205  IF ( global%plagUsed .EQV. .true. ) THEN
206  CALL rflu_tec_writefilepnt(pregion)
207 
208  DO ipatch = 1,pregion%grid%nPatches
209  ppatch => pregion%patches(ipatch)
210 
211  IF ( ppatch%plotStatsFlag .EQV. .true. ) THEN
212  CALL rflu_tec_builddatapatchstats(pregion,ppatch)
213  CALL rflu_tec_writefilepatch(pregion,ppatch)
214  CALL rflu_tec_destroydatapatch(pregion,ppatch)
215  END IF ! pPatch%plotStatsFlag
216  END DO ! iPatch
217  END IF ! global%plagUsed
218 #endif
219 #endif
220  CASE default
221  CALL errorstop(global,err_reached_default,__line__)
222  END SELECT ! global%postOutputFormat
223 
224  CALL rflu_postprocessregionscommon2(pregion)
225  END IF ! pRegion%postActiveFlag
226  END DO ! iReg
227 
228 ! ******************************************************************************
229 ! Close files
230 ! ******************************************************************************
231 
232  SELECT CASE ( global%postOutputFormat )
233 #ifndef NO_TECPLOT
234  CASE ( post_output_format_tecplot )
235  CALL rflu_tec_closefilefield(global)
236 
237  IF ( global%patchCoeffFlag .EQV. .true. ) THEN
238  CALL rflu_tec_closefilepatch(global)
239  END IF ! global%patchCoeffFlag
240 
241 #ifdef PLAG
242  IF ( global%plagUsed .EQV. .true. ) THEN
243  CALL rflu_tec_closefilepnt(global)
244  CALL rflu_tec_closefilepatchstats(global)
245  END IF ! global%plagUsed
246 #endif
247 #endif
248  CASE default
249  CALL errorstop(global,err_reached_default,__line__)
250  END SELECT ! global%postOutputFormat
251 
252  IF ( postinfofileexists .EQV. .true. ) THEN
253  CALL rflu_closepostinfo(global)
254  END IF ! postInfoFileExists
255 
256 ! ******************************************************************************
257 ! End
258 ! ******************************************************************************
259 
260  CALL deregisterfunction(global)
261 
262 END SUBROUTINE rflu_postprocessregions
263 
264 ! ******************************************************************************
265 !
266 ! RCS Revision history:
267 !
268 ! $Log: RFLU_PostProcessRegions.F90,v $
269 ! Revision 1.26 2008/12/06 08:45:06 mtcampbe
270 ! Updated license.
271 !
272 ! Revision 1.25 2008/11/19 22:18:17 mtcampbe
273 ! Added Illinois Open Source License/Copyright
274 !
275 ! Revision 1.24 2007/03/19 21:44:41 haselbac
276 ! Adapted to changes related to plotting variables
277 !
278 ! Revision 1.23 2006/04/07 15:19:26 haselbac
279 ! Removed tabs
280 !
281 ! Revision 1.22 2005/12/01 23:38:55 haselbac
282 ! Bug fix: Added IFs on plagUsed
283 !
284 ! Revision 1.21 2005/10/05 20:53:00 haselbac
285 ! Fixed missing module bugs
286 !
287 ! Revision 1.20 2005/10/05 20:22:40 haselbac
288 ! Partial rewrite as part of adding ENSIGHT
289 !
290 ! Revision 1.19 2005/10/05 16:20:11 haselbac
291 ! Bug fix: Added missing USE RFLU_ModStencilCells
292 !
293 ! Revision 1.18 2005/10/05 14:32:18 haselbac
294 ! Adapted to changes in stencil modules, added use of vertex list module
295 !
296 ! Revision 1.17 2005/09/23 19:02:51 haselbac
297 ! Added writing of patch stats files
298 !
299 ! Revision 1.16 2005/08/18 18:48:16 haselbac
300 ! Added postVortCoreFlag to IF statements
301 !
302 ! Revision 1.15 2005/08/10 00:36:13 haselbac
303 ! Adapted to changes in RFLU_ModPlottingVars
304 !
305 ! Revision 1.14 2005/08/09 01:10:49 haselbac
306 ! Added IFs for patch coeffs, writing serial files, plotting patches
307 !
308 ! Revision 1.13 2005/07/25 12:23:30 haselbac
309 ! Added vorticity plotting variables
310 !
311 ! Revision 1.12 2005/07/01 21:29:01 haselbac
312 ! Bug fix: Added counting of plotting vars before creating them
313 !
314 ! Revision 1.11 2005/05/31 16:44:58 haselbac
315 ! Enclosed point TEC routines within ifdef PLAG
316 !
317 ! Revision 1.10 2005/05/18 22:26:41 fnajjar
318 ! ACH: Adapted point files to multiple regions
319 !
320 ! Revision 1.9 2005/05/09 20:35:22 haselbac
321 ! Bug fix: Added calls for PLAG patch data back in
322 !
323 ! Revision 1.8 2005/05/03 20:39:34 haselbac
324 ! Only compute plotting vars if postDiscFlag is TRUE
325 !
326 ! Revision 1.7 2005/05/01 14:22:50 haselbac
327 ! Added postprocessing of plotting vars
328 !
329 ! Revision 1.6 2005/04/29 12:53:15 haselbac
330 ! Added calls to compute errors at probe locations
331 !
332 ! Revision 1.5 2005/04/15 15:08:35 haselbac
333 ! Changed call to RFLU_SetVars
334 !
335 ! Revision 1.4 2005/01/30 22:04:55 haselbac
336 ! Bug fix for no interpolation of data
337 !
338 ! Revision 1.3 2005/01/20 14:53:27 haselbac
339 ! Cosmetics only
340 !
341 ! Revision 1.2 2005/01/03 16:05:49 haselbac
342 ! Adapted to changes in RFLU_ModStencils
343 !
344 ! Revision 1.1 2004/12/29 20:58:54 haselbac
345 ! Initial revision
346 !
347 ! ******************************************************************************
348 
349 
350 
351 
352 
353 
354 
subroutine, public rflu_tec_destroydatapatch(pRegion, pPatch)
subroutine, public rflu_tec_destroydatafieldsurf(pRegion, pPatch)
subroutine rflu_destroygrid(pRegion)
subroutine, public rflu_tec_openfilefield(pRegion)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine, public rflu_tec_builddatafieldvol(pRegion)
subroutine, public rflu_tec_builddatapatchstats(pRegion, pPatch)
subroutine, public rflu_printplottingvarsinfo(pRegion)
subroutine, public rflu_tec_closefilepatch(global)
subroutine, public rflu_tec_init(global)
subroutine rflu_postprocessregionscommon1(pRegion, postInfoFileExists)
subroutine, public rflu_tec_openfilepnt(pRegion)
subroutine, public rflu_countplottingvars(pRegion)
subroutine rflu_setpatchplotflags(pRegion)
subroutine, public rflu_tec_writefilefieldvol(pRegion)
subroutine, public rflu_tec_writefilepatch(pRegion, pPatch)
subroutine rflu_postprocessregions(levels)
subroutine, public rflu_tec_closefilefield(global)
subroutine rflu_openpostinfo(global, fileStatus, fileExists)
subroutine rflu_closepostinfo(global)
subroutine, public rflu_tec_openfilepatch(pRegion)
subroutine, public rflu_tec_closefilepatchstats(global)
subroutine, public rflu_tec_destroydatafieldvol(pRegion)
subroutine, public rflu_tec_writefilefieldsurf(pRegion, pPatch)
subroutine, public rflu_tec_openfilepatchstats(pRegion)
subroutine, public rflu_tec_closefilepnt(global)
subroutine, public rflu_buildplottingvarmaps(pRegion)
subroutine, public rflu_tec_writefilepnt(pRegion)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine, public rflu_destroyplottingvarmaps(pRegion)
subroutine rflu_readpostinfo(pRegion, readMode)
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine, public rflu_createplottingvarmaps(pRegion)
subroutine, public rflu_tec_builddatafieldsurf(pRegion, pPatch)
subroutine, public rflu_tec_builddatapatch(pRegion, pPatch)
subroutine rflu_postprocessregionscommon2(pRegion)