Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ModStatsPost.F90
Go to the documentation of this file.
1 ! *********************************************************************
2 ! * Rocstar Simulation Suite *
3 ! * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4 ! * *
5 ! * Illinois Rocstar LLC *
6 ! * Champaign, IL *
7 ! * www.illinoisrocstar.com *
8 ! * sales@illinoisrocstar.com *
9 ! * *
10 ! * License: See LICENSE file in top level of distribution package or *
11 ! * http://opensource.org/licenses/NCSA *
12 ! *********************************************************************
13 ! *********************************************************************
14 ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15 ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16 ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17 ! * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18 ! * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19 ! * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20 ! * Arising FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21 ! * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22 ! *********************************************************************
23 ! ******************************************************************************
24 !
25 ! Purpose: Suite for statistics postprocessing routines.
26 !
27 ! Description: None.
28 !
29 ! Notes: None.
30 !
31 ! ******************************************************************************
32 !
33 ! $Id: ModStatsPost.F90,v 1.3 2008/12/06 08:44:19 mtcampbe Exp $
34 !
35 ! Copyright: (c) 2004 by the University of Illinois
36 !
37 ! ******************************************************************************
38 
40 
41  USE modglobal, ONLY: t_global
42  USE modparameters
43  USE moddatatypes
44  USE moderror
45  USE moddatastruct, ONLY: t_region
46  USE modgrid, ONLY: t_grid
47  USE modmpi
48 
49  IMPLICIT NONE
50 
51  PRIVATE
52 
53 #ifdef RFLU
54  PUBLIC :: stat_rflu_allocmempost, &
55  stat_rflu_allocmempostvert, &
56  stat_rflu_deallocmempost, &
57  stat_rflu_deallocmempostvert
58 
59 ! ******************************************************************************
60 ! Declarations and definitions
61 ! ******************************************************************************
62 
63  CHARACTER(CHRLEN) :: rcsidentstring = &
64  '$RCSfile: ModStatsPost.F90,v $ $Revision: 1.3 $'
65 
66 ! ******************************************************************************
67 ! Routines
68 ! ******************************************************************************
69 
70  CONTAINS
71 
72 
73 ! ******************************************************************************
74 !
75 ! Purpose: Allocate memory of statistics post quantities.
76 !
77 ! Description: None.
78 !
79 ! Input:
80 ! pRegion Region pointer
81 !
82 ! Output: None.
83 !
84 ! Notes: None.
85 !
86 ! ******************************************************************************
87 
88 SUBROUTINE stat_rflu_allocmempost(pRegion)
89 
90  IMPLICIT NONE
91 
92 ! ******************************************************************************
93 ! Definitions and declarations
94 ! ******************************************************************************
95 
96 ! ==============================================================================
97 ! Arguments
98 ! ==============================================================================
99 
100  TYPE(t_region), POINTER :: pregion
101 
102 ! ==============================================================================
103 ! Locals
104 ! ==============================================================================
105 
106  CHARACTER(CHRLEN) :: rcsidentstring
107  INTEGER :: nstat, errorflag
108  TYPE(t_grid), POINTER :: pgrid
109  TYPE(t_global), POINTER :: global
110 
111 ! ******************************************************************************
112 ! Start
113 ! ******************************************************************************
114 
115  global => pregion%global
116 
117  CALL registerfunction(global,'STAT_RFLU_AllocMemPost',&
118  'ModStatsPost.F90')
119 
120 ! ******************************************************************************
121 ! Set pointers and variables
122 ! ******************************************************************************
123 
124  pgrid => pregion%grid
125 
126 ! ******************************************************************************
127 ! Allocate memory
128 ! ******************************************************************************
129 
130 ! ==============================================================================
131 ! Mixture statistics
132 ! ==============================================================================
133 
134  nstat = global%mixtNStat
135  IF (nstat > 0) THEN
136  ALLOCATE(pregion%mixt%tav(nstat,pgrid%nCellsTot),stat=errorflag)
137  global%error = errorflag
138  IF (global%error /= err_none) THEN
139  CALL errorstop(global,err_allocate,__line__,'pRegion%mixt%tav')
140  END IF ! global%error
141  ENDIF
142 
143 #ifdef TURB
144 ! ==============================================================================
145 ! Turbulence statistics
146 ! ==============================================================================
147 
148  nstat = global%turbNStat
149  IF (nstat > 0) THEN
150  ALLOCATE(pregion%turb%tav(nstat,pgrid%nCellsTot),stat=errorflag)
151  global%error = errorflag
152  IF (global%error /= err_none) THEN
153  CALL errorstop(global,err_allocate,__line__,'pRegion%turb%tav')
154  END IF ! global%error
155  ENDIF
156 #endif
157 
158 ! ******************************************************************************
159 ! End
160 ! ******************************************************************************
161 
162  CALL deregisterfunction(global)
163 
164 END SUBROUTINE stat_rflu_allocmempost
165 
166 
167 
168 ! ******************************************************************************
169 !
170 ! Purpose: Deallocate memory of statistics post quantities.
171 !
172 ! Description: None.
173 !
174 ! Input:
175 ! pRegion Region pointer
176 !
177 ! Output: None.
178 !
179 ! Notes: None.
180 !
181 ! ******************************************************************************
182 
183 SUBROUTINE stat_rflu_deallocmempost(pRegion)
184 
185  IMPLICIT NONE
186 
187 ! ******************************************************************************
188 ! Definitions and declarations
189 ! ******************************************************************************
190 
191 ! ==============================================================================
192 ! Arguments
193 ! ==============================================================================
194 
195  TYPE(t_region), POINTER :: pregion
196 
197 ! ==============================================================================
198 ! Locals
199 ! ==============================================================================
200 
201  CHARACTER(CHRLEN) :: rcsidentstring
202  INTEGER :: nstat, errorflag
203  TYPE(t_global), POINTER :: global
204 
205 ! ******************************************************************************
206 ! Start
207 ! ******************************************************************************
208 
209  global => pregion%global
210 
211  CALL registerfunction(global,'STAT_RFLU_DeallocMemPost',&
212  'ModStatsPost.F90')
213 
214 ! ******************************************************************************
215 ! Set pointers and variables
216 ! ******************************************************************************
217 
218 ! ******************************************************************************
219 ! Deallocate memory
220 ! ******************************************************************************
221 
222 ! ==============================================================================
223 ! Mixture statistics
224 ! ==============================================================================
225 
226  nstat = global%mixtNStat
227  IF (nstat > 0) THEN
228  DEALLOCATE(pregion%mixt%tav,stat=errorflag)
229  global%error = errorflag
230  IF (global%error /= err_none) THEN
231  CALL errorstop(global,err_deallocate,__line__,'pRegion%mixt%tav')
232  END IF ! global%error
233  ENDIF
234 
235 #ifdef TURB
236 ! ==============================================================================
237 ! Turbulence statistics
238 ! ==============================================================================
239 
240  nstat = global%turbNStat
241  IF (nstat > 0) THEN
242  DEALLOCATE(pregion%turb%tav,stat=errorflag)
243  global%error = errorflag
244  IF (global%error /= err_none) THEN
245  CALL errorstop(global,err_deallocate,__line__,'pRegion%turb%tav')
246  END IF ! global%error
247  ENDIF
248 #endif
249 
250 ! ******************************************************************************
251 ! End
252 ! ******************************************************************************
253 
254  CALL deregisterfunction(global)
255 
256 END SUBROUTINE stat_rflu_deallocmempost
257 
258 
259 
260 ! ******************************************************************************
261 !
262 ! Purpose: Allocate memory to store interpolated statistics arrays at vertices.
263 !
264 ! Description: None.
265 !
266 ! Input:
267 ! pRegion Region pointer
268 !
269 ! Output: None.
270 !
271 ! Notes: None.
272 !
273 ! ******************************************************************************
274 
275 SUBROUTINE stat_rflu_allocmempostvert(pRegion)
276 
277  IMPLICIT NONE
278 
279 ! ******************************************************************************
280 ! Definitions and declarations
281 ! ******************************************************************************
282 
283 ! ==============================================================================
284 ! Arguments
285 ! ==============================================================================
286 
287  TYPE(t_region), POINTER :: pregion
288 
289 ! ==============================================================================
290 ! Locals
291 ! ==============================================================================
292 
293  CHARACTER(CHRLEN) :: rcsidentstring
294  INTEGER :: nstat, errorflag
295  TYPE(t_grid), POINTER :: pgrid
296  TYPE(t_global), POINTER :: global
297 
298 ! ******************************************************************************
299 ! Start
300 ! ******************************************************************************
301 
302  global => pregion%global
303 
304  CALL registerfunction(global,'STAT_RFLU_AllocMemPostVert',&
305  'ModStatsPost.F90')
306 
307 ! ******************************************************************************
308 ! Set pointers and variables
309 ! ******************************************************************************
310 
311  pgrid => pregion%grid
312 
313 ! ******************************************************************************
314 ! Allocate memory
315 ! ******************************************************************************
316 
317 ! ==============================================================================
318 ! Mixture statistics
319 ! ==============================================================================
320 
321  nstat = global%mixtNStat
322  IF (nstat > 0) THEN
323  ALLOCATE(pregion%mixt%tavVert(nstat,pgrid%nVertTot),stat=errorflag)
324  global%error = errorflag
325  IF (global%error /= err_none) THEN
326  CALL errorstop(global,err_allocate,__line__,'pRegion%mixt%tavVert')
327  END IF ! global%error
328  ENDIF
329 
330 #ifdef TURB
331 ! ==============================================================================
332 ! Turbulence statistics
333 ! ==============================================================================
334 
335  nstat = global%turbNStat
336  IF (nstat > 0) THEN
337  ALLOCATE(pregion%turb%tavVert(nstat,pgrid%nVertTot),stat=errorflag)
338  global%error = errorflag
339  IF (global%error /= err_none) THEN
340  CALL errorstop(global,err_allocate,__line__,'pRegion%turb%tavVert')
341  END IF ! global%error
342  ENDIF
343 #endif
344 
345 ! ******************************************************************************
346 ! End
347 ! ******************************************************************************
348 
349  CALL deregisterfunction(global)
350 
351 END SUBROUTINE stat_rflu_allocmempostvert
352 
353 
354 
355 ! ******************************************************************************
356 !
357 ! Purpose: Deallocate memory of statistics arrays at vertices.
358 !
359 ! Description: None.
360 !
361 ! Input:
362 ! pRegion Region pointer
363 !
364 ! Output: None.
365 !
366 ! Notes: None.
367 !
368 ! ******************************************************************************
369 
370 SUBROUTINE stat_rflu_deallocmempostvert(pRegion)
371 
372  IMPLICIT NONE
373 
374 ! ******************************************************************************
375 ! Definitions and declarations
376 ! ******************************************************************************
377 
378 ! ==============================================================================
379 ! Arguments
380 ! ==============================================================================
381 
382  TYPE(t_region), POINTER :: pregion
383 
384 ! ==============================================================================
385 ! Locals
386 ! ==============================================================================
387 
388  CHARACTER(CHRLEN) :: rcsidentstring
389  INTEGER :: nstat, errorflag
390  TYPE(t_global), POINTER :: global
391 
392 ! ******************************************************************************
393 ! Start
394 ! ******************************************************************************
395 
396  global => pregion%global
397 
398  CALL registerfunction(global,'STAT_RFLU_DeallocMemPostVert',&
399  'ModStatsPost.F90')
400 
401 ! ******************************************************************************
402 ! Set pointers and variables
403 ! ******************************************************************************
404 
405 ! ******************************************************************************
406 ! Deallocate memory
407 ! ******************************************************************************
408 
409 ! ==============================================================================
410 ! Mixture statistics
411 ! ==============================================================================
412 
413  nstat = global%mixtNStat
414  IF (nstat > 0) THEN
415  DEALLOCATE(pregion%mixt%tavVert,stat=errorflag)
416  global%error = errorflag
417  IF (global%error /= err_none) THEN
418  CALL errorstop(global,err_deallocate,__line__,'pRegion%mixt%tavVert')
419  END IF ! global%error
420  ENDIF
421 
422 #ifdef TURB
423 ! ==============================================================================
424 ! Turbulence statistics
425 ! ==============================================================================
426 
427  nstat = global%turbNStat
428  IF (nstat > 0) THEN
429  DEALLOCATE(pregion%turb%tavVert,stat=errorflag)
430  global%error = errorflag
431  IF (global%error /= err_none) THEN
432  CALL errorstop(global,err_deallocate,__line__,'pRegion%turb%tavVert')
433  END IF ! global%error
434  ENDIF
435 #endif
436 
437 ! ******************************************************************************
438 ! End
439 ! ******************************************************************************
440 
441  CALL deregisterfunction(global)
442 
443 END SUBROUTINE stat_rflu_deallocmempostvert
444 
445 
446 ! ******************************************************************************
447 ! End
448 ! ******************************************************************************
449 #endif
450 
451 END MODULE modstatspost
452 
453 ! ******************************************************************************
454 !
455 ! RCS Revision history:
456 !
457 ! $Log: ModStatsPost.F90,v $
458 ! Revision 1.3 2008/12/06 08:44:19 mtcampbe
459 ! Updated license.
460 !
461 ! Revision 1.2 2008/11/19 22:17:30 mtcampbe
462 ! Added Illinois Open Source License/Copyright
463 !
464 ! Revision 1.1 2006/01/12 09:51:49 wasistho
465 ! initial import
466 !
467 !
468 !
469 ! ******************************************************************************
470 
471 
472 
473 
474 
475 
476 
477 
478 
479 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469