Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_ReadTbcInputFile.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 time-dependent boundary conditions
26 ! (done on all processors).
27 !
28 ! Description: None.
29 !
30 ! Input:
31 ! pRegion Pointer to region
32 !
33 ! Output: None.
34 !
35 ! Notes:
36 ! 1. Reads TBCs for all modules
37 !
38 ! ******************************************************************************
39 !
40 ! $Id: RFLU_ReadTbcInputFile.F90,v 1.5 2008/12/06 08:44:12 mtcampbe Exp $
41 !
42 ! Copyright: (c) 2003-2005 by the University of Illinois
43 !
44 ! ******************************************************************************
45 
46 SUBROUTINE rflu_readtbcinputfile(pRegion)
47 
48  USE moddatatypes
49  USE moddatastruct, ONLY: t_region
50  USE modglobal, ONLY: t_global
51  USE moderror
52  USE modparameters
53  USE modmpi
54 
56 
57  IMPLICIT NONE
58 
59 ! ******************************************************************************
60 ! Definitions and declarations
61 ! ******************************************************************************
62 
63 ! ==============================================================================
64 ! Arguments
65 ! ==============================================================================
66 
67  TYPE(t_region), POINTER :: pregion
68 
69 ! ==============================================================================
70 ! Locals
71 ! ==============================================================================
72 
73  CHARACTER(CHRLEN+9) :: fname
74  CHARACTER(256) :: line
75 
76  INTEGER :: errorflag,loopcounter
77 
78  TYPE(t_global), POINTER :: global
79 
80 ! ******************************************************************************
81 ! Start
82 ! ******************************************************************************
83 
84  global => pregion%global
85 
86  CALL registerfunction( global,'RFLU_ReadTbcInputFile',&
87  'RFLU_ReadTbcInputFile.F90' )
88 
89 ! ******************************************************************************
90 ! Open file
91 ! ******************************************************************************
92 
93  WRITE(fname,'(A)') trim(global%inDir)//trim(global%casename)//'.bc'
94  OPEN(if_input,file=fname,form='formatted',status='old',iostat=errorflag)
95  global%error = errorflag
96  IF (global%error /= 0) &
97  CALL errorstop( global,err_file_open,__line__,'File: '//trim(fname) )
98 
99 ! read file looking for keywords
100 
101  loopcounter = 0
102 
103  DO
104  READ(if_input,'(A256)',err=10) line
105 
106  SELECT CASE( trim(line) )
107 
108  CASE ('# TBC_PIECEWISE')
109  CALL rflu_readtbcsection( pregion, tbc_piecewise )
110 
111  CASE ('# TBC_SINUSOIDAL')
112  CALL rflu_readtbcsection( pregion, tbc_sinusoidal )
113 
114  CASE ('# TBC_STOCHASTIC')
115  CALL rflu_readtbcsection( pregion, tbc_stochastic )
116 
117  CASE ('# TBC_WHITENOISE')
118  CALL rflu_readtbcsection( pregion, tbc_whitenoise )
119 
120  CASE ('# END')
121  EXIT
122  END SELECT ! TRIM(line)
123 
124  loopcounter = loopcounter + 1 ! Prevent infinite loop
125  IF ( loopcounter >= limit_infinite_loop ) THEN
126  CALL errorstop(global,err_infinite_loop ,__line__)
127  END IF ! loopCounter
128  ENDDO ! <empty>
129 
130 ! close file
131 
132  CLOSE(if_input,iostat=errorflag)
133  global%error = errorflag
134  IF (global%error /= 0) THEN
135  CALL errorstop(global,err_file_close,__line__,'File: '//trim(fname))
136  END IF ! global%error
137 
138 ! finalization & error handling -----------------------------------------------
139 
140  goto 999
141 
142 ! error handling
143 
144 10 CONTINUE
145  CALL errorstop(global,err_file_read,__line__,'File: '//trim(fname))
146 
147 999 CONTINUE
148 
149  IF ( global%myProcid == masterproc .AND. &
150  global%verbLevel >= verbose_high ) THEN
151  WRITE(stdout,'(A,1X,A)') solver_name,'Reading Rocflu time-dependent '// &
152  'boundary condition file done.'
153  END IF ! global%verbLevel
154 
155 ! ******************************************************************************
156 ! End
157 ! ******************************************************************************
158 
159  CALL deregisterfunction(global)
160 
161 END SUBROUTINE rflu_readtbcinputfile
162 
163 ! ******************************************************************************
164 !
165 ! RCS Revision history:
166 !
167 ! $Log: RFLU_ReadTbcInputFile.F90,v $
168 ! Revision 1.5 2008/12/06 08:44:12 mtcampbe
169 ! Updated license.
170 !
171 ! Revision 1.4 2008/11/19 22:17:25 mtcampbe
172 ! Added Illinois Open Source License/Copyright
173 !
174 ! Revision 1.3 2005/04/27 02:08:02 haselbac
175 ! Cosmetics only
176 !
177 ! Revision 1.2 2003/06/10 22:54:42 jferry
178 ! Added Piecewise TBC
179 !
180 ! Revision 1.1 2003/06/04 20:05:54 jferry
181 ! re-worked implementation of TBCs in unstructured code
182 !
183 ! ******************************************************************************
184 
185 
186 
187 
188 
189 
190 
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 rflu_readtbcsection(pRegion, tbcType)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine rflu_readtbcinputfile(pRegion)
subroutine deregisterfunction(global)
Definition: ModError.F90:469