69 TYPE(t_region
),
POINTER :: pregion
75 CHARACTER(CHRLEN) :: bcname,rcsidentstring
76 CHARACTER(10),
DIMENSION(:),
ALLOCATABLE :: keys
77 CHARACTER(256) :: filename
78 LOGICAL,
DIMENSION(:),
ALLOCATABLE :: defined
79 INTEGER :: checksum,distrib,errorflag,ikey,ipatch,ipatchbeg,ipatchend, &
81 REAL(RFREAL),
DIMENSION(:),
ALLOCATABLE :: vals
83 TYPE(t_patch),
POINTER :: ppatch
90 rcsidentstring =
'$RCSfile: SPEC_RFLU_ReadBcInflowSection.F90,v $ $Revision: 1.5 $'
92 global => pregion%global
95 'SPEC_RFLU_ReadBcInflowSection.F90')
101 nkeys = pregion%specInput%nSpecies + 1
103 ALLOCATE(keys(nkeys),stat=errorflag)
104 global%error = errorflag
105 IF ( global%error /= err_none )
THEN
106 CALL
errorstop(global,err_allocate,__line__,
'keys')
109 ALLOCATE(vals(nkeys),stat=errorflag)
110 global%error = errorflag
111 IF ( global%error /= err_none )
THEN
112 CALL
errorstop(global,err_allocate,__line__,
'vals')
115 ALLOCATE(defined(nkeys),stat=errorflag)
116 global%error = errorflag
117 IF ( global%error /= err_none )
THEN
118 CALL
errorstop(global,err_allocate,__line__,
'defined')
133 CALL
readpatchsection(global,if_input,nkeys,keys,vals,ipatchbeg,ipatchend, &
134 distrib,filename,bcname,defined)
140 IF ( ipatchend > global%nPatches )
THEN
141 CALL
errorstop(global,err_patch_range,__line__)
148 DO ipatch = 1,pregion%grid%nPatches
149 ppatch => pregion%patches(ipatch)
155 IF ( ppatch%iPatchGlobal >= ipatchbeg .AND. &
156 ppatch%iPatchGlobal <= ipatchend )
THEN
162 ppatch%spec%nData = pregion%specInput%nSpecies
163 ppatch%spec%nSwitches = 0
164 ppatch%spec%distrib = distrib
170 IF ( defined(1) .EQV. .false. )
THEN
174 IF ( defined(ikey) .EQV. .true. )
THEN
175 checksum = checksum + 1
179 IF ( checksum /= pregion%specInput%nSpecies )
THEN
180 CALL
errorstop(global,err_bcval_missing,__line__)
191 DO ipatch = 1,pregion%grid%nPatches
192 ppatch => pregion%patches(ipatch)
198 IF ( ppatch%iPatchGlobal >= ipatchbeg .AND. &
199 ppatch%iPatchGlobal <= ipatchend )
THEN
205 IF ( ppatch%spec%distrib == bcdat_distrib )
THEN
216 ALLOCATE(ppatch%spec%vals(ppatch%spec%nData,0:1), &
218 global%error = errorflag
219 IF ( global%error /= 0 )
THEN
220 CALL
errorstop(global,err_allocate,__line__,
'pPatch%spec%vals')
223 DO ival = 1,ppatch%spec%nData
224 IF ( defined(1+ival) .EQV. .true. )
THEN
225 ppatch%spec%vals(ival,0:1) = vals(1+ival)
227 ppatch%spec%vals(ival,0:1) = vals(1)
238 DEALLOCATE(keys,stat=errorflag)
239 global%error = errorflag
240 IF ( global%error /= err_none )
THEN
241 CALL
errorstop(global,err_deallocate,__line__,
'keys')
244 DEALLOCATE(vals,stat=errorflag)
245 global%error = errorflag
246 IF ( global%error /= err_none )
THEN
247 CALL
errorstop(global,err_deallocate,__line__,
'vals')
250 DEALLOCATE(defined,stat=errorflag)
251 global%error = errorflag
252 IF ( global%error /= err_none )
THEN
253 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 spec_rflu_readbcinflowsection(pRegion)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)