Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ReadInputFile.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 (done on all processors).
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! regions Region data
31 !
32 ! Output:
33 ! None.
34 !
35 ! Notes: None.
36 !
37 ! ******************************************************************************
38 !
39 ! $Id: ReadInputFile.F90,v 1.7 2008/12/06 08:44:09 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2001-2005 by the University of Illinois
42 !
43 ! ******************************************************************************
44 
45 SUBROUTINE readinputfile(regions)
46 
47  USE moddatatypes
48  USE moddatastruct, ONLY: t_region
49  USE modglobal, ONLY: t_global
50  USE moderror
51  USE modparameters
52 
54 
55  USE modinterfaces, ONLY: readformatssection, &
57  readflowsection, &
68  readgridmotionsection, &
72 #ifdef INRT
74 #endif
75 #ifdef RFLU
76  USE modinterfaces, ONLY: readprepsection, &
79 #endif
80 #ifdef STATS
82 #endif
83 
84  IMPLICIT NONE
85 
86 ! ******************************************************************************
87 ! Declarations and definitions
88 ! ******************************************************************************
89 
90 ! ==============================================================================
91 ! Arguments
92 ! ==============================================================================
93 
94  TYPE(t_region), POINTER :: regions(:)
95 
96 ! ==============================================================================
97 ! Locals
98 ! ==============================================================================
99 
100  CHARACTER(CHRLEN) :: fname
101  CHARACTER(256) :: line
102  INTEGER :: errorflag
103  TYPE(t_global), POINTER :: global
104 
105 ! ******************************************************************************
106 ! Start
107 ! ******************************************************************************
108 
109  global => regions(1)%global
110 
111  CALL registerfunction(global,'ReadInputFile',&
112  'ReadInputFile.F90')
113 
114 ! ******************************************************************************
115 ! Open file
116 ! ******************************************************************************
117 
118  CALL buildfilenameplain(global,filedest_indir,'.inp',fname)
119 
120  OPEN(if_input,file=trim(fname),form='FORMATTED',status='OLD',iostat=errorflag)
121  global%error = errorflag
122  IF ( global%error /= err_none ) THEN
123  CALL errorstop(global,err_file_open,__line__,'File: '//trim(fname))
124  END IF ! global%error
125 
126 ! ******************************************************************************
127 ! Read file looking for keywords
128 ! ******************************************************************************
129 
130  DO
131  READ(if_input,'(A256)',err=10,end=86) line
132 
133  SELECT CASE( trim(line) )
134  CASE ('# FORMATS')
135  CALL readformatssection(global)
136  CASE ('# REFERENCE')
137  CALL readreferencesection(global)
138  CASE ('# RANDOM')
139  CALL readrandomsection(global)
140  CASE ('# FLOWMODEL')
141  CALL readflowsection(regions)
142 #ifdef RFLU
143  CASE ('# MIXTURE')
144  CALL readmixturesection(regions)
145 #endif
146  CASE ('# VISCMODEL')
147  CALL readviscositysection(regions)
148  CASE ('# ACCELERATION')
149  CALL readaccelerationsection(global)
150  CASE ('# PROBE')
151  CALL readprobesection(global)
152  CASE ('# FORCES')
153  CALL readforcessection(global)
154  CASE ('# TIMESTEP')
155  CALL readtimestepsection(global)
156  CASE ('# MULTIGRID')
157  CALL readmultigridsection(global)
158  CASE ('# NUMERICS')
159  CALL readnumericssection(regions)
160  CASE ('# THRUST')
161  CALL readthrustsection(global)
162  CASE ('# INITFLOW')
163  CALL readinitflowsection(regions)
164  CASE ('# POST')
165  CALL readpostsection(global)
166 #ifdef RFLO
167  CASE ('# GRIDMOTION')
168  CALL readgridmotionsection(global)
169 #endif
170 #ifdef RFLU
171  CASE ('# TRANSFORM')
172  CALL readtransformsection(global)
173  CASE ('# GRIDMOTION')
174  CALL readgridmotionsection(regions)
175  CASE ('# PREP')
176  CALL readprepsection(global)
177  CASE ('# ROCKET')
178  CALL readrocketsection(global)
179  CASE ('# TIMEZOOMING')
180  CALL readtimezoomingsection(global)
181 #endif
182 #ifdef STATS
183  CASE ('# STATISTICS')
184  CALL readstatisticsection(global)
185 #endif
186  END SELECT ! TRIM(line)
187  END DO ! <empty>
188 
189 86 CONTINUE
190 
191 ! ******************************************************************************
192 ! Close file
193 ! ******************************************************************************
194 
195  CLOSE(if_input,iostat=errorflag)
196  global%error = errorflag
197  IF ( global%error /= err_none ) THEN
198  CALL errorstop(global,err_file_close,__line__,'File: '//trim(fname))
199  END IF ! global%error
200 
201 ! ******************************************************************************
202 ! Read material sections
203 ! ******************************************************************************
204 
205 #ifdef INRT
206  CALL inrt_readmaterialinput(global)
207 #endif
208 
209 ! ******************************************************************************
210 ! End
211 ! ******************************************************************************
212 
213  CALL deregisterfunction(global)
214  goto 999
215 
216 10 CONTINUE
217  CALL errorstop(global,err_file_read,__line__,'File: '//trim(fname))
218 
219 999 CONTINUE
220 
221 END SUBROUTINE readinputfile
222 
223 ! ******************************************************************************
224 !
225 ! RCS Revision history:
226 !
227 ! $Log: ReadInputFile.F90,v $
228 ! Revision 1.7 2008/12/06 08:44:09 mtcampbe
229 ! Updated license.
230 !
231 ! Revision 1.6 2008/11/19 22:17:23 mtcampbe
232 ! Added Illinois Open Source License/Copyright
233 !
234 ! Revision 1.5 2007/04/14 14:24:12 mtcampbe
235 ! Updated for TZ and Rocket case constraints
236 !
237 ! Revision 1.4 2006/04/07 15:19:15 haselbac
238 ! Removed tabs
239 !
240 ! Revision 1.3 2005/11/10 01:57:00 haselbac
241 ! Added reading of MIXTURE section for Rocflu, clean-up
242 !
243 ! Revision 1.2 2005/10/31 19:24:37 haselbac
244 ! Added call to ReadMixtureSection, clean-up
245 !
246 ! Revision 1.1 2004/12/01 16:50:28 haselbac
247 ! Initial revision after changing case
248 !
249 ! Revision 1.36 2004/11/29 17:13:57 wasistho
250 ! use ModInterfacesStatistics
251 !
252 ! Revision 1.35 2004/07/24 03:45:28 wasistho
253 ! release readPostSection to flo and flu
254 !
255 ! Revision 1.34 2004/04/08 03:15:13 wasistho
256 ! nDummyCells in Rocflo read from INITFLOW section
257 !
258 ! Revision 1.33 2003/11/21 22:33:10 fnajjar
259 ! Updated Random Number Generator
260 !
261 ! Revision 1.32 2003/11/20 16:40:35 mdbrandy
262 ! Backing out RocfluidMP changes from 11-17-03
263 !
264 ! Revision 1.29 2003/09/26 21:45:34 fnajjar
265 ! Modified ModInterfaces calls to proper physical modules
266 !
267 ! Revision 1.28 2003/08/28 20:05:38 jblazek
268 ! Added acceleration terms.
269 !
270 ! Revision 1.27 2003/08/11 21:51:17 jblazek
271 ! Added basic global grid smoothing scheme.
272 !
273 ! Revision 1.26 2003/06/02 17:12:00 jblazek
274 ! Added computation of thrust.
275 !
276 ! Revision 1.25 2003/05/15 02:57:02 jblazek
277 ! Inlined index function.
278 !
279 ! Revision 1.24 2003/04/28 22:39:12 haselbac
280 ! Added readPostSection and readPrepSection for RFLU
281 !
282 ! Revision 1.23 2003/04/10 23:25:53 fnajjar
283 ! Added readViscositySection
284 !
285 ! Revision 1.22 2003/03/24 23:25:48 jferry
286 ! moved some routines from libfloflu to rocinteract
287 !
288 ! Revision 1.21 2003/03/17 19:37:02 jblazek
289 ! Added inDir to path to the input file.
290 !
291 ! Revision 1.20 2003/03/11 16:04:19 jferry
292 ! Enclosed USE statements for multi-physics routines within ifdefs
293 !
294 ! Revision 1.19 2003/02/26 23:38:30 jferry
295 ! eliminated end=999 convention to ensure that files get closed
296 !
297 ! Revision 1.18 2003/01/28 16:16:32 haselbac
298 ! Read transform section only for RFLU
299 !
300 ! Revision 1.17 2003/01/28 16:08:31 haselbac
301 ! Added new calls transform, initial solution (RFLU), and grid motion (RFLU)
302 !
303 ! Revision 1.16 2002/10/12 03:20:50 jblazek
304 ! Replaced [io]stat=global%error with local errorFlag for Rocflo.
305 !
306 ! Revision 1.15 2002/10/08 15:48:35 haselbac
307 ! {IO}STAT=global%error replaced by {IO}STAT=errorFlag - SGI problem
308 !
309 ! Revision 1.14 2002/09/20 22:22:35 jblazek
310 ! Finalized integration into GenX.
311 !
312 ! Revision 1.13 2002/09/09 14:02:21 haselbac
313 ! mixtInput now under regions
314 !
315 ! Revision 1.12 2002/09/05 17:40:20 jblazek
316 ! Variable global moved into regions().
317 !
318 ! Revision 1.10 2002/08/18 02:27:47 wasistho
319 ! Added ReadTurbulenceSection
320 !
321 ! Revision 1.9 2002/06/14 21:17:01 wasistho
322 ! Added time avg statistics
323 !
324 ! Revision 1.8 2002/06/07 16:40:37 jblazek
325 ! Grid & solution for all regions in one file.
326 !
327 ! Revision 1.7 2002/05/04 16:20:55 haselbac
328 ! Cosmetic changes
329 !
330 ! Revision 1.6 2002/03/26 19:03:37 haselbac
331 ! Added ROCFLU functionality
332 !
333 ! Revision 1.5 2002/02/21 23:25:05 jblazek
334 ! Blocks renamed as regions.
335 !
336 ! Revision 1.4 2002/01/28 23:55:22 jblazek
337 ! Added flux computation (central scheme).
338 !
339 ! Revision 1.3 2002/01/11 17:18:31 jblazek
340 ! Updated description of I/O variables.
341 !
342 ! Revision 1.2 2002/01/02 16:00:03 jblazek
343 ! Added input for multigrid parameters.
344 !
345 ! Revision 1.1 2001/12/07 16:54:31 jblazek
346 ! Added files to read user input.
347 !
348 ! ******************************************************************************
349 
350 
351 
352 
353 
354 
355 
subroutine readrocketsection(global)
subroutine readmultigridsection(global)
subroutine readmixturesection(regions)
subroutine readrandomsection(global)
CImg< T > & line(const unsigned int y0)
Get a line.
Definition: CImg.h:18421
subroutine inrt_readmaterialinput(global)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
int status() const
Obtain the status of the attribute.
Definition: Attribute.h:240
subroutine readprobesection(global)
subroutine readthrustsection(global)
subroutine readnumericssection(regions)
subroutine readstatisticsection(global)
subroutine buildfilenameplain(global, dest, ext, fileName)
subroutine readaccelerationsection(global)
subroutine readformatssection(global)
subroutine readinputfile(regions)
**********************************************************************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 form
subroutine readinitflowsection(regions)
subroutine readprepsection(global)
subroutine readtransformsection(global)
subroutine readflowsection(regions)
subroutine readtimestepsection(global)
subroutine readreferencesection(global)
subroutine readforcessection(global)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine readviscositysection(regions)
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine readpostsection(global)
subroutine readtimezoomingsection(global)