Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
INRT_ReadDefaultSection.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: Reads in default information for all interactions
26 !
27 ! Description: none.
28 !
29 ! Input: regions = data of all regions
30 !
31 ! Output: fills user data into region%inrtInput
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: INRT_ReadDefaultSection.F90,v 1.3 2008/12/06 08:44:31 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2003 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE inrt_readdefaultsection( regions )
44 
45  USE moddatatypes
46  USE moddatastruct, ONLY : t_region
47  USE modglobal, ONLY : t_global
48  USE modinteract, ONLY : t_inrt_input
49  USE moderror
50  USE modparameters
52 
53 #ifdef RFLO
55 #endif
56 #ifdef RFLU
57  USE modinterfaces, ONLY : readsection
58 #endif
61  IMPLICIT NONE
62 
63 ! ... parameters
64  TYPE(t_region), POINTER :: regions(:)
65 
66 ! ... loop variables
67  INTEGER :: ireg,iplag,ipeul,iinrt
68 
69 ! ... local variables
70  INTEGER, PARAMETER :: nkeys_max = 30
71  INTEGER, PARAMETER :: npeul_max = 10
72 
73  CHARACTER(CHRLEN) :: rcsidentstring
74  CHARACTER(CHRLEN) :: keys(nkeys_max)
75 
76  INTEGER :: brbeg,brend
77  INTEGER :: nplag,npeul
78  INTEGER :: nfixedkeys,nkeys
79  INTEGER :: ind,indmixt,indplag0,indpeul0
80  INTEGER :: ikey,ikeymixtactv,ikeyplagactv,ikeymixtperm,ikeyplagperm
81  INTEGER :: ikeycomputeaux,ikeytwodaverage
82  INTEGER :: ikeyactv,ikeyperm,ikeypeulactv0,ikeypeulperm0
83 
84  LOGICAL :: defined(nkeys_max)
85 
86  REAL(RFREAL) :: vals(nkeys_max)
87 
88  TYPE(t_inrt_input), POINTER :: input
89  TYPE(t_global), POINTER :: global
90 
91 !******************************************************************************
92 
93  rcsidentstring = &
94  '$RCSfile: INRT_ReadDefaultSection.F90,v $ $Revision: 1.3 $'
95 
96  global => regions(1)%global
97 
98  CALL registerfunction( global,'INRT_ReadDefaultSection',&
99  'INRT_ReadDefaultSection.F90' )
100 
101 ! begin -----------------------------------------------------------------------
102 
103 ! define Node keys and other fixed keys
104 
105  ikeycomputeaux = 1
106  ikeytwodaverage = 2
107  ikeymixtactv = 3
108  ikeyplagactv = 4
109  ikeymixtperm = 5
110  ikeyplagperm = 6
111  nfixedkeys = 6
112 
113  keys(ikeycomputeaux) = 'COMPUTE_AUX'
114  keys(ikeytwodaverage) = '2D_AVERAGE'
115  keys(ikeymixtactv) = 'MIXT_ACTV'
116  keys(ikeyplagactv) = 'PLAG_ACTV'
117  keys(ikeymixtperm) = 'MIXT_PERM'
118  keys(ikeyplagperm) = 'PLAG_PERM'
119 
120  ikeypeulactv0 = nfixedkeys
121  ikeypeulperm0 = ikeypeulactv0 + npeul_max
122 
123 #ifdef RFLO
124  CALL makenumberedkeys(keys,ikeypeulactv0+1,'PEUL',1,npeul_max,1)
125  CALL makenumberedkeys(keys,ikeypeulperm0+1,'PEUL',1,npeul_max,1)
126 #endif
127 #ifdef RFLU
128  CALL makenumberedkeys(keys,ikeypeulactv0+1,'SPEC',1,npeul_max,1)
129  CALL makenumberedkeys(keys,ikeypeulperm0+1,'SPEC',1,npeul_max,1)
130 #endif
131 
132  DO ipeul=1,npeul_max
133  keys(ikeypeulactv0+ipeul) = trim(keys(ikeypeulactv0+ipeul))//'_ACTV'
134  keys(ikeypeulperm0+ipeul) = trim(keys(ikeypeulperm0+ipeul))//'_PERM'
135  END DO ! iPeul
136 
137  nkeys = ikeypeulperm0 + npeul_max
138 
139  IF (nkeys > nkeys_max) CALL errorstop( global,err_exceeds_decl_mem,__line__ )
140 
141 ! Read default section from input file
142 
143 #ifdef RFLO
144  CALL readregionsection( global,if_input,nkeys,keys,vals,brbeg,brend,defined )
145 #endif
146 #ifdef RFLU
147  CALL readsection( global,if_input,nkeys,keys,vals,defined )
148  brbeg = lbound(regions,1)
149  brend = ubound(regions,1)
150 #endif
151 
152  DO ireg=brbeg,brend
153 
154  input => regions(ireg)%inrtInput
155 
156  IF (input%defaultRead) &
157  CALL errorstop( global,err_inrt_defread,__line__ )
158 
159  input%defaultRead = .true.
160 
161  nplag = input%nPlag
162  npeul = input%nPeul
163  IF (npeul > npeul_max) &
164  CALL errorstop( global,err_exceeds_decl_mem,__line__ )
165 
166  input%computeAux = .true.
167 
168  IF (defined(ikeycomputeaux)) THEN
169 
170  SELECT CASE ( nint(vals(ikeycomputeaux)) )
171 
172  CASE (0)
173  input%computeAux = .false.
174 
175  CASE (1)
176  input%computeAux = .true.
177 
178  CASE default
179  CALL errorstop( global,err_inrt_badswitch,__line__ )
180 
181  END SELECT ! iKeyComputeAux
182 
183  END IF ! iKeyComputeAux
184 
185  input%twoDAverage = 0
186 
187  IF (defined(ikeytwodaverage)) THEN
188 
189  SELECT CASE ( nint(vals(ikeytwodaverage)) )
190 
191  CASE (0:1)
192  input%twoDAverage = nint(vals(ikeytwodaverage))
193 
194  CASE default
195  CALL errorstop( global,err_inrt_badswitch,__line__ )
196 
197  END SELECT ! iKeyTwoDAverage
198 
199  END IF ! iKeyTwoDAverage
200 
201 ! - Indices for Nodes
202 
203  indmixt = input%indMixt
204  indplag0 = input%indPlag0
205  indpeul0 = input%indPeul0
206 
207 ! - Check for Mixture controls
208 
209  IF (defined(ikeymixtactv)) &
210  CALL inrt_setactiveness(global,vals(ikeymixtactv), &
211  input%globActiveness(indmixt))
212 
213  IF (defined(ikeymixtperm)) &
214  CALL inrt_setpermission(global,vals(ikeymixtperm), &
215  input%globPermission(indmixt))
216 
217 ! - Check for Lagrangian particle controls
218 
219  DO iplag = 1,nplag+1
220 
221  ind = indplag0 + iplag
222 
223  IF (defined(ikeyplagactv)) &
224  CALL inrt_setactiveness(global,vals(ikeyplagactv), &
225  input%globActiveness(ind))
226 
227  IF (defined(ikeyplagperm)) &
228  CALL inrt_setpermission(global,vals(ikeyplagperm), &
229  input%globPermission(ind))
230 
231  END DO ! iPlag
232 
233 ! - Check for Smoke controls
234 
235  DO ipeul = 1,npeul
236 
237  ikeyactv = ikeypeulactv0 + ipeul
238  ikeyperm = ikeypeulperm0 + ipeul
239  ind = indpeul0 + ipeul
240 
241  IF (defined(ikeyactv)) &
242  CALL inrt_setactiveness(global,vals(ikeyactv), &
243  input%globActiveness(ind))
244 
245  IF (defined(ikeyperm)) &
246  CALL inrt_setpermission(global,vals(ikeyperm), &
247  input%globPermission(ind))
248 
249  END DO ! iPeul
250 
251 ! - Initialize local Activeness and Permission to global values
252 
253  DO iinrt = 1,inrt_type_total
254 
255  input%inrts(iinrt)%activeness = input%globActiveness
256  input%inrts(iinrt)%permission = input%globPermission
257 
258  END DO ! iInrt
259 
260  END DO ! iReg
261 
262 ! finalize --------------------------------------------------------------------
263 
264  CALL deregisterfunction( global )
265 
266 END SUBROUTINE inrt_readdefaultsection
267 
268 !******************************************************************************
269 !
270 ! RCS Revision history:
271 !
272 ! $Log: INRT_ReadDefaultSection.F90,v $
273 ! Revision 1.3 2008/12/06 08:44:31 mtcampbe
274 ! Updated license.
275 !
276 ! Revision 1.2 2008/11/19 22:17:44 mtcampbe
277 ! Added Illinois Open Source License/Copyright
278 !
279 ! Revision 1.1 2004/12/01 21:56:34 fnajjar
280 ! Initial revision after changing case
281 !
282 ! Revision 1.9 2004/07/28 15:42:12 jferry
283 ! deleted defunct constructs: useDetangle, useSmokeDrag, useSmokeHeatTransfer
284 !
285 ! Revision 1.8 2004/07/23 22:43:16 jferry
286 ! Integrated rocspecies into rocinteract
287 !
288 ! Revision 1.7 2004/03/05 22:09:03 jferry
289 ! created global variables for peul, plag, and inrt use
290 !
291 ! Revision 1.6 2004/03/02 21:47:29 jferry
292 ! Added After Update interactions
293 !
294 ! Revision 1.5 2003/09/25 15:48:43 jferry
295 ! implemented Boiling Regulation interaction
296 !
297 ! Revision 1.4 2003/04/02 22:32:04 jferry
298 ! codified Activeness and Permission structures for rocinteract
299 !
300 ! Revision 1.3 2003/03/24 23:30:52 jferry
301 ! overhauled rocinteract to allow interaction design to use user input
302 !
303 ! Revision 1.2 2003/03/11 16:09:39 jferry
304 ! Added comments
305 !
306 ! Revision 1.1 2003/03/04 22:12:35 jferry
307 ! Initial import of Rocinteract
308 !
309 !******************************************************************************
310 
311 
312 
313 
314 
315 
316 
subroutine makenumberedkeys(keys, indBegin, string, numBegin, numEnd, numSkip)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
**********************************************************************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 brbeg
subroutine input(X, NNODE, NDC, NCELL, NFCE, NBPTS, NBFACE, ITYP, NPROP, XBNDY, XFAR, YFAR, ZFAR)
subroutine inrt_setactiveness(global, val, actv)
subroutine inrt_readdefaultsection(regions)
subroutine readsection(global, fileID, nvals, keys, vals, defined)
subroutine readregionsection(global, fileID, nvals, keys, vals, brbeg, brend, defined)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine inrt_setpermission(global, val, perm)