Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_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: boundary condition file.
31 !
32 ! Output: regions = TBC data for all regions.
33 !
34 ! Notes: reads TBCs for all modules
35 !
36 !******************************************************************************
37 !
38 ! $Id: RFLO_ReadTbcInputFile.F90,v 1.3 2008/12/06 08:44:07 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2001 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE rflo_readtbcinputfile( 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+9) :: 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,'RFLO_ReadTbcInputFile',&
70  'RFLO_ReadTbcInputFile.F90' )
71 
72 ! open file
73 
74  WRITE(fname,'(A)') trim(global%inDir)//trim(global%casename)//'.bc'
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,&
79  __line__,'File: '//trim(fname) )
80 
81 ! read file looking for keywords
82 
83  DO
84  READ(if_input,'(A256)',err=10,end=86) line
85  SELECT CASE(trim(line))
86 
87  CASE ('# TBC_PIECEWISE')
88  CALL rflo_readtbcsection( regions, tbc_piecewise )
89 
90  CASE ('# TBC_SINUSOIDAL')
91  CALL rflo_readtbcsection( regions, tbc_sinusoidal )
92 
93  CASE ('# TBC_STOCHASTIC')
94  CALL rflo_readtbcsection( regions, tbc_stochastic )
95 
96  CASE ('# TBC_WHITENOISE')
97  CALL rflo_readtbcsection( regions, tbc_whitenoise )
98 
99  END SELECT
100  ENDDO
101 
102 86 CONTINUE
103 
104 ! close file ------------------------------------------------------------------
105 
106  CLOSE(if_input,iostat=errorflag)
107  global%error = errorflag
108  IF (global%error /= 0) &
109  CALL errorstop( global,err_file_close,&
110  __line__,'File: '//trim(fname) )
111 
112 ! finalization & error handling -----------------------------------------------
113 
114  CALL deregisterfunction( global )
115  goto 999
116 
117 10 CONTINUE
118  CALL errorstop( global,err_file_read,&
119  __line__,'File: '//trim(fname) )
120 
121 999 CONTINUE
122 
123 END SUBROUTINE rflo_readtbcinputfile
124 
125 !******************************************************************************
126 !
127 ! RCS Revision history:
128 !
129 ! $Log: RFLO_ReadTbcInputFile.F90,v $
130 ! Revision 1.3 2008/12/06 08:44:07 mtcampbe
131 ! Updated license.
132 !
133 ! Revision 1.2 2008/11/19 22:17:21 mtcampbe
134 ! Added Illinois Open Source License/Copyright
135 !
136 ! Revision 1.1 2004/11/29 21:25:17 wasistho
137 ! lower to upper case
138 !
139 ! Revision 1.7 2003/11/20 16:40:34 mdbrandy
140 ! Backing out RocfluidMP changes from 11-17-03
141 !
142 ! Revision 1.4 2003/06/10 22:54:42 jferry
143 ! Added Piecewise TBC
144 !
145 ! Revision 1.3 2003/05/15 02:57:01 jblazek
146 ! Inlined index function.
147 !
148 ! Revision 1.2 2003/02/26 23:38:30 jferry
149 ! eliminated end=999 convention to ensure that files get closed
150 !
151 ! Revision 1.1 2003/02/11 22:30:21 jferry
152 ! Re-worked BC and TBC input routines to add multi-physics capability
153 !
154 !
155 !******************************************************************************
156 
157 
158 
159 
160 
161 
162 
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 rflo_readtbcinputfile(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 rflo_readtbcsection(regions, tbcType)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469