Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PLAG_ModStats.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 for particle statistics on Eulerian grid.
26 !
27 ! Description: None.
28 !
29 ! Notes: None.
30 !
31 ! ******************************************************************************
32 !
33 ! $Id: PLAG_ModStats.F90,v 1.4 2008/12/06 08:44:34 mtcampbe Exp $
34 !
35 ! Copyright: (c) 2005 by the University of Illinois
36 !
37 ! ******************************************************************************
38 
40 
41  USE modparameters
42  USE moddatatypes
43  USE modglobal, ONLY: t_global
44  USE modgrid, ONLY: t_grid
45  USE modpartlag, ONLY: t_plag
46  USE moddatastruct, ONLY: t_region
47  USE moderror
48  USE modmpi
50 
51 #ifdef RFLO
52 #include "Indexing.h"
53  USE modinterfaces, ONLY: rflo_getcelloffset, &
55 #endif
56 
58 
59  IMPLICIT NONE
60 
61 ! ******************************************************************************
62 ! Definitions and declarations
63 ! ******************************************************************************
64 
65 ! ==============================================================================
66 ! Private data
67 ! ==============================================================================
68 
69  CHARACTER(CHRLEN), PRIVATE :: &
70  RCSIdentString = '$RCSfile: PLAG_ModStats.F90,v $ $Revision: 1.4 $'
71 
72 ! ==============================================================================
73 ! Public functions
74 ! ==============================================================================
75 
76  PUBLIC :: plag_createstat, &
79 
80 ! ==============================================================================
81 ! Private functions
82 ! ==============================================================================
83 
84 ! PRIVATE ::
85 
86 ! ******************************************************************************
87 ! Routines
88 ! ******************************************************************************
89 
90  CONTAINS
91 
92 
93 
94 
95 
96 
97 
98 
99 
100 
101 
102 
103 
104 
105 
106 
107 
108 ! *******************************************************************************
109 !
110 ! Purpose: Create statistics.
111 !
112 ! Description: None.
113 !
114 ! Input:
115 ! pRegion Pointer to region
116 ! pPlag Pointer to plag
117 !
118 ! Output: None.
119 !
120 ! Notes: None.
121 !
122 ! ******************************************************************************
123 
124  SUBROUTINE plag_createstat(pRegion,pPlag)
125 
126  IMPLICIT NONE
127 
128 ! ******************************************************************************
129 ! Declarations and definitions
130 ! ******************************************************************************
131 
132 ! ==============================================================================
133 ! Arguments
134 ! ==============================================================================
135 
136 #ifdef RFLO
137  TYPE(t_region) :: pregion
138 #endif
139 
140 #ifdef RFLU
141  TYPE(t_region), POINTER :: pregion
142 #endif
143 
144  TYPE(t_plag), POINTER :: pplag
145 
146 ! ==============================================================================
147 ! Locals
148 ! ==============================================================================
149 
150 #ifdef RFLO
151  INTEGER :: idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend
152  INTEGER :: ilev,icelloffset, ijcelloffset
153 #endif
154 
155  INTEGER :: errorflag,ibc,iec,ntav
156  TYPE(t_global), POINTER :: global
157  TYPE(t_grid), POINTER :: pgrid
158 
159 ! ******************************************************************************
160 ! Start, set pointers and variables
161 ! ******************************************************************************
162 
163  global => pregion%global
164 
165  CALL registerfunction(global,'PLAG_CreateStat',&
166  'PLAG_ModStats.F90')
167 
168  ntav =global%plagNStat
169 
170 #ifdef RFLO
171  ilev = pregion%currLevel
172  pgrid => pregion%levels(ilev)%grid
173 
174  CALL rflo_getdimensdummy( pregion,ilev,idcbeg,idcend, &
175  jdcbeg,jdcend,kdcbeg,kdcend )
176  CALL rflo_getcelloffset( pregion,ilev,icelloffset,ijcelloffset )
177  ibc = indijk(idcbeg,jdcbeg,kdcbeg,icelloffset,ijcelloffset)
178  iec = indijk(idcend,jdcend,kdcend,icelloffset,ijcelloffset)
179 #endif
180 
181 #ifdef RFLU
182  pgrid => pregion%grid
183  ibc = 1
184  iec = pgrid%nCells
185 #endif
186 
187 ! ******************************************************************************
188 ! Allocate memory
189 ! ******************************************************************************
190 
191  ALLOCATE(pplag%tav(ntav,ibc:iec),stat=errorflag)
192  global%error = errorflag
193  IF ( global%error /= err_none ) THEN
194  CALL errorstop(global,err_allocate,__line__,'pPlag%tav')
195  END IF ! global%error
196 
197 ! ******************************************************************************
198 ! End
199 ! ******************************************************************************
200 
201  CALL deregisterfunction(global)
202 
203  END SUBROUTINE plag_createstat
204 
205 
206 
207 
208 
209 
210 ! *******************************************************************************
211 !
212 ! Purpose: Destroy statistics.
213 !
214 ! Description: None.
215 !
216 ! Input:
217 ! pRegion Pointer to region
218 ! pPlag Pointer to plag
219 !
220 ! Output: None.
221 !
222 ! Notes: None.
223 !
224 ! ******************************************************************************
225 
226  SUBROUTINE plag_destroystat(pRegion,pPlag)
227 
228  IMPLICIT NONE
229 
230 ! ******************************************************************************
231 ! Declarations and definitions
232 ! ******************************************************************************
233 
234 ! ==============================================================================
235 ! Arguments
236 ! ==============================================================================
237 
238 #ifdef RFLO
239  TYPE(t_region) :: pregion
240 #endif
241 
242 #ifdef RFLU
243  TYPE(t_region), POINTER :: pregion
244 #endif
245 
246  TYPE(t_plag), POINTER :: pplag
247 
248 ! ==============================================================================
249 ! Locals
250 ! ==============================================================================
251 
252  INTEGER :: errorflag
253  TYPE(t_global), POINTER :: global
254 
255 ! ******************************************************************************
256 ! Start, set pointers and variables
257 ! ******************************************************************************
258 
259  global => pregion%global
260 
261  CALL registerfunction(global,'PLAG_DestroyStat',&
262  'PLAG_ModStats.F90')
263 
264 ! ******************************************************************************
265 ! Deallocate memory
266 ! ******************************************************************************
267 
268  DEALLOCATE(pplag%tav,stat=errorflag)
269  global%error = errorflag
270  IF ( global%error /= err_none ) THEN
271  CALL errorstop(global,err_deallocate,__line__,'pPlag%tav')
272  END IF ! global%error
273 
274 ! ******************************************************************************
275 ! Nullify memory
276 ! ******************************************************************************
277 
278  nullify(pplag%tav)
279 
280 ! ******************************************************************************
281 ! End
282 ! ******************************************************************************
283 
284  CALL deregisterfunction(global)
285 
286  END SUBROUTINE plag_destroystat
287 
288 
289 
290 
291 
292 ! *******************************************************************************
293 !
294 ! Purpose: Initialize statistics.
295 !
296 ! Description: None.
297 !
298 ! Input:
299 ! pRegion Pointer to region
300 ! pPlag Pointer to plag
301 !
302 ! Output: None.
303 !
304 ! Notes: None.
305 !
306 ! ******************************************************************************
307 
308  SUBROUTINE plag_initstat(pRegion,pPlag)
309 
310  IMPLICIT NONE
311 
312 ! ******************************************************************************
313 ! Declarations and definitions
314 ! ******************************************************************************
315 
316 ! ==============================================================================
317 ! Arguments
318 ! ==============================================================================
319 
320 #ifdef RFLO
321  TYPE(t_region) :: pregion
322 #endif
323 
324 #ifdef RFLU
325  TYPE(t_region), POINTER :: pregion
326 #endif
327 
328  TYPE(t_plag), POINTER :: pplag
329 
330 ! ==============================================================================
331 ! Locals
332 ! ==============================================================================
333 
334 #ifdef RFLO
335  INTEGER :: idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend
336  INTEGER :: ilev,icelloffset, ijcelloffset
337 #endif
338 
339  INTEGER :: errorflag,ibc,iec,icell,ivar,nvars
340  TYPE(t_global), POINTER :: global
341  TYPE(t_grid), POINTER :: pgrid
342 
343 ! ******************************************************************************
344 ! Start, set pointers and variables
345 ! ******************************************************************************
346 
347  global => pregion%global
348 
349  CALL registerfunction(global,'PLAG_InitStat',&
350  'PLAG_ModStats.F90')
351 
352  nvars = global%plagNStat
353 
354 #ifdef RFLO
355  ilev = pregion%currLevel
356  pgrid => pregion%levels(ilev)%grid
357 
358  CALL rflo_getdimensdummy( pregion,ilev,idcbeg,idcend, &
359  jdcbeg,jdcend,kdcbeg,kdcend )
360  CALL rflo_getcelloffset( pregion,ilev,icelloffset,ijcelloffset )
361  ibc = indijk(idcbeg,jdcbeg,kdcbeg,icelloffset,ijcelloffset)
362  iec = indijk(idcend,jdcend,kdcend,icelloffset,ijcelloffset)
363 #endif
364 
365 #ifdef RFLU
366  pgrid => pregion%grid
367  ibc = 1
368  iec = pgrid%nCells
369 #endif
370 
371 ! ******************************************************************************
372 ! Initialize memory
373 ! ******************************************************************************
374 
375  DO icell = ibc,iec
376  DO ivar = 1, nvars
377  pplag%tav(ivar,icell) = 0.0_rfreal
378  END DO ! iVar
379  END DO ! iCell
380 
381 ! ******************************************************************************
382 ! End
383 ! ******************************************************************************
384 
385  CALL deregisterfunction(global)
386 
387  END SUBROUTINE plag_initstat
388 
389 
390 
391 
392 
393 
394 
395 
396 END MODULE plag_modstats
397 
398 ! ******************************************************************************
399 !
400 ! RCS Revision history:
401 !
402 ! $Log: PLAG_ModStats.F90,v $
403 ! Revision 1.4 2008/12/06 08:44:34 mtcampbe
404 ! Updated license.
405 !
406 ! Revision 1.3 2008/11/19 22:17:47 mtcampbe
407 ! Added Illinois Open Source License/Copyright
408 !
409 ! Revision 1.2 2006/04/07 15:19:23 haselbac
410 ! Removed tabs
411 !
412 ! Revision 1.1 2005/01/08 20:44:32 fnajjar
413 ! Initial import for PLAG statistics
414 !
415 ! ******************************************************************************
416 
417 
418 
419 
420 
421 
422 
423 
424 
**********************************************************************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
subroutine, public plag_createstat(pRegion, pPlag)
subroutine, public plag_calceulerianfield(pRegion)
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
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
**********************************************************************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 icell
subroutine, public plag_initstat(pRegion, pPlag)
**********************************************************************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
**********************************************************************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, public plag_destroystat(pRegion, pPlag)
subroutine deregisterfunction(global)
Definition: ModError.F90:469