70 TYPE(t_region
),
POINTER :: pregion
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,ifc,ikey,ipatch,ipatchbeg,ipatchend, &
81 ireg,ival,nbfacestot,nkeys
82 REAL(RFREAL),
DIMENSION(:),
ALLOCATABLE :: vals
84 TYPE(t_patch),
POINTER :: ppatch
91 rcsidentstring =
'$RCSfile: SPEC_RFLU_ReadBcInjectSection.F90,v $ $Revision: 1.5 $'
93 global => pregion%global
96 'SPEC_RFLU_ReadBcInjectSection.F90')
102 nkeys = pregion%specInput%nSpecies + 1
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')
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')
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')
134 CALL
readpatchsection(global,if_input,nkeys,keys,vals,ipatchbeg,ipatchend, &
135 distrib,filename,bcname,defined)
141 IF ( ipatchend > global%nPatches )
THEN
142 CALL
errorstop(global,err_patch_range,__line__)
149 DO ipatch = 1,pregion%grid%nPatches
150 ppatch => pregion%patches(ipatch)
156 IF ( ppatch%iPatchGlobal >= ipatchbeg .AND. &
157 ppatch%iPatchGlobal <= ipatchend )
THEN
165 ppatch%spec%nData = pregion%specInput%nSpecies
166 ppatch%spec%nSwitches = 0
168 IF ( ppatch%bcCoupled == bc_burning )
THEN
169 ppatch%spec%distrib = bcdat_distrib
171 ppatch%spec%distrib = distrib
178 IF ( defined(1) .EQV. .false. )
THEN
182 IF ( defined(ikey) .EQV. .true. )
THEN
183 checksum = checksum + 1
187 IF ( checksum /= pregion%specInput%nSpecies )
THEN
188 CALL
errorstop(global,err_bcval_missing,__line__)
199 DO ipatch = 1,pregion%grid%nPatches
200 ppatch => pregion%patches(ipatch)
206 IF ( ppatch%iPatchGlobal >= ipatchbeg .AND. &
207 ppatch%iPatchGlobal <= ipatchend )
THEN
213 IF ( ppatch%spec%distrib == bcdat_distrib )
THEN
214 nbfacestot = ppatch%nBTrisTot + ppatch%nBQuadsTot
216 ALLOCATE(ppatch%spec%vals(ppatch%spec%nData,nbfacestot), &
218 global%error = errorflag
219 IF ( global%error /= 0 )
THEN
220 CALL
errorstop(global,err_allocate,__line__,
'pPatch%spec%vals')
225 IF ( ppatch%bcCoupled == bc_not_coupled )
THEN
226 CALL
errorstop(global,err_reached_default,__line__)
228 DO ifc = 1,nbfacestot
229 DO ival = 1,ppatch%spec%nData
230 ppatch%spec%vals(ival,ifc) = 0.0_rfreal
240 ALLOCATE(ppatch%spec%vals(ppatch%spec%nData,0:1), &
242 global%error = errorflag
243 IF ( global%error /= 0 )
THEN
244 CALL
errorstop(global,err_allocate,__line__,
'pPatch%spec%vals')
247 DO ival = 1,ppatch%spec%nData
248 IF ( defined(1+ival) .EQV. .true. )
THEN
249 ppatch%spec%vals(ival,0:1) = vals(1+ival)
251 ppatch%spec%vals(ival,0:1) = vals(1)
262 DEALLOCATE(keys,stat=errorflag)
263 global%error = errorflag
264 IF ( global%error /= err_none )
THEN
265 CALL
errorstop(global,err_deallocate,__line__,
'keys')
268 DEALLOCATE(vals,stat=errorflag)
269 global%error = errorflag
270 IF ( global%error /= err_none )
THEN
271 CALL
errorstop(global,err_deallocate,__line__,
'vals')
274 DEALLOCATE(defined,stat=errorflag)
275 global%error = errorflag
276 IF ( global%error /= err_none )
THEN
277 CALL
errorstop(global,err_deallocate,__line__,
'defined')
subroutine makenumberedkeys(keys, indBegin, string, numBegin, numEnd, numSkip)
subroutine registerfunction(global, funName, fileName)
subroutine readpatchsection(global, fileID, nvals, keys, vals, brbeg, brend, prbeg, prend, distrib, profType, fname, defined)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine spec_rflu_readbcinjectsection(pRegion)
subroutine deregisterfunction(global)