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,ikey,ipatch,ipatchbeg,ipatchend, &
82 REAL(RFREAL),
DIMENSION(:),
ALLOCATABLE :: vals
84 TYPE(t_patch),
POINTER :: ppatch
91 rcsidentstring =
'$RCSfile: SPEC_RFLU_ReadBcFarfSection.F90,v $ $Revision: 1.5 $'
93 global => pregion%global
96 'SPEC_RFLU_ReadBcFarfSection.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
163 ppatch%spec%nData = pregion%specInput%nSpecies
164 ppatch%spec%nSwitches = 0
165 ppatch%spec%distrib = distrib
171 IF ( defined(1) .EQV. .false. )
THEN
175 IF ( defined(ikey) .EQV. .true. )
THEN
176 checksum = checksum + 1
180 IF ( checksum /= pregion%specInput%nSpecies )
THEN
181 CALL
errorstop(global,err_bcval_missing,__line__)
192 DO ipatch = 1,pregion%grid%nPatches
193 ppatch => pregion%patches(ipatch)
199 IF ( ppatch%iPatchGlobal >= ipatchbeg .AND. &
200 ppatch%iPatchGlobal <= ipatchend )
THEN
206 IF ( ppatch%spec%distrib == bcdat_distrib )
THEN
217 ALLOCATE(ppatch%spec%vals(ppatch%spec%nData,0:1), &
219 global%error = errorflag
220 IF ( global%error /= 0 )
THEN
221 CALL
errorstop(global,err_allocate,__line__,
'pPatch%spec%vals')
224 DO ival = 1,ppatch%spec%nData
225 IF ( defined(1+ival) .EQV. .true. )
THEN
226 ppatch%spec%vals(ival,0:1) = vals(1+ival)
228 ppatch%spec%vals(ival,0:1) = vals(1)
239 DEALLOCATE(keys,stat=errorflag)
240 global%error = errorflag
241 IF ( global%error /= err_none )
THEN
242 CALL
errorstop(global,err_deallocate,__line__,
'keys')
245 DEALLOCATE(vals,stat=errorflag)
246 global%error = errorflag
247 IF ( global%error /= err_none )
THEN
248 CALL
errorstop(global,err_deallocate,__line__,
'vals')
251 DEALLOCATE(defined,stat=errorflag)
252 global%error = errorflag
253 IF ( global%error /= err_none )
THEN
254 CALL
errorstop(global,err_deallocate,__line__,
'defined')
subroutine makenumberedkeys(keys, indBegin, string, numBegin, numEnd, numSkip)
subroutine registerfunction(global, funName, fileName)
subroutine spec_rflu_readbcfarfsection(pRegion)
subroutine readpatchsection(global, fileID, nvals, keys, vals, brbeg, brend, prbeg, prend, distrib, profType, fname, defined)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)