Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_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 within TURB section (done on all processors).
26 !
27 ! Description: none.
28 !
29 ! Input: regions = user input file of all regions.
30 !
31 ! Output: regions = turbulence input parameters.
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: TURB_ReadInputFile.F90,v 1.7 2008/12/06 08:44:42 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2001 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE turb_readinputfile( regions )
44 
45  USE moddatatypes
46  USE moddatastruct, ONLY : t_region
47  USE modglobal, ONLY : t_global
49  USE modturbulence
50  USE moderror
51  USE modmpi
52  USE modparameters
53 
54  IMPLICIT NONE
55 
56 ! ... parameters
57  TYPE(t_region), POINTER :: regions(:)
58 
59 ! ... local variables
60  CHARACTER(CHRLEN) :: rcsidentstring
61  TYPE(t_global), POINTER :: global
62 
63  CHARACTER(2*CHRLEN+4) :: fname
64  CHARACTER(256) :: line
65  INTEGER :: errorflag
66 
67 !******************************************************************************
68 
69  rcsidentstring = '$RCSfile: TURB_ReadInputFile.F90,v $'
70 
71  global => regions(1)%global
72  CALL registerfunction( global,'TURB_ReadInputFile',&
73  'TURB_ReadInputFile.F90' )
74 
75 ! open file -------------------------------------------------------------------
76 
77  fname = trim(global%inDir)//trim(global%casename)//'.inp'
78  OPEN(if_input,file=fname,form='formatted',status='old',iostat=errorflag)
79  global%error = errorflag
80  IF (global%error /= 0) THEN
81  CALL errorstop( global,err_file_open,__line__,'File: '//trim(fname) )
82  ENDIF
83 
84 
85 ! read file looking for keywords
86 
87  DO
88  READ(if_input,'(A256)',err=10,end=86) line
89 
90  SELECT CASE(trim(line))
91  CASE ('# TURBULENCE')
92  CALL turb_readturbsection( regions )
93  END SELECT
94  ENDDO
95 
96 
97 86 CONTINUE
98 
99 ! close file ------------------------------------------------------------------
100 
101  CLOSE(if_input,iostat=errorflag)
102  global%error = errorflag
103  IF (global%error /= 0) &
104  CALL errorstop( global,err_file_close,__line__,'File: '//trim(fname) )
105 
106 ! finalization & error handling -----------------------------------------------
107 
108  goto 999
109 
110 10 CONTINUE
111  CALL errorstop( global,err_file_read,__line__,'File: '//trim(fname) )
112 
113 999 CONTINUE
114 
115  CALL deregisterfunction( global )
116 
117 END SUBROUTINE turb_readinputfile
118 
119 !******************************************************************************
120 !
121 ! RCS Revision history:
122 !
123 ! $Log: TURB_ReadInputFile.F90,v $
124 ! Revision 1.7 2008/12/06 08:44:42 mtcampbe
125 ! Updated license.
126 !
127 ! Revision 1.6 2008/11/19 22:17:54 mtcampbe
128 ! Added Illinois Open Source License/Copyright
129 !
130 ! Revision 1.5 2008/10/23 18:20:57 mtcampbe
131 ! Crazy number of changes to track and fix initialization and
132 ! restart bugs. Many improperly formed logical expressions
133 ! were fixed, and bug in allocation for data associated with
134 ! the BC_INFLOWVELTEMP boundary condition squashed in
135 ! RFLO_ReadBcInflowVelSection.F90.
136 !
137 ! Revision 1.4 2006/04/07 15:19:25 haselbac
138 ! Removed tabs
139 !
140 ! Revision 1.3 2006/02/04 04:59:19 wasistho
141 ! added enter and leave statements
142 !
143 ! Revision 1.2 2004/03/19 02:48:02 wasistho
144 ! prepared for RFLU
145 !
146 ! Revision 1.1 2004/03/05 04:37:00 wasistho
147 ! changed nomenclature
148 !
149 ! Revision 1.4 2003/02/26 23:38:30 jferry
150 ! eliminated end=999 convention to ensure that files get closed
151 !
152 ! Revision 1.3 2002/10/16 02:23:35 wasistho
153 ! Changed global%error flag
154 !
155 ! Revision 1.2 2002/10/16 00:06:04 jblazek
156 ! Added input directory to the file name.
157 !
158 ! Revision 1.1 2002/10/14 23:55:30 wasistho
159 ! Install Rocturb
160 !
161 !******************************************************************************
162 
163 
164 
165 
166 
167 
168 
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
**********************************************************************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 turb_readturbsection(regions)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine turb_readinputfile(regions)