Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
STAT_RFLU_ModGenxAdmin.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: Collection of routines related to GENX interaction.
26 !
27 ! Description: None
28 !
29 ! Notes: None.
30 !
31 ! ******************************************************************************
32 !
33 ! $Id: STAT_RFLU_ModRocstarAdmin.F90,v 1.8 2008/12/06 08:44:01 mtcampbe Exp $
34 !
35 ! Copyright: (c) 2004-2005 by the University of Illinois
36 !
37 ! ******************************************************************************
38 
40 
41  USE moddatatypes
42  USE modparameters
43  USE moderror
44  USE modglobal, ONLY: t_global
45  USE modbndpatch, ONLY: t_patch
46  USE moddatastruct, ONLY: t_region
47  USE modgrid, ONLY: t_grid
48  USE modmpi
49 
51 
52  IMPLICIT NONE
53 
54  include 'roccomf90.h'
55 
56  PRIVATE
57 
58  PUBLIC :: stat_rflu_genxcreateattr, &
61 
62 ! ******************************************************************************
63 ! Declarations and definitions
64 ! ******************************************************************************
65 
66 ! ==============================================================================
67 ! Private
68 ! ==============================================================================
69 
70  CHARACTER(CHRLEN) :: &
71  RCSIdentString = '$RCSfile: STAT_RFLU_ModRocstarAdmin.F90,v $ $Revision: 1.8 $'
72 
73 ! ==============================================================================
74 ! Public
75 ! ==============================================================================
76 
77 
78 ! ******************************************************************************
79 ! Contained routines
80 ! ******************************************************************************
81 
82  CONTAINS
83 
84 
85 
86 ! ******************************************************************************
87 !
88 ! Purpose: Create new attributes for time-averaged statistics.
89 !
90 ! Description: None.
91 !
92 ! Input:
93 ! pRegion Pointer to region
94 !
95 ! Output: None.
96 !
97 ! Notes: None.
98 !
99 ! ******************************************************************************
100 
101  SUBROUTINE stat_rflu_genxcreateattr(pRegion)
102 
103  IMPLICIT NONE
104 
105 ! ******************************************************************************
106 ! Declarations and definitions
107 ! ******************************************************************************
108 
109 ! ==============================================================================
110 ! Arguments
111 ! ==============================================================================
112 
113  TYPE(t_region), POINTER :: pregion
114 
115 ! ==============================================================================
116 ! Loop
117 ! ==============================================================================
118  INTEGER :: istat
119 
120 ! ==============================================================================
121 ! Locals
122 ! ==============================================================================
123 
124  CHARACTER(CHRLEN) :: winv
125  CHARACTER(CHRLEN), POINTER :: statnm(:,:,:)
126  TYPE(t_global), POINTER :: global
127 
128 ! ******************************************************************************
129 ! Start, set pointers
130 ! ******************************************************************************
131 
132  global => pregion%global
133 
134 ! ******************************************************************************
135 ! End
136 ! ******************************************************************************
137 
138  END SUBROUTINE stat_rflu_genxcreateattr
139 
140 
141 
142 
143 
144 
145 
146 ! ******************************************************************************
147 !
148 ! Purpose: Register statistics data.
149 !
150 ! Description: None.
151 !
152 ! Input:
153 ! pRegion Pointer to region
154 !
155 ! Output: None.
156 !
157 ! Notes: None.
158 !
159 ! ******************************************************************************
160 
161  SUBROUTINE stat_rflu_genxregisterdata(pRegion)
162 
163  IMPLICIT NONE
164 
165 ! ******************************************************************************
166 ! Declarations and definitions
167 ! ******************************************************************************
168 
169 ! ==============================================================================
170 ! Arguments
171 ! ==============================================================================
172 
173  TYPE(t_region), POINTER :: pregion
174 
175 ! ==============================================================================
176 ! Loop
177 ! ==============================================================================
178  INTEGER :: istat
179 
180 ! ==============================================================================
181 ! Locals
182 ! ==============================================================================
183 
184  CHARACTER(CHRLEN) :: winv
185  CHARACTER(CHRLEN), POINTER :: statnm(:,:,:)
186  INTEGER :: paneid, ilb
187  TYPE(t_global), POINTER :: global
188 
189 ! ******************************************************************************
190 ! Start, set pointers
191 ! ******************************************************************************
192 
193  global => pregion%global
194 
195  IF ( global%myProcid == masterproc .AND. &
196  global%verbLevel >= verbose_high ) THEN
197  WRITE(stdout,'(A,1X,A)') solver_name,'Registering statistics data...'
198  END IF ! global%verbLevel
199 
200 ! ******************************************************************************
201 ! Create new attributes
202 ! ******************************************************************************
203 
204 ! ==============================================================================
205 ! Volume
206 ! ==============================================================================
207 
208  winv = global%volWinName
209  IF ((global%flowType == flow_unsteady).AND.(global%doStat == active)) THEN
210 
211 ! ------------------------------------------------------------------------------
212 ! Global
213 ! ------------------------------------------------------------------------------
214  CALL com_new_attribute( trim(winv)//'.tStat','w',com_double,1,'s' )
215  CALL com_set_array( trim(winv)//'.tStat',0, global%integrTime )
216 
217 ! ------------------------------------------------------------------------------
218 ! Mixture
219 ! ------------------------------------------------------------------------------
220  IF (global%mixtNStat > 0) THEN
221  statnm => global%mixtStatNm
222  DO istat=1,global%mixtNStat
223  CALL com_new_attribute( trim(winv)//'.'//trim(statnm(1,1,istat)),'e',&
224  com_double,1,trim(statnm(1,2,istat)) )
225  ENDDO
226  ENDIF
227 
228 #ifdef TURB
229  IF ((global%turbActive .EQV. .true.) .AND. (global%turbNStat > 0)) THEN
230  statnm => global%turbStatNm
231  DO istat=1,global%turbNStat
232  CALL com_new_attribute( trim(winv)//'.'//trim(statnm(1,1,istat)),'e',&
233  com_double,1,trim(statnm(1,2,istat)) )
234  ENDDO
235  ENDIF ! turbNStat
236 #endif
237  ENDIF ! unsteady and dostat
238 
239 
240 ! ******************************************************************************
241 ! Register data
242 ! ******************************************************************************
243 
244 ! ==============================================================================
245 ! Volume
246 ! ==============================================================================
247 
248  winv = global%volWinName
249 
250  CALL rflu_genx_buildpaneid(pregion%iRegionGlobal,0,paneid)
251 
252  IF ( global%myProcid == masterproc .AND. &
253  global%verbLevel >= verbose_high) THEN
254  WRITE(stdout,'(A,3X,A,1X,A)') solver_name,'Window name:',trim(winv)
255  WRITE(stdout,'(A,3X,A,1X,I5.5)') solver_name,'Pane id:', paneid
256  END IF ! global%verbLevel
257 
258  IF ((global%flowType==flow_unsteady) .AND. (global%doStat==active)) THEN
259  ilb = 1
260 ! ------------------------------------------------------------------------------
261 ! Mixture statistics
262 ! ------------------------------------------------------------------------------
263  IF (global%mixtNStat > 0) THEN
264  statnm => global%mixtStatNm
265  DO istat=1,global%mixtNStat
266  CALL com_set_array( trim(winv)//'.'//trim(statnm(1,1,istat)),paneid,&
267  pregion%mixt%tav(istat,ilb), global%mixtNStat)
268  ENDDO
269  ENDIF ! mixtNStat
270 
271 ! ------------------------------------------------------------------------------
272 ! Turbulence statistics
273 ! ------------------------------------------------------------------------------
274 #ifdef TURB
275  IF ((global%turbActive .EQV. .true.) .AND. (global%turbNStat > 0)) THEN
276  statnm => global%turbStatNm
277  DO istat=1,global%turbNStat
278  CALL com_set_array( trim(winv)//'.'//trim(statnm(1,1,istat)),paneid,&
279  pregion%turb%tav(istat,ilb), global%turbNStat)
280  ENDDO
281  ENDIF ! turbNStat
282 #endif
283  ENDIF ! flowType and doStat
284 
285 ! ******************************************************************************
286 ! End
287 ! ******************************************************************************
288 
289  IF ( global%myProcid == masterproc .AND. &
290  global%verbLevel >= verbose_high ) THEN
291  WRITE(stdout,'(A,1X,A)') solver_name,'Registering statistics data done.'
292  END IF ! global%verbLevel
293 
294  END SUBROUTINE stat_rflu_genxregisterdata
295 
296 
297 
298 
299 
300 
301 
302 
303 ! ******************************************************************************
304 !
305 ! Purpose: Get statistics data through Roccom.
306 !
307 ! Description: None.
308 !
309 ! Input:
310 ! pRegion Pointer to region
311 !
312 ! Output: None.
313 !
314 ! Notes: None.
315 !
316 ! ******************************************************************************
317 
318  SUBROUTINE stat_rflu_genxgetdata(pRegion)
319 
320  IMPLICIT NONE
321 
322 ! ******************************************************************************
323 ! Declarations and definitions
324 ! ******************************************************************************
325 
326 ! ==============================================================================
327 ! Arguments
328 ! ==============================================================================
329 
330  TYPE(t_region), POINTER :: pregion
331 
332 ! ==============================================================================
333 ! Loop
334 ! ==============================================================================
335  INTEGER :: istat
336 
337 ! ==============================================================================
338 ! Locals
339 ! ==============================================================================
340 
341  CHARACTER(CHRLEN) :: winname,winnamein
342  CHARACTER(CHRLEN), POINTER :: statnm(:,:,:)
343  INTEGER :: handlein,handleobtain,handleout
344  TYPE(t_global), POINTER :: global
345  TYPE(t_grid), POINTER :: pgrid
346 
347 ! ******************************************************************************
348 ! Start, set pointers and variables
349 ! ******************************************************************************
350 
351  global => pregion%global
352 
353  handleobtain = global%handleObtain
354 
355  IF ( global%myProcid == masterproc .AND. &
356  global%verbLevel >= verbose_high ) THEN
357  WRITE(stdout,'(A,1X,A)') solver_name,'Getting statistics data...'
358  END IF ! global%verbLevel
359 
360  IF ( global%myProcid == masterproc .AND. &
361  global%verbLevel >= verbose_high) THEN
362  WRITE(stdout,'(A,3X,A,1X,I5.5)') solver_name,'Global region:', &
363  pregion%iRegionGlobal
364  END IF ! global%myProcid
365 
366 ! ******************************************************************************
367 ! Get data
368 ! ******************************************************************************
369 
370  winnamein = global%volWinNameInput
371  winname = global%volWinName
372 
373 ! ==============================================================================
374 ! Global
375 ! ==============================================================================
376 
377  handlein = com_get_attribute_handle_const(trim(winnamein)//'.tStat')
378  handleout = com_get_attribute_handle(trim(winname)//'.tStat')
379  CALL com_call_function(handleobtain,2,handlein,handleout)
380 
381 ! ==============================================================================
382 ! Statistics variables
383 ! ==============================================================================
384 
385 ! ------------------------------------------------------------------------------
386 ! Mixture statistics
387 ! ------------------------------------------------------------------------------
388 
389  IF (global%mixtNStat > 0) THEN
390  statnm => global%mixtStatNm
391  DO istat=1,global%mixtNStat
392 
393  handlein = com_get_attribute_handle_const(trim(winnamein)//'.'// &
394  trim(statnm(1,1,istat)))
395  handleout = com_get_attribute_handle(trim(winname)//'.'// &
396  trim(statnm(1,1,istat)))
397  CALL com_call_function(handleobtain,2,handlein,handleout)
398 
399  ENDDO
400  ENDIF ! mixtNStat
401 
402 
403 ! ------------------------------------------------------------------------------
404 ! Turbulence statistics
405 ! ------------------------------------------------------------------------------
406 
407 #ifdef TURB
408  IF (global%turbNStat > 0) THEN
409  statnm => global%turbStatNm
410  DO istat=1,global%turbNStat
411 
412  handlein = com_get_attribute_handle_const(trim(winnamein)//'.'// &
413  trim(statnm(1,1,istat)))
414  handleout = com_get_attribute_handle(trim(winname)//'.'// &
415  trim(statnm(1,1,istat)))
416  CALL com_call_function(handleobtain,2,handlein,handleout)
417 
418  ENDDO
419  ENDIF ! turbNStat
420 #endif
421 
422 ! ==============================================================================
423 ! Set variables back to accumulated mode
424 ! ==============================================================================
425 
426 ! ------------------------------------------------------------------------------
427 ! Mixture statistics
428 ! ------------------------------------------------------------------------------
429 
430  IF (global%mixtNStat > 0) THEN
431  DO istat=1,global%mixtNStat
432  pregion%mixt%tav(istat,:) = &
433  pregion%mixt%tav(istat,:)*global%integrTime
434  ENDDO
435  ENDIF ! mixtNstat
436 
437 ! ------------------------------------------------------------------------------
438 ! Turbulence statistics
439 ! ------------------------------------------------------------------------------
440 
441 #ifdef TURB
442  IF ((global%turbActive .EQV. .true.) .AND. (global%turbNStat > 0)) THEN
443  DO istat=1,global%turbNStat
444  pregion%turb%tav(istat,:) = &
445  pregion%turb%tav(istat,:)*global%integrTime
446  ENDDO
447  ENDIF ! turbNstat
448 #endif
449 
450 ! ******************************************************************************
451 ! End
452 ! ******************************************************************************
453 
454  IF ( global%myProcid == masterproc .AND. &
455  global%verbLevel >= verbose_high ) THEN
456  WRITE(stdout,'(A,1X,A)') solver_name,'Getting statistics data done.'
457  END IF ! global%verbLevel
458 
459  END SUBROUTINE stat_rflu_genxgetdata
460 
461 
462 
463 
464 
465 
466 ! ******************************************************************************
467 ! End Module
468 ! ******************************************************************************
469 
470 
471 
472 
473 END MODULE stat_rflu_modrocstaradmin
474 
475 ! ******************************************************************************
476 !
477 ! RCS Revision history:
478 !
479 ! $Log: STAT_RFLU_ModRocstarAdmin.F90,v $
480 ! Revision 1.8 2008/12/06 08:44:01 mtcampbe
481 ! Updated license.
482 !
483 ! Revision 1.7 2008/11/19 22:17:15 mtcampbe
484 ! Added Illinois Open Source License/Copyright
485 !
486 ! Revision 1.6 2006/02/05 03:46:00 wasistho
487 ! added global%turbActive
488 !
489 ! Revision 1.5 2006/01/10 06:32:39 wasistho
490 ! mixt%tav to turb%tav within turb stats
491 !
492 ! Revision 1.4 2006/01/10 05:00:15 wasistho
493 ! added GenxGetData
494 !
495 ! Revision 1.3 2006/01/04 20:06:13 wasistho
496 ! modified data registration
497 !
498 ! Revision 1.2 2006/01/03 09:51:43 wasistho
499 ! get rid of ifdef rflu
500 !
501 ! Revision 1.1 2006/01/03 06:34:41 wasistho
502 ! initial import
503 !
504 !
505 ! ******************************************************************************
506 
507 
508 
509 
510 
511 
subroutine, public stat_rflu_genxregisterdata(pRegion)
subroutine, public stat_rflu_genxgetdata(pRegion)
subroutine, public stat_rflu_genxcreateattr(pRegion)
subroutine, public rflu_genx_buildpaneid(iRegion, iPatch, paneId)