Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ReadTimestepSection.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 time stepping.
26 !
27 ! Description: none.
28 !
29 ! Input: user input file.
30 !
31 ! Output: global = flow type and global time-stepping parameters.
32 !
33 ! Notes:
34 ! 1. RFLU: Must not overwrite global%currentTime if running within GENX
35 ! because solver gets actual time from Roccom. In preprocessor, however,
36 ! do not get time from Roccom, so need to read timeStamp into separate
37 ! variable. This will be used in RFLU_GetUserInput to set the variable
38 ! global%currentTime iff RFLU_GetUserInput is called from within the
39 ! preprocessing module.
40 !
41 !******************************************************************************
42 !
43 ! $Id: ReadTimestepSection.F90,v 1.6 2008/12/06 08:44:10 mtcampbe Exp $
44 !
45 ! Copyright: (c) 2001 by the University of Illinois
46 !
47 !******************************************************************************
48 
49 SUBROUTINE readtimestepsection( global )
50 
51  USE moddatatypes
52  USE modglobal, ONLY : t_global
53  USE modinterfaces, ONLY : readsection
54  USE moderror
55  USE modparameters
56  IMPLICIT NONE
57 
58 ! ... parameters
59  TYPE(t_global), POINTER :: global
60 
61 ! ... local variables
62  INTEGER, PARAMETER :: nvals_max = 19
63 
64  CHARACTER(10) :: keys(nvals_max)
65 
66  LOGICAL :: defined(nvals_max)
67 
68  REAL(RFREAL) :: vals(nvals_max)
69 
70 !******************************************************************************
71 
72  CALL registerfunction( global,'ReadTimestepSection',&
73  'ReadTimestepSection.F90' )
74 
75 ! specify keywords and search for them
76 
77  keys( 1) = 'FLOWTYPE'
78  keys( 2) = 'TIMESTEP'
79  keys( 3) = 'MAXTIME'
80  keys( 4) = 'WRITIME'
81  keys( 5) = 'PRNTIME'
82  keys( 6) = 'MAXITER'
83  keys( 7) = 'RESTOL'
84  keys( 8) = 'WRIITER'
85  keys( 9) = 'PRNITER'
86  keys(10) = 'STARTTIME'
87  keys(11) = 'STARTITER'
88  keys(12) = 'SOLVERTYPE'
89  keys(13) = 'ORDER'
90  keys(14) = 'MAXSUBITER'
91  keys(15) = 'TOLSUBITER'
92  keys(16) = 'PREDICTSOL'
93  keys(17) = 'DTMINLIMIT'
94  keys(18) = 'RKSCHEME'
95  keys(19) = 'DTFIXED'
96 
97  CALL readsection( global,if_input,nvals_max,keys,vals,defined )
98 
99  IF (defined(1).eqv..true.) THEN
100  global%flowType = flow_steady
101  IF (vals(1) > 0.9_rfreal) global%flowType = flow_unsteady
102  ENDIF
103  IF (defined( 2).eqv..true.) global%dtImposed = abs(vals(2))
104  IF (defined( 3).eqv..true.) global%maxTime = abs(vals(3))
105  IF (defined( 4).eqv..true.) global%writeTime = abs(vals(4))
106  IF (defined( 5).eqv..true.) global%printTime = abs(vals(5))
107  IF (defined( 6).eqv..true.) global%maxIter = int(abs(vals(6))+0.5_rfreal)
108  IF (defined( 7).eqv..true.) global%resTol = abs(vals(7))
109  IF (defined( 8).eqv..true.) global%writeIter = max(1,int(abs(vals(8))+0.5_rfreal))
110  IF (defined( 9).eqv..true.) global%printIter = max(1,int(abs(vals(9))+0.5_rfreal))
111 #ifndef GENX
112  IF (defined(10).eqv..true.) global%timeStamp = abs(vals(10))
113 #else
114  IF (defined(10).eqv..true.) global%timeStampPrep = abs(vals(10))
115 #endif
116  IF (defined(11).eqv..true.) global%currentIter = int(abs(vals(11))+0.5_rfreal)
117 #ifdef RFLO
118  IF (defined(12).eqv..true.) THEN
119  global%solverType = solv_explicit
120  IF (vals(12) > 0.9_rfreal) global%solverType = solv_implicit
121  ENDIF
122 #endif
123  IF (defined(13).eqv..true.) global%tstepOrder = max(2,int(abs(vals(13))+0.5_rfreal))
124  IF (defined(14).eqv..true.) global%maxSubIter = max(1,int(abs(vals(14))+0.5_rfreal))
125  IF (defined(15).eqv..true.) global%tolSubIter = abs(vals(15))
126  IF (defined(16).eqv..true.) THEN
127  IF (vals(16) < 0.9_rfreal) THEN
128  global%predictSol = .false.
129  ELSE
130  global%predictSol = .true.
131  ENDIF
132  ENDIF
133  IF ( defined(18) .eqv..true.) THEN
134  global%rkScheme = int(abs(vals(18)) + 0.5_rfreal)
135  END IF ! defined
136 #ifdef RFLO
137  IF (defined(19).eqv..true.) THEN
138  IF (vals(19) < 0.9_rfreal) THEN
139  global%dtFixed = .false.
140  ELSE
141  global%dtFixed = .true.
142  ENDIF
143  ENDIF
144 #endif
145 
146 #ifdef RFLU
147 #ifndef GENX
148  IF ( defined(10) .EQV. .true. ) THEN
149  global%currentTime = global%timeStamp
150  ELSE
151  global%currentTime = 0.0_rfreal
152  END IF ! defined
153 #else
154  IF ( defined(10) .EQV. .false. ) THEN
155  global%timeStampPrep = 0.0_rfreal
156  END IF ! defined
157 #endif
158  IF ( defined(12) .EQV. .true. ) THEN
159  IF ( nint(vals(12)) == solv_explicit ) THEN
160  global%solverType = solv_explicit
161  ELSE
162  global%solverType = solv_implicit_nk
163  END IF ! NINT
164  ENDIF
165  IF ( defined(17) .EQV. .true. ) THEN
166  global%dtMinLimit = abs(vals(17))
167  END IF ! defined
168 #endif
169 
170 ! finalize
171 
172  CALL deregisterfunction( global )
173 
174 END SUBROUTINE readtimestepsection
175 
176 !******************************************************************************
177 !
178 ! RCS Revision history:
179 !
180 ! $Log: ReadTimestepSection.F90,v $
181 ! Revision 1.6 2008/12/06 08:44:10 mtcampbe
182 ! Updated license.
183 !
184 ! Revision 1.5 2008/11/19 22:17:23 mtcampbe
185 ! Added Illinois Open Source License/Copyright
186 !
187 ! Revision 1.4 2008/10/23 18:20:55 mtcampbe
188 ! Crazy number of changes to track and fix initialization and
189 ! restart bugs. Many improperly formed logical expressions
190 ! were fixed, and bug in allocation for data associated with
191 ! the BC_INFLOWVELTEMP boundary condition squashed in
192 ! RFLO_ReadBcInflowVelSection.F90.
193 !
194 ! Revision 1.3 2006/05/09 23:36:17 wasistho
195 ! added DTFIXED for implicit
196 !
197 ! Revision 1.2 2005/08/03 18:14:07 hdewey2
198 ! Added reading of solverType
199 !
200 ! Revision 1.1 2004/12/01 16:50:55 haselbac
201 ! Initial revision after changing case
202 !
203 ! Revision 1.19 2004/11/17 16:23:21 haselbac
204 ! Added RKSCHEME as input parameter
205 !
206 ! Revision 1.18 2004/08/10 00:22:24 wasistho
207 ! added RFREAL to real number 0.9 in IF statements
208 !
209 ! Revision 1.17 2003/11/20 16:40:35 mdbrandy
210 ! Backing out RocfluidMP changes from 11-17-03
211 !
212 ! Revision 1.14 2003/10/15 02:38:58 haselbac
213 ! Added new key and parameter NVALS_MAX
214 !
215 ! Revision 1.13 2003/07/03 21:48:44 jblazek
216 ! Implemented dual-time stepping.
217 !
218 ! Revision 1.12 2003/05/15 02:57:02 jblazek
219 ! Inlined index function.
220 !
221 ! Revision 1.11 2003/03/25 19:21:00 haselbac
222 ! Removed old DEBUG variable
223 !
224 ! Revision 1.10 2003/01/30 19:06:40 haselbac
225 ! Added timeStampPrep variable, see note
226 !
227 ! Revision 1.9 2002/10/16 21:09:59 haselbac
228 ! Fixed bug in RFLU code segment
229 !
230 ! Revision 1.8 2002/09/20 22:22:35 jblazek
231 ! Finalized integration into GenX.
232 !
233 ! Revision 1.7 2002/09/05 17:40:20 jblazek
234 ! Variable global moved into regions().
235 !
236 ! Revision 1.6 2002/05/28 13:46:55 haselbac
237 ! Set currentTime to timeStamp for RFLU
238 !
239 ! Revision 1.5 2002/02/21 23:25:05 jblazek
240 ! Blocks renamed as regions.
241 !
242 ! Revision 1.4 2002/02/01 00:00:24 jblazek
243 ! Edge and corner cells defined for each level.
244 !
245 ! Revision 1.3 2002/01/11 17:18:31 jblazek
246 ! Updated description of I/O variables.
247 !
248 ! Revision 1.2 2001/12/22 00:09:38 jblazek
249 ! Added routines to store grid and solution.
250 !
251 ! Revision 1.1 2001/12/07 16:54:32 jblazek
252 ! Added files to read user input.
253 !
254 !******************************************************************************
255 
256 
257 
258 
259 
260 
261 
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine readsection(global, fileID, nvals, keys, vals, defined)
subroutine readtimestepsection(global)
subroutine deregisterfunction(global)
Definition: ModError.F90:469