Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ReadGridMotionSection.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: Read in user input related to the grid motion scheme.
26 !
27 ! Description: None.
28 !
29 ! Input: from file.
30 !
31 ! Output:
32 ! global = global parameters related to grid motion (RFLO)
33 ! regions = region data (RFLU).
34 !
35 ! Notes: None.
36 !
37 ! ******************************************************************************
38 !
39 ! $Id: ReadGridMotionSection.F90,v 1.21 2008/12/06 08:44:09 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2003-2004 by the University of Illinois
42 !
43 ! ******************************************************************************
44 
45 #ifdef RFLO
46 SUBROUTINE readgridmotionsection( global )
47 #endif
48 #ifdef RFLU
49 SUBROUTINE readgridmotionsection(regions)
50 #endif
51 
52  USE moddatatypes
53  USE modglobal, ONLY: t_global
54  USE moddatastruct, ONLY: t_region
55  USE modinterfaces, ONLY: readsection
56  USE moderror
57  USE modparameters
58 
59  IMPLICIT NONE
60 
61 ! ******************************************************************************
62 ! Declarations and definitions
63 ! ******************************************************************************
64 
65 ! ==============================================================================
66 ! Arguments
67 ! ==============================================================================
68 
69 #ifdef RFLO
70  TYPE(t_global), POINTER :: global
71 #endif
72 #ifdef RFLU
73  TYPE(t_region), POINTER :: regions(:)
74 #endif
75 
76 ! ==============================================================================
77 ! Locals
78 ! ==============================================================================
79 
80 #ifdef RFLU
81  INTEGER :: ireg
82 #endif
83  INTEGER, PARAMETER :: nvals_max = 16
84  INTEGER :: nvals
85 
86  CHARACTER(10) :: keys(nvals_max)
87 
88  LOGICAL :: defined(nvals_max)
89 
90  REAL(RFREAL) :: vals(nvals_max)
91 
92 ! ******************************************************************************
93 ! Start, specify keywords and search for them
94 ! ******************************************************************************
95 
96  keys(1) = 'TYPE'
97  keys(2) = 'NITER'
98 #ifdef RFLO
99  keys(3) = 'VITER'
100  keys(4) = 'SITER'
101  keys(5) = 'WEIGHT'
102  keys(6) = 'AMPLIFX'
103  keys(7) = 'AMPLIFY'
104  keys(8) = 'AMPLIFZ'
105  keys(9) = 'POWER'
106  keys(10)= 'NEIGHBOR'
107  keys(11)= 'NSURFMATCH'
108  keys(12)= 'ORTHODIR'
109  keys(13)= 'ORTHOWGHTX'
110  keys(14)= 'ORTHOWGHTY'
111  keys(15)= 'ORTHOWGHTZ'
112  keys(16)= 'ORTHOCELL'
113 
114  nvals = nvals_max
115 
116  CALL registerfunction( global,'ReadGridMotionSection',&
117  'ReadGridMotionSection.F90' )
118 
119  CALL readsection( global,if_input,nvals,keys,vals,defined )
120 
121  IF (defined(1).eqv..true.) THEN
122  global%moveGridScheme = movegrid_blocks
123  IF (vals(1) > 0.9 .AND. vals(1) < 1.9) &
124  global%moveGridScheme = movegrid_global
125  IF (vals(1) > 1.9 .AND. vals(1) < 2.9) &
126  global%moveGridScheme = movegrid_frame
127  IF (vals(1) > 2.9 .AND. vals(1) < 3.9) &
128  global%moveGridScheme = movegrid_foms
129  IF (vals(1) > 3.9 .AND. vals(1) < 4.9) &
130  global%moveGridScheme = movegrid_elglobal
131  IF (vals(1) > 4.9 .AND. vals(1) < 5.9) &
132  global%moveGridScheme = movegrid_elframe
133  IF (vals(1) > 5.9) &
134  global%moveGridScheme = movegrid_vms
135  ENDIF
136  IF (defined(2).eqv..true.) THEN
137  global%moveGridNiter = int(abs(vals(2))+0.5_rfreal)
138  ENDIF
139  IF (defined(3).eqv..true.) THEN
140  global%moveGridViter = int(abs(vals(3))+0.5_rfreal)
141  ENDIF
142  IF (defined(4).eqv..true.) THEN
143  global%moveGridSiter = int(abs(vals(4))+0.5_rfreal)
144  ENDIF
145  IF (defined(5).eqv..true.) THEN
146  global%moveGridWeight = vals(5)
147  ENDIF
148  IF (defined(6).eqv..true.) THEN
149  global%moveGridAmplifX = vals(6)
150  ENDIF
151  IF (defined(7).eqv..true.) THEN
152  global%moveGridAmplifY = vals(7)
153  ENDIF
154  IF (defined(8).eqv..true.) THEN
155  global%moveGridAmplifZ = vals(8)
156  ENDIF
157  IF (defined(9).eqv..true.) THEN
158  global%moveGridPower = vals(9)
159  ENDIF
160  IF (defined(10).eqv..true.) THEN
161  global%moveGridNbour = int(abs(vals(10))+0.5_rfreal)
162  ENDIF
163  IF (defined(11).eqv..true.) THEN
164  global%moveGridNsmatch = int(abs(vals(11))+0.5_rfreal)
165  ENDIF
166  IF (defined(12).eqv..true.) THEN
167  global%moveGridOrthDir = int(abs(vals(12))+0.5_rfreal)
168  ENDIF
169  IF (defined(13).eqv..true.) THEN
170  global%moveGridOrthWghtX = vals(13)
171  ENDIF
172  IF (defined(14).eqv..true.) THEN
173  global%moveGridOrthWghtY = vals(14)
174  ENDIF
175  IF (defined(15).eqv..true.) THEN
176  global%moveGridOrthWghtZ = vals(15)
177  ENDIF
178  IF (defined(16).eqv..true.) THEN
179  global%moveGridOrthCell = vals(16)
180  ENDIF
181 
182  CALL deregisterfunction( global )
183 #endif
184 
185 #ifdef RFLU
186  keys(3) = 'SFACT'
187 
188  nvals = 3
189 
190  CALL registerfunction(regions(1)%global,'ReadGridMotionSection',&
191  'ReadGridMotionSection.F90')
192 
193  CALL readsection(regions(1)%global,if_input,nvals,keys,vals,defined)
194 
195  IF ( defined(1) .EQV. .true. ) THEN
196  DO ireg = lbound(regions,1),ubound(regions,1)
197  regions(ireg)%mixtInput%moveGridType = nint(vals(1))
198  END DO ! iReg
199  END IF ! defined
200 
201  IF ( defined(2) .EQV. .true. ) THEN
202  DO ireg = lbound(regions,1),ubound(regions,1)
203  regions(ireg)%mixtInput%moveGridNIter = nint(vals(2))
204  END DO ! iReg
205  END IF ! defined
206 
207  IF ( defined(3) .EQV. .true. ) THEN
208  DO ireg = lbound(regions,1),ubound(regions,1)
209  regions(ireg)%mixtInput%moveGridSFact = vals(3)
210  END DO ! iReg
211  END IF ! defined
212 
213  CALL deregisterfunction( regions(1)%global )
214 #endif
215 
216 ! ******************************************************************************
217 ! End
218 ! ******************************************************************************
219 
220 END SUBROUTINE readgridmotionsection
221 
222 ! ******************************************************************************
223 !
224 ! RCS Revision history:
225 !
226 ! $Log: ReadGridMotionSection.F90,v $
227 ! Revision 1.21 2008/12/06 08:44:09 mtcampbe
228 ! Updated license.
229 !
230 ! Revision 1.20 2008/11/19 22:17:23 mtcampbe
231 ! Added Illinois Open Source License/Copyright
232 !
233 ! Revision 1.19 2008/10/23 18:20:55 mtcampbe
234 ! Crazy number of changes to track and fix initialization and
235 ! restart bugs. Many improperly formed logical expressions
236 ! were fixed, and bug in allocation for data associated with
237 ! the BC_INFLOWVELTEMP boundary condition squashed in
238 ! RFLO_ReadBcInflowVelSection.F90.
239 !
240 ! Revision 1.18 2006/03/18 13:28:03 wasistho
241 ! added orthDir and orthWghtX,Y,Z
242 !
243 ! Revision 1.17 2006/03/08 06:38:41 wasistho
244 ! added moveGridSiter and Viter
245 !
246 ! Revision 1.16 2006/03/02 03:52:51 wasistho
247 ! bug fixed, defined(11) was defined(10)
248 !
249 ! Revision 1.15 2006/03/02 01:26:12 wasistho
250 ! split movegrid_epde to elglobal and elframe
251 !
252 ! Revision 1.14 2006/02/08 04:02:35 wasistho
253 ! added movegrid_epde
254 !
255 ! Revision 1.13 2005/10/28 22:46:34 wasistho
256 ! added orthocell
257 !
258 ! Revision 1.12 2005/10/28 05:41:48 wasistho
259 ! read FOMS scheme
260 !
261 ! Revision 1.11 2005/08/28 23:47:55 wasistho
262 ! added orthoWght for block orthogonality of RFLO global-gridmotion
263 !
264 ! Revision 1.10 2005/08/18 19:47:46 wasistho
265 ! added moveGridNsmatch
266 !
267 ! Revision 1.9 2005/06/23 05:50:21 wasistho
268 ! changed NEIGHBOUR to NEIGHBOR
269 !
270 ! Revision 1.8 2005/06/23 03:32:57 wasistho
271 ! fixed bug in reading NEIGHBOUR
272 !
273 ! Revision 1.7 2005/06/23 01:35:49 wasistho
274 ! added input parameter NEIGHBOUR for rocflo
275 !
276 ! Revision 1.6 2005/06/04 01:02:40 wasistho
277 ! distinguished to AMPLIFX,Y,Z
278 !
279 ! Revision 1.5 2005/06/02 22:57:53 wasistho
280 ! added moveGridAmplif and moveGridPower
281 !
282 ! Revision 1.4 2005/06/02 03:21:54 wasistho
283 ! shuffle MoveGridVms with MoveGridFrame
284 !
285 ! Revision 1.3 2005/05/28 21:24:16 wasistho
286 ! added moveGridFrame
287 !
288 ! Revision 1.2 2005/05/21 04:16:21 wasistho
289 ! added MOVEGRID_VMS in Rocflo part
290 !
291 ! Revision 1.1 2004/12/01 16:50:23 haselbac
292 ! Initial revision after changing case
293 !
294 ! Revision 1.13 2004/10/19 19:25:41 haselbac
295 ! Cosmetics only
296 !
297 ! Revision 1.12 2003/11/20 16:40:35 mdbrandy
298 ! Backing out RocfluidMP changes from 11-17-03
299 !
300 ! Revision 1.9 2003/08/27 21:33:58 haselbac
301 ! Changed logic so vars not overwritten if not present
302 !
303 ! Revision 1.8 2003/08/25 21:51:24 jblazek
304 ! Full version of global grid motion scheme.
305 !
306 ! Revision 1.7 2003/08/11 21:51:17 jblazek
307 ! Added basic global grid smoothing scheme.
308 !
309 ! Revision 1.6 2003/05/16 02:27:43 haselbac
310 ! Removed KIND=RFREAL from NINT statements
311 !
312 ! Revision 1.5 2003/05/15 02:57:02 jblazek
313 ! Inlined index function.
314 !
315 ! Revision 1.4 2003/03/31 16:31:56 haselbac
316 ! Added reading of new argument
317 !
318 ! Revision 1.3 2003/03/15 16:26:10 haselbac
319 ! Added KIND qualifyer
320 !
321 ! Revision 1.2 2003/02/07 23:10:43 haselbac
322 ! Fixed stupid mistake in setting of sFact
323 !
324 ! Revision 1.1 2003/01/28 16:13:38 haselbac
325 ! Initial revision
326 !
327 ! ******************************************************************************
328 
329 
330 
331 
332 
333 
334 
335 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine readsection(global, fileID, nvals, keys, vals, defined)
**********************************************************************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 USE ModDataTypes USE nvals
subroutine deregisterfunction(global)
Definition: ModError.F90:469