Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SPEC_RFLU_ReadBcInputFile.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 boundary conditions for species
26 ! (done on all processors).
27 !
28 ! Description: None.
29 !
30 ! Input:
31 ! pRegion Pointer to region
32 !
33 ! Output: None.
34 !
35 ! Notes: None.
36 !
37 ! ******************************************************************************
38 !
39 ! $Id: SPEC_RFLU_ReadBcInputFile.F90,v 1.7 2008/12/06 08:44:40 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2003-2005 by the University of Illinois
42 !
43 ! ******************************************************************************
44 
45 SUBROUTINE spec_rflu_readbcinputfile(pRegion)
46 
47  USE moddatatypes
48  USE moddatastruct, ONLY: t_region
49  USE modglobal, ONLY: t_global
50  USE modgrid, ONLY: t_grid
51  USE modbndpatch, ONLY: t_patch
52  USE moderror
53  USE modparameters
54  USE modmpi
55 
57 
62 
63  IMPLICIT NONE
64 
65 ! ******************************************************************************
66 ! Definitions and declarations
67 ! ******************************************************************************
68 
69 ! ==============================================================================
70 ! Arguments
71 ! ==============================================================================
72 
73  TYPE(t_region), POINTER :: pregion
74 
75 ! ==============================================================================
76 ! Locals
77 ! ==============================================================================
78 
79  CHARACTER(CHRLEN) :: ifilename,rcsidentstring
80  CHARACTER(256) :: line
81  INTEGER :: errorflag,ipatch,loopcounter
82  TYPE(t_patch), POINTER :: ppatch
83  TYPE(t_grid) :: grid
84  TYPE(t_global), POINTER :: global
85 
86 ! ******************************************************************************
87 ! Start
88 ! ******************************************************************************
89 
90  rcsidentstring = '$RCSfile: SPEC_RFLU_ReadBcInputFile.F90,v $ $Revision: 1.7 $'
91 
92  global => pregion%global
93 
94  CALL registerfunction(global,'SPEC_RFLU_ReadBcInputFile',&
95  'SPEC_RFLU_ReadBcInputFile.F90')
96 
97 ! ******************************************************************************
98 ! Open file
99 ! ******************************************************************************
100 
101  CALL buildfilenameplain(global,filedest_indir,'.bc',ifilename)
102 
103  OPEN(if_input,file=ifilename,form='FORMATTED',status='OLD',iostat=errorflag)
104  global%error = errorflag
105  IF (global%error /= 0) THEN
106  CALL errorstop(global,err_file_open,__line__,'File: '//trim(ifilename))
107  END IF ! global%error
108 
109 ! ******************************************************************************
110 ! Read file looking for keywords
111 ! ******************************************************************************
112 
113  loopcounter = 0
114 
115  keywordloop: DO
116  READ(if_input,'(A256)',iostat=errorflag) line
117 
118  IF ( errorflag > 0 ) THEN ! Error occurred
119  CALL errorstop(global,err_file_read,__line__,'File: '//trim(ifilename))
120  ELSE IF ( errorflag < 0 ) THEN ! Encountered end of file
121  EXIT keywordloop
122  END IF ! errorFlag
123 
124  SELECT CASE( trim(line) )
125  CASE ('# BC_SLIPW')
126  CALL spec_rflu_readbcsectiondummy(pregion)
127  CASE ('# BC_NOSLIP')
128  CALL spec_rflu_readbcsectiondummy(pregion)
129 ! TEMPORARY - Keep this for backward compatibility
130  CASE ('# BC_INFLOW')
131  CALL spec_rflu_readbcinflowsection(pregion)
132 ! END TEMPORARY
133  CASE ('# BC_INFLOW_TOTANG')
134  CALL spec_rflu_readbcinflowsection(pregion)
135  CASE ('# BC_INFLOW_VELTEMP')
136  CALL spec_rflu_readbcinflowsection(pregion)
137  CASE ('# BC_OUTFLOW')
138  CALL spec_rflu_readbcsectiondummy(pregion)
139  CASE ('# BC_FARF')
140  CALL spec_rflu_readbcfarfsection(pregion)
141  CASE ('# BC_INJECT')
142  CALL spec_rflu_readbcinjectsection(pregion)
143  CASE ('# END')
144  EXIT
145  END SELECT ! TRIM(line)
146 
147  loopcounter = loopcounter + 1 ! Prevent infinite loop
148  IF ( loopcounter >= limit_infinite_loop ) THEN
149  CALL errorstop(global,err_infinite_loop ,__line__)
150  END IF ! loopCounter
151  END DO keywordloop
152 
153 ! ******************************************************************************
154 ! Close file
155 ! ******************************************************************************
156 
157  CLOSE(if_input,iostat=errorflag)
158  global%error = errorflag
159  IF (global%error /= 0) THEN
160  CALL errorstop(global,err_file_close,__line__,'File: '//trim(ifilename))
161  END IF ! global%error
162 
163 ! ******************************************************************************
164 ! End
165 ! ******************************************************************************
166 
167  CALL deregisterfunction(global)
168 
169 END SUBROUTINE spec_rflu_readbcinputfile
170 
171 ! ******************************************************************************
172 !
173 ! RCS Revision history:
174 !
175 ! $Log: SPEC_RFLU_ReadBcInputFile.F90,v $
176 ! Revision 1.7 2008/12/06 08:44:40 mtcampbe
177 ! Updated license.
178 !
179 ! Revision 1.6 2008/11/19 22:17:53 mtcampbe
180 ! Added Illinois Open Source License/Copyright
181 !
182 ! Revision 1.5 2006/04/07 15:19:25 haselbac
183 ! Removed tabs
184 !
185 ! Revision 1.4 2005/04/27 02:13:37 haselbac
186 ! Added routine to read INFLOW_VELTEMP
187 !
188 ! Revision 1.3 2005/03/31 17:20:03 haselbac
189 ! Fixed problem with crashes by reading with dummy routine
190 !
191 ! Revision 1.2 2004/06/16 20:01:23 haselbac
192 ! Added use of ModBuildFileNames, cosmetics
193 !
194 ! Revision 1.1 2003/11/25 21:08:37 haselbac
195 ! Initial revision
196 !
197 ! ******************************************************************************
198 
199 
200 
201 
202 
203 
204 
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 spec_rflu_readbcfarfsection(pRegion)
subroutine buildfilenameplain(global, dest, ext, fileName)
**********************************************************************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 spec_rflu_readbcinputfile(pRegion)
subroutine spec_rflu_readbcinflowsection(pRegion)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine spec_rflu_readbcinjectsection(pRegion)
subroutine grid(bp)
Definition: setup_py.f90:257
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine spec_rflu_readbcsectiondummy(pRegion)