Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PLAG_StatMapping.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: mapping from PLAG ID to statistics ID
26 !
27 ! Description: mapping based on parameter plagStatId(:,:) input by user
28 !
29 ! Input: global%plagStatId : PLAG statistics ID from user input
30 !
31 ! Output: global%plagStatCode : mapped PLAG statistics ID
32 !
33 ! Notes:
34 ! 1. To access composition add to EV_PLAG_MASS values of 1 and 2.
35 ! Statistics can only performed on a droplet with two consistuents.
36 !
37 !******************************************************************************
38 !
39 ! $Id: PLAG_StatMapping.F90,v 1.4 2008/12/06 08:44:36 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2004 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE plag_statmapping( global ) ! PUBLIC
46 
47  USE moddatatypes
48  USE modglobal, ONLY : t_global
49 #ifdef GENX
51 #endif
52  USE moderror
53  USE modparameters
55  IMPLICIT NONE
56 
57 ! ... parameters
58  TYPE(t_global), POINTER :: global
59 
60 ! ... loop variables
61  INTEGER :: l, n
62 
63 ! ... local variables
64  CHARACTER(CHRLEN) :: rcsidentstring
65 #ifdef GENX
66  CHARACTER(CHRLEN), POINTER :: statname(:,:,:)
67 #endif
68  INTEGER :: errorflag
69  INTEGER, POINTER :: statid(:,:), statcode(:,:,:)
70 
71 !******************************************************************************
72 
73  rcsidentstring = '$RCSfile: PLAG_StatMapping.F90,v $'
74 
75  CALL registerfunction( global,'PLAG_StatMapping',&
76  'PLAG_StatMapping.F90' )
77 
78 ! allocate PLAG variables and set pointers ---------------------------------
79 
80  ALLOCATE( global%plagStatCode(2,2,global%plagNStat),stat=errorflag )
81  global%error = errorflag
82  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
83 
84  statid => global%plagStatId
85  statcode => global%plagStatCode
86 
87 #ifdef GENX
88  ALLOCATE( global%plagStatNm(2,2,global%plagNStat),stat=errorflag )
89  global%error = errorflag
90  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
91 
92  statname => global%plagStatNm
93 #endif
94 
95 ! set PLAG mapping ---------------------------------------------------------
96 
97  DO l=1,global%plagNStat
98  DO n=1,2
99  IF (statid(n,l)==0) THEN
100  statcode(n,:,l) = stat_none
101  ELSE IF (statid(n,l)==1) THEN
102  statcode(n,1,l) = stat_plagev
103  statcode(n,2,l) = ev_plag_diam3
104 #ifdef GENX
105  statname(n,1,l) = ' '
106  statname(n,2,l) = ' '
107 #endif
108  ELSE IF (statid(n,l)==2) THEN
109  statcode(n,1,l) = stat_plagev
110  statcode(n,2,l) = ev_plag_diam4
111 #ifdef GENX
112  statname(n,1,l) = ' '
113  statname(n,2,l) = ' '
114 #endif
115  ELSE IF (statid(n,l)==3) THEN
116  statcode(n,1,l) = stat_plagev
117  statcode(n,2,l) = ev_plag_numdens
118 #ifdef GENX
119  statname(n,1,l) = ' '
120  statname(n,2,l) = ' '
121 #endif
122  ELSE IF (statid(n,l)==4) THEN
123  statcode(n,1,l) = stat_plagev
124  statcode(n,2,l) = ev_plag_uvel
125 #ifdef GENX
126  statname(n,1,l) = ' '
127  statname(n,2,l) = ' '
128 #endif
129  ELSE IF (statid(n,l)==5) THEN
130  statcode(n,1,l) = stat_plagev
131  statcode(n,2,l) = ev_plag_vvel
132 #ifdef GENX
133  statname(n,1,l) = ' '
134  statname(n,2,l) = ' '
135 #endif
136  ELSE IF (statid(n,l)==6) THEN
137  statcode(n,1,l) = stat_plagev
138  statcode(n,2,l) = ev_plag_wvel
139 #ifdef GENX
140  statname(n,1,l) = ' '
141  statname(n,2,l) = ' '
142 #endif
143  ELSE IF (statid(n,l)==7) THEN
144  statcode(n,1,l) = stat_plagev
145  statcode(n,2,l) = ev_plag_mass
146 #ifdef GENX
147  statname(n,1,l) = ' '
148  statname(n,2,l) = ' '
149 #endif
150  ELSE IF (statid(n,l)==8) THEN
151  statcode(n,1,l) = stat_plagev
152  statcode(n,2,l) = ev_plag_mass+1
153 #ifdef GENX
154  statname(n,1,l) = ' '
155  statname(n,2,l) = ' '
156 #endif
157  ELSE IF (statid(n,l)==9) THEN
158  statcode(n,1,l) = stat_plagev
159  statcode(n,2,l) = ev_plag_mass+2
160 #ifdef GENX
161  statname(n,1,l) = ' '
162  statname(n,2,l) = ' '
163 #endif
164  ELSE
165  CALL errorstop( global,err_stats_indexing,__line__, &
166  'PLAG index is not defined.' )
167  ENDIF
168  ENDDO
169  ENDDO
170 
171 #ifdef GENX
172 ! defined names and units of turbulence statistics
173 
174  CALL genxstatnaming( global, ftype_plag )
175 #endif
176 
177 ! finalize --------------------------------------------------------------------
178 
179  CALL deregisterfunction( global )
180 
181 END SUBROUTINE plag_statmapping
182 
183 !******************************************************************************
184 !
185 ! RCS Revision history:
186 !
187 ! $Log: PLAG_StatMapping.F90,v $
188 ! Revision 1.4 2008/12/06 08:44:36 mtcampbe
189 ! Updated license.
190 !
191 ! Revision 1.3 2008/11/19 22:17:48 mtcampbe
192 ! Added Illinois Open Source License/Copyright
193 !
194 ! Revision 1.2 2005/01/08 20:43:21 fnajjar
195 ! Assigned properly statCode based on PLAG statistics infrastructure
196 !
197 ! Revision 1.1 2004/12/29 23:30:42 wasistho
198 ! prepared statistics for PLAG
199 !
200 !
201 !
202 !******************************************************************************
203 
204 
205 
206 
207 
208 
209 
subroutine genxstatnaming(global, fluidType)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine plag_statmapping(global)
const NT & n
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469