Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TFLU_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 .inp file.
26 !
27 ! Description: none.
28 !
29 ! Input: regions
30 !
31 ! Output: all regions: - input and output grid format
32 ! - grid level
33 !
34 ! Notes: none.
35 !
36 !******************************************************************************
37 !
38 ! $Id: TFLU_ReadInputFile.F90,v 1.4 2008/12/06 08:44:53 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2001 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE readinputfile( regions )
45 
46  USE moddatatypes
47  USE moddatastruct, ONLY : t_region
48  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  'TFLU_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 ('# MULTIGRID')
89  CALL readmultigridsection( global )
90  END SELECT
91  ENDDO
92 
93  CLOSE(if_input,iostat=errorflag)
94  global%error = errorflag
95  IF (global%error /= 0) &
96  CALL errorstop( global,err_file_close,__line__,'File: '//trim(fname) )
97 
98  goto 999
99 
100 ! error handling
101 
102 10 CONTINUE
103  CALL errorstop( global,err_file_read,__line__,'File: '//trim(fname) )
104 
105 999 CONTINUE
106 
107  CALL deregisterfunction( global )
108 
109 END SUBROUTINE readinputfile
110 
111 !******************************************************************************
112 !
113 ! RCS Revision history:
114 !
115 ! $Log: TFLU_ReadInputFile.F90,v $
116 ! Revision 1.4 2008/12/06 08:44:53 mtcampbe
117 ! Updated license.
118 !
119 ! Revision 1.3 2008/11/19 22:18:03 mtcampbe
120 ! Added Illinois Open Source License/Copyright
121 !
122 ! Revision 1.2 2004/12/03 03:44:20 wasistho
123 ! rflo_modinterfacestoflu to tflu_modinterfaces
124 !
125 ! Revision 1.1 2004/12/03 02:59:30 wasistho
126 ! added prefix
127 !
128 ! Revision 1.1 2004/12/03 00:58:20 wasistho
129 ! lower to upper case
130 !
131 ! Revision 1.1.1.1 2004/08/17 01:41:39 wasistho
132 ! initial checkin
133 !
134 !
135 !******************************************************************************
136 
137 
138 
139 
140 
141 
142 
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 errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469