Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_StatCCollector.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: Collect cell variables of interest to be time averaged for check or
26 ! comparison
27 !
28 ! Description: As a generic routine, number and kind of collected variables
29 ! are not specified. The cell values are accumulated in time.
30 !
31 ! Input: region = data of current region
32 ! iBegSv = begin index of averaged field sv
33 ! iEndSv = end index of averaged field sv
34 ! colVar = array of collected variables
35 !
36 ! Output: turb%st(iBegSv:iEndSv,:) at cell centers including dummy cells.
37 !
38 ! Notes: none.
39 !
40 !******************************************************************************
41 !
42 ! $Id: TURB_StatCCollector.F90,v 1.3 2008/12/06 08:44:42 mtcampbe Exp $
43 !
44 ! Copyright: (c) 2001 by the University of Illinois
45 !
46 !******************************************************************************
47 
48 SUBROUTINE turb_statccollector( region,iBegSt,iEndSt,colVar )
49 
50  USE moddatatypes
51  USE moddatastruct, ONLY : t_region
52  USE modglobal, ONLY : t_global
53 #ifdef RFLO
54  USE modinterfaces, ONLY : rflo_getdimensdummy, &
56 
57 #include "Indexing.h"
58 #endif
59  USE moderror
60  USE modparameters
62  IMPLICIT NONE
63 
64 ! ... parameters
65  TYPE(t_region) :: region
66  INTEGER :: ibegst, iendst
67  REAL(RFREAL), POINTER :: colvar(:,:)
68 
69 ! ... loop variables
70  INTEGER :: i, j, k, l, m
71 
72 ! ... local variables
73  CHARACTER(CHRLEN) :: rcsidentstring
74  TYPE(t_global), POINTER :: global
75 
76  INTEGER :: ijkc
77  REAL(RFREAL), POINTER :: st(:,:)
78 
79 #ifdef RFLO
80  INTEGER :: idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend
81  INTEGER :: ilev,icoff,ijcoff
82 #endif
83 
84 !******************************************************************************
85 
86  rcsidentstring = '$RCSfile: TURB_StatCCollector.F90,v $'
87 
88  global => region%global
89  CALL registerfunction( global,'Turb_StatCCollector',&
90  'TURB_StatCCollector.F90' )
91 
92 ! check some input arguments --------------------------------------------------
93 
94  IF (iendst > region%turbInput%nSt) THEN
95  CALL errorstop( global,err_turb_statsinput,__line__, &
96  'index of collected vars larger than nSt (allocated nmbr stats vars)' )
97  ENDIF
98  IF (ibegst > iendst) THEN
99  CALL errorstop( global,err_turb_statsinput,__line__, &
100  'begin index of collected vars larger than end index' )
101  ENDIF
102 
103 #ifdef RFLO
104 ! get parameters --------------------------------------------------------
105 
106  ilev = region%currLevel
107 
108 ! get dimensions and pointers
109 
110  CALL rflo_getdimensdummy( region,ilev,idcbeg,idcend, &
111  jdcbeg,jdcend,kdcbeg,kdcend )
112  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
113 
114  st => region%levels(ilev)%turb%st
115 
116 ! interpolate from face to cell
117 
118  DO k=kdcbeg,kdcend
119  DO j=jdcbeg,jdcend
120  DO i=idcbeg,idcend
121 
122  ijkc = indijk(i ,j ,k ,icoff,ijcoff)
123 
124  DO l=ibegst,iendst
125  m = l - ibegst + 1
126  st(l,ijkc) = st(l,ijkc)+colvar(m,ijkc)
127  ENDDO
128 
129  ENDDO ! i
130  ENDDO ! j
131  ENDDO ! k
132 #endif
133 #ifdef RFLU
134 ! get dimensions and pointers ------------------------------------------
135 
136  st => region%turb%st
137  st = 0._rfreal
138 
139  DO ijkc=1,region%grid%nCells
140 
141 ! - region (here denoted as 'global') to local (type) mapping
142 
143  DO l=ibegst,iendst
144  m = l - ibegst + 1
145  st(l,ijkc) = st(l,ijkc)+colvar(m,ijkc)
146  ENDDO ! l
147  ENDDO ! ijkC
148 #endif
149 
150 ! finalize --------------------------------------------------------------------
151 
152  CALL deregisterfunction( global )
153 
154 END SUBROUTINE turb_statccollector
155 
156 !******************************************************************************
157 !
158 ! RCS Revision history:
159 !
160 ! $Log: TURB_StatCCollector.F90,v $
161 ! Revision 1.3 2008/12/06 08:44:42 mtcampbe
162 ! Updated license.
163 !
164 ! Revision 1.2 2008/11/19 22:17:54 mtcampbe
165 ! Added Illinois Open Source License/Copyright
166 !
167 ! Revision 1.1 2004/10/22 23:22:18 wasistho
168 ! added statistics collector based on cell centered variables
169 !
170 !
171 !******************************************************************************
172 
173 
174 
175 
176 
177 
178 
FT m(int i, int j) const
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE idcend
j indices k indices k
Definition: Indexing.h:6
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflo_getdimensdummy(region, iLev, idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE kdcbeg
blockLoc i
Definition: read.cpp:79
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE idcbeg
subroutine turb_statccollector(region, iBegSt, iEndSt, colVar)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE jdcend
j indices j
Definition: Indexing.h:6
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE jdcbeg
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469