Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_AllocateMemoryTbc.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: allocate memory for time-dependent boundary conditions
26 !
27 ! Description: none.
28 !
29 ! Input: none.
30 !
31 ! Output: none.
32 !
33 ! Notes: this cannot be called from RFLU_AllocateMemoryWrapper because it
34 ! requires that the BC input file has been read already
35 !
36 ! ******************************************************************************
37 !
38 ! $Id: RFLU_AllocateMemoryTbc.F90,v 1.11 2008/12/06 08:44:11 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2003-2004 by the University of Illinois
41 !
42 ! ******************************************************************************
43 
44 SUBROUTINE rflu_allocatememorytbc(pRegion)
45 
46  USE moddatatypes
47  USE moddatastruct, ONLY: t_region
48  USE modglobal, ONLY: t_global
49  USE modmixture, ONLY: t_mixt_input
50  USE modbndpatch, ONLY: t_patch,t_bcvalues
51  USE moderror
52  USE modparameters
53 
54  IMPLICIT NONE
55 
56 ! ******************************************************************************
57 ! Declarations and definitions
58 ! ******************************************************************************
59 
60 ! ==============================================================================
61 ! Arguments
62 ! ==============================================================================
63 
64  TYPE(t_region), POINTER :: pregion
65 
66 ! ==============================================================================
67 ! Locals
68 ! ==============================================================================
69 
70  INTEGER :: errorflag,ftype,ireg,ipatch,ilev
71  TYPE(t_global), POINTER :: global
72  TYPE(t_mixt_input), POINTER :: input
73  TYPE(t_patch), POINTER :: ppatch
74  TYPE(t_bcvalues), POINTER :: bc
75 
76 ! ******************************************************************************
77 ! Start
78 ! ******************************************************************************
79 
80  global => pregion%global
81 
82  CALL registerfunction( global,'RFLU_AllocateMemoryTbc',&
83  'RFLU_AllocateMemoryTbc.F90' )
84 
85 ! ******************************************************************************
86 ! Allocate TBCs
87 ! ******************************************************************************
88 
89  input => pregion%mixtInput
90 
91  DO ipatch = 1,pregion%grid%nPatches
92  ppatch => pregion%patches(ipatch)
93 
94  DO ftype = 1,ftype_max
95  SELECT CASE ( ftype )
96  CASE ( ftype_mixt )
97  bc => ppatch%mixt
98  CASE ( ftype_turb )
99  cycle
100  CASE ( ftype_plag )
101  cycle
102  CASE ( ftype_spec )
103  IF ( global%specUsed .EQV. .false. ) THEN
104  cycle
105  END IF ! global%specUsed
106 
107  bc => ppatch%spec
108  CASE ( ftype_radi )
109  IF ( input%radiUsed .EQV. .false. ) THEN
110  cycle
111  END IF ! input%radiUsed
112 
113  bc => ppatch%valRadi
114  CASE default ! Required because FTYPE_MAX includes PEUL
115  cycle
116  END SELECT ! fType
117 
118  IF ( bc%nData > 0 ) THEN
119  ALLOCATE(bc%tbcs(bc%nData),stat=errorflag)
120  global%error = errorflag
121  IF ( global%error /= err_none ) THEN
122  CALL errorstop( global,err_allocate,__line__ )
123  END IF ! global%error
124 
125  bc%tbcs(:)%tbcType = tbc_none
126  END IF ! bc%nData
127  END DO ! fType
128  END DO ! iPatch
129 
130 ! ******************************************************************************
131 ! End
132 ! ******************************************************************************
133 
134  CALL deregisterfunction( global )
135 
136 END SUBROUTINE rflu_allocatememorytbc
137 
138 ! ******************************************************************************
139 !
140 ! RCS Revision history:
141 !
142 ! $Log: RFLU_AllocateMemoryTbc.F90,v $
143 ! Revision 1.11 2008/12/06 08:44:11 mtcampbe
144 ! Updated license.
145 !
146 ! Revision 1.10 2008/11/19 22:17:24 mtcampbe
147 ! Added Illinois Open Source License/Copyright
148 !
149 ! Revision 1.9 2006/08/19 15:38:41 mparmar
150 ! Renamed patch variables
151 !
152 ! Revision 1.8 2006/04/07 15:19:15 haselbac
153 ! Removed tabs
154 !
155 ! Revision 1.7 2006/01/06 06:58:37 wasistho
156 ! cycled tbc for turbulence
157 !
158 ! Revision 1.6 2004/10/19 19:24:04 haselbac
159 ! Bug fix: Added CASE DEFAULT to deal with PEUL case
160 !
161 ! Revision 1.5 2004/07/28 15:29:19 jferry
162 ! created global variable for spec use
163 !
164 ! Revision 1.4 2004/07/23 22:43:15 jferry
165 ! Integrated rocspecies into rocinteract
166 !
167 ! Revision 1.3 2004/03/05 22:09:01 jferry
168 ! created global variables for peul, plag, and inrt use
169 !
170 ! Revision 1.2 2004/01/29 23:02:07 haselbac
171 ! Fixed bug: Use specUsed instead of specModel
172 !
173 ! Revision 1.1 2003/06/04 20:05:54 jferry
174 ! re-worked implementation of TBCs in unstructured code
175 !
176 ! ******************************************************************************
177 
178 
179 
180 
181 
182 
183 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflu_allocatememorytbc(pRegion)
subroutine input(X, NNODE, NDC, NCELL, NFCE, NBPTS, NBFACE, ITYP, NPROP, XBNDY, XFAR, YFAR, ZFAR)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469