Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PREP_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 from initialization file.
26 !
27 ! Description: none.
28 !
29 ! Input: regions
30 !
31 ! Output: regions
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: PREP_ReadInputFile.F90,v 1.4 2008/12/06 08:44:50 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2001 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE readinputfile( regions )
44 
45  USE moddatatypes
46  USE moddatastruct, ONLY : t_region
47  USE modglobal, ONLY : t_global
50  USE moderror
51  USE modparameters
52  IMPLICIT NONE
53 
54 ! ... parameters
55  TYPE(t_region), POINTER :: regions(:)
56 
57 ! ... local variables
58  CHARACTER(2*CHRLEN+4) :: fname
59  CHARACTER(256) :: line
60 
61  INTEGER :: errorflag
62 
63  TYPE(t_global), POINTER :: global
64 
65 !******************************************************************************
66 
67  global => regions(1)%global
68 
69  CALL registerfunction( global,'ReadInputFile',&
70  'PREP_ReadInputFile.F90' )
71 
72 ! open file
73 
74  fname = trim(global%inDir)//trim(global%casename)//'.inp'
75  OPEN(if_input,file=fname,form='formatted',status='old',iostat=errorflag)
76  global%error = errorflag
77  IF (global%error /= 0) &
78  CALL errorstop( global,err_file_open,__line__,'File: '//trim(fname) )
79 
80 ! read file looking for keywords
81 
82  DO
83  READ(if_input,'(A256)',err=10,end=999) line
84  SELECT CASE(trim(line))
85  CASE ('# FORMATS')
86  CALL readformatssection( global )
87 
88  CASE ('# REFERENCE')
89  CALL readreferencesection( global )
90 
91  CASE ('# INITFLOW')
92  CALL readinitflowsection( regions )
93 
94  CASE ('# MULTIGRID')
95  CALL readmultigridsection( global )
96 
97  CASE ('# TIMESTEP')
98  CALL readtimestepsection( global )
99  END SELECT
100  ENDDO
101 
102  CLOSE(if_input,iostat=errorflag)
103  global%error = errorflag
104  IF (global%error /= 0) &
105  CALL errorstop( global,err_file_close,__line__,'File: '//trim(fname) )
106 
107  goto 999
108 
109 ! error handling
110 
111 10 CONTINUE
112  CALL errorstop( global,err_file_read,__line__,'File: '//trim(fname) )
113 
114 999 CONTINUE
115 
116  CALL deregisterfunction( global )
117 
118 END SUBROUTINE readinputfile
119 
120 !******************************************************************************
121 !
122 ! RCS Revision history:
123 !
124 ! $Log: PREP_ReadInputFile.F90,v $
125 ! Revision 1.4 2008/12/06 08:44:50 mtcampbe
126 ! Updated license.
127 !
128 ! Revision 1.3 2008/11/19 22:18:00 mtcampbe
129 ! Added Illinois Open Source License/Copyright
130 !
131 ! Revision 1.2 2004/12/03 03:30:19 wasistho
132 ! rflo_modinterfacesprep to prep_modinterfaces
133 !
134 ! Revision 1.1 2004/12/03 02:20:08 wasistho
135 ! added prefix
136 !
137 ! Revision 1.1 2004/12/03 00:40:49 wasistho
138 ! lower to upper case
139 !
140 ! Revision 1.11 2004/07/23 04:32:31 wasistho
141 ! Genx: readin from Rocin, standalone: read .inp file i.o. command line input
142 !
143 ! Revision 1.10 2003/05/15 02:57:07 jblazek
144 ! Inlined index function.
145 !
146 ! Revision 1.9 2003/04/10 03:44:38 jblazek
147 ! Merged .ini file into .inp file.
148 !
149 ! Revision 1.8 2003/03/20 22:27:56 haselbac
150 ! Renamed ModInterfaces
151 !
152 ! Revision 1.7 2003/03/20 19:44:22 haselbac
153 ! Corrected mistake in phased check-in
154 !
155 ! Revision 1.6 2003/03/20 19:35:43 haselbac
156 ! Modified RegFun call to avoid probs with long 'PREP_ReadInputFile.F90' names
157 !
158 ! Revision 1.5 2002/10/12 03:20:51 jblazek
159 ! Replaced [io]stat=global%error with local errorFlag for Rocflo.
160 !
161 ! Revision 1.4 2002/09/20 22:22:37 jblazek
162 ! Finalized integration into GenX.
163 !
164 ! Revision 1.3 2002/09/05 17:40:22 jblazek
165 ! Variable global moved into regions().
166 !
167 ! Revision 1.2 2002/02/21 23:25:07 jblazek
168 ! Blocks renamed as regions.
169 !
170 ! Revision 1.1 2002/01/02 15:57:08 jblazek
171 ! Added flow initialization.
172 !
173 !******************************************************************************
174 
175 
176 
177 
178 
179 
180 
181 
subroutine readmultigridsection(global)
CImg< T > & line(const unsigned int y0)
Get a line.
Definition: CImg.h:18421
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
int status() const
Obtain the status of the attribute.
Definition: Attribute.h:240
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 readtimestepsection(global)
subroutine readreferencesection(global)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469