Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_ReadRestartInfo.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 restart info file to get last output iteration or time.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! global Pointer to global data
31 !
32 ! Output: None.
33 !
34 ! Notes: None.
35 !
36 ! ******************************************************************************
37 !
38 ! $Id: RFLU_ReadRestartInfo.F90,v 1.6 2008/12/06 08:44:12 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2003-2004 by the University of Illinois
41 !
42 ! ******************************************************************************
43 
44 SUBROUTINE rflu_readrestartinfo(global)
45 
46  USE moddatatypes
47  USE modglobal, ONLY: t_global
48  USE modparameters
49  USE moderror
50  USE modmpi
51 
54 
55 ! ******************************************************************************
56 ! Declarations and definitions
57 ! ******************************************************************************
58 
59 ! ==============================================================================
60 ! Arguments
61 ! ==============================================================================
62 
63  TYPE(t_global), POINTER :: global
64 
65 ! ==============================================================================
66 ! Locals
67 ! ==============================================================================
68 
69  LOGICAL :: fileexists
70  CHARACTER(CHRLEN) :: rcsidentstring
71  INTEGER :: dummyinteger,errorflag
72  REAL(RFREAL) :: dummyrfreal
73 
74 ! ******************************************************************************
75 ! Start
76 ! ******************************************************************************
77 
78  rcsidentstring = '$RCSfile: RFLU_ReadRestartInfo.F90,v $ $Revision: 1.6 $'
79 
80  CALL registerfunction(global,'RFLU_ReadRestartInfo',&
81  'RFLU_ReadRestartInfo.F90')
82 
83  IF ( global%myProcid == masterproc .AND. &
84  global%verbLevel > verbose_none ) THEN
85  WRITE(stdout,'(A,1X,A)') solver_name, &
86  'Reading restart info file...'
87  END IF ! global%verbLevel
88 
89 ! ==============================================================================
90 ! Open file
91 ! ==============================================================================
92 
93  CALL rflu_openrestartinfo(global,file_position_start,fileexists)
94 
95 ! ==============================================================================
96 ! Set or read restart iteration or time
97 ! ==============================================================================
98 
99  IF ( global%flowType == flow_steady ) THEN ! steady flow
100  global%currentIter = 0
101 
102  IF ( fileexists .EQV. .true. ) THEN
103  DO
104  READ(if_restinfo,*,iostat=errorflag) dummyinteger
105 
106  IF ( errorflag /= err_none ) THEN
107  EXIT
108  ELSE
109  global%currentIter = dummyinteger
110  END IF ! errorFlag
111  END DO ! <empty>
112  END IF ! fileExists
113  ELSE ! unsteady flow
114  global%currentTime = 0.0_rfreal
115 
116  IF ( fileexists .EQV. .true. ) THEN
117  DO
118  READ(if_restinfo,*,iostat=errorflag) dummyrfreal
119 
120  IF ( errorflag /= err_none ) THEN
121  EXIT
122  ELSE
123  global%currentTime = dummyrfreal
124  END IF ! errorFlag
125  END DO ! <empty>
126  END IF ! fileExists
127  END IF ! global%flowType
128 
129 ! ==============================================================================
130 ! Write info
131 ! ==============================================================================
132 
133  IF ( global%myProcid == masterproc .AND. &
134  global%verbLevel > verbose_low ) THEN
135  IF ( global%flowType == flow_steady ) THEN
136  WRITE(stdout,'(A,3X,A,1X,I6.6)') solver_name, &
137  'Restart iteration:',global%currentIter
138  ELSE
139  WRITE(stdout,'(A,3X,A,1X,1PE11.5)') solver_name, &
140  'Restart time:',global%currentTime
141  END IF ! global%flowType
142  END IF ! global%myProcid
143 
144 ! ==============================================================================
145 ! Close file
146 ! ==============================================================================
147 
148  CALL rflu_closerestartinfo(global)
149 
150 ! ******************************************************************************
151 ! End
152 ! ******************************************************************************
153 
154  IF ( global%myProcid == masterproc .AND. &
155  global%verbLevel > verbose_none ) THEN
156  WRITE(stdout,'(A,1X,A)') solver_name, &
157  'Reading restart info file done.'
158  END IF ! global%verbLevel
159 
160  CALL deregisterfunction(global)
161 
162 END SUBROUTINE rflu_readrestartinfo
163 
164 
165 ! ******************************************************************************
166 !
167 ! RCS Revision history:
168 !
169 ! $Log: RFLU_ReadRestartInfo.F90,v $
170 ! Revision 1.6 2008/12/06 08:44:12 mtcampbe
171 ! Updated license.
172 !
173 ! Revision 1.5 2008/11/19 22:17:25 mtcampbe
174 ! Added Illinois Open Source License/Copyright
175 !
176 ! Revision 1.4 2006/04/07 15:19:16 haselbac
177 ! Removed tabs
178 !
179 ! Revision 1.3 2004/06/25 20:04:51 haselbac
180 ! Removed some code and put into RFLU_SetRestartTimeFlag
181 !
182 ! Revision 1.2 2004/06/16 20:00:33 haselbac
183 ! Added variables to make file handling easier, cosmetics
184 !
185 ! Revision 1.1 2003/06/20 22:32:30 haselbac
186 ! Initial revision
187 !
188 ! ******************************************************************************
189 
190 
191 
192 
193 
194 
195 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflu_openrestartinfo(global, filePosition, fileExists)
subroutine rflu_closerestartinfo(global)
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine rflu_readrestartinfo(global)