Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SPEC_RFLU_ReadBcSectionDummy.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 condition for species for
26 ! patches which do not actually require any data.
27 !
28 ! Description: None.
29 !
30 ! Input:
31 ! pRegion Region pointer
32 !
33 ! Output: None.
34 !
35 ! Notes: This routine is necessary because the allocation of arrays related to
36 ! time-dependent boundary conditions requires that all patches have had their
37 ! values of nData initialized.
38 !
39 ! ******************************************************************************
40 !
41 ! $Id: SPEC_RFLU_ReadBcSectionDummy.F90,v 1.5 2008/12/06 08:44:40 mtcampbe Exp $
42 !
43 ! Copyright: (c) 2005 by the University of Illinois
44 !
45 ! ******************************************************************************
46 
47 SUBROUTINE spec_rflu_readbcsectiondummy(pRegion)
48 
49  USE moddatatypes
50  USE modbndpatch, ONLY: t_patch
51  USE moddatastruct, ONLY: t_region
52  USE modglobal, ONLY: t_global
53  USE modgrid, ONLY: t_grid
54  USE moderror
55  USE modparameters
56 
57  USE modinterfaces, ONLY: makenumberedkeys, &
59 
60  IMPLICIT NONE
61 
62 ! *****************************************************************************
63 ! Definitions and declarations
64 ! *****************************************************************************
65 
66 ! =============================================================================
67 ! Arguments
68 ! =============================================================================
69 
70  TYPE(t_region), POINTER :: pregion
71 
72 ! =============================================================================
73 ! Locals
74 ! =============================================================================
75 
76  CHARACTER(CHRLEN) :: bcname,rcsidentstring
77  CHARACTER(10), DIMENSION(:), ALLOCATABLE :: keys
78  CHARACTER(256) :: filename
79  LOGICAL, DIMENSION(:), ALLOCATABLE :: defined
80  INTEGER :: checksum,distrib,errorflag,ikey,ipatch,ipatchbeg,ipatchend, &
81  ireg,ival,nkeys
82  REAL(RFREAL), DIMENSION(:), ALLOCATABLE :: vals
83  TYPE(t_grid) :: grid
84  TYPE(t_patch), POINTER :: ppatch
85  TYPE(t_global), POINTER :: global
86 
87 ! *****************************************************************************
88 ! Start
89 ! *****************************************************************************
90 
91  rcsidentstring = '$RCSfile: SPEC_RFLU_ReadBcSectionDummy.F90,v $ $Revision: 1.5 $'
92 
93  global => pregion%global
94 
95  CALL registerfunction(global,'SPEC_RFLU_ReadBcSectionDummy',&
96  'SPEC_RFLU_ReadBcSectionDummy.F90')
97 
98 ! *****************************************************************************
99 ! Allocate memory
100 ! *****************************************************************************
101 
102  nkeys = pregion%specInput%nSpecies + 1 ! Add one because of default key
103 
104  ALLOCATE(keys(nkeys),stat=errorflag)
105  global%error = errorflag
106  IF ( global%error /= err_none ) THEN
107  CALL errorstop(global,err_allocate,__line__,'keys')
108  END IF ! global%error
109 
110  ALLOCATE(vals(nkeys),stat=errorflag)
111  global%error = errorflag
112  IF ( global%error /= err_none ) THEN
113  CALL errorstop(global,err_allocate,__line__,'vals')
114  END IF ! global%error
115 
116  ALLOCATE(defined(nkeys),stat=errorflag)
117  global%error = errorflag
118  IF ( global%error /= err_none ) THEN
119  CALL errorstop(global,err_allocate,__line__,'defined')
120  END IF ! global%error
121 
122 ! *****************************************************************************
123 ! Generate keys. NOTE first key is default key.
124 ! *****************************************************************************
125 
126  keys(1) = 'SPEC_'
127 
128  CALL makenumberedkeys(keys,2,'SPEC',1,nkeys,1)
129 
130 ! *****************************************************************************
131 ! Read section
132 ! *****************************************************************************
133 
134  CALL readpatchsection(global,if_input,nkeys,keys,vals,ipatchbeg,ipatchend, &
135  distrib,filename,bcname,defined)
136 
137 ! *****************************************************************************
138 ! Check if specified number of patches exceeds available ones
139 ! *****************************************************************************
140 
141  IF ( ipatchend > global%nPatches ) THEN
142  CALL errorstop(global,err_patch_range,__line__)
143  END IF ! iPatchEnd
144 
145 ! *****************************************************************************
146 ! Set options and check if all necessary values defined
147 ! *****************************************************************************
148 
149  DO ipatch = 1,pregion%grid%nPatches
150  ppatch => pregion%patches(ipatch)
151 
152 ! =============================================================================
153 ! Check whether this global patch exists in this region
154 ! =============================================================================
155 
156  IF ( ppatch%iPatchGlobal >= ipatchbeg .AND. &
157  ppatch%iPatchGlobal <= ipatchend ) THEN
158  ppatch%spec%nData = 0
159  ppatch%spec%nSwitches = 0
160  ppatch%spec%distrib = bcdat_constant
161  END IF ! pPatch%iPatchGlobal
162  END DO ! iPatch
163 
164 ! *****************************************************************************
165 ! Deallocate memory
166 ! *****************************************************************************
167 
168  DEALLOCATE(keys,stat=errorflag)
169  global%error = errorflag
170  IF ( global%error /= err_none ) THEN
171  CALL errorstop(global,err_deallocate,__line__,'keys')
172  END IF ! global%error
173 
174  DEALLOCATE(vals,stat=errorflag)
175  global%error = errorflag
176  IF ( global%error /= err_none ) THEN
177  CALL errorstop(global,err_deallocate,__line__,'vals')
178  END IF ! global%error
179 
180  DEALLOCATE(defined,stat=errorflag)
181  global%error = errorflag
182  IF ( global%error /= err_none ) THEN
183  CALL errorstop(global,err_deallocate,__line__,'defined')
184  END IF ! global%error
185 
186 ! *****************************************************************************
187 ! End
188 ! *****************************************************************************
189 
190  CALL deregisterfunction(global)
191 
192 END SUBROUTINE spec_rflu_readbcsectiondummy
193 
194 ! ******************************************************************************
195 !
196 ! RCS Revision history:
197 !
198 ! $Log: SPEC_RFLU_ReadBcSectionDummy.F90,v $
199 ! Revision 1.5 2008/12/06 08:44:40 mtcampbe
200 ! Updated license.
201 !
202 ! Revision 1.4 2008/11/19 22:17:53 mtcampbe
203 ! Added Illinois Open Source License/Copyright
204 !
205 ! Revision 1.3 2006/08/19 15:40:34 mparmar
206 ! Renamed patch variables
207 !
208 ! Revision 1.2 2006/04/07 15:19:25 haselbac
209 ! Removed tabs
210 !
211 ! Revision 1.1 2005/03/31 17:22:25 haselbac
212 ! Initial revision
213 !
214 ! ******************************************************************************
215 
216 
217 
218 
219 
220 
221 
subroutine makenumberedkeys(keys, indBegin, string, numBegin, numEnd, numSkip)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine readpatchsection(global, fileID, nvals, keys, vals, brbeg, brend, prbeg, prend, distrib, profType, fname, defined)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine grid(bp)
Definition: setup_py.f90:257
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine spec_rflu_readbcsectiondummy(pRegion)