67 CHARACTER(CHRLEN),
PARAMETER,
PRIVATE :: &
68 RCSIdentString =
'$RCSfile: RFLU_ModExtractFlowDataUtils.F90,v $ $Revision: 1.4 $'
126 INTEGER,
INTENT(IN) :: icgbeg,icgend,ncellsx
127 REAL(RFREAL),
INTENT(OUT) :: xs
128 TYPE(t_region
),
POINTER :: pregion
134 INTEGER :: errorflag,icg,icl,icloffs,iclshock
136 REAL(RFREAL) :: idx,
r,rm1,rp1,rxx,rxxp1,
x,xp1
137 REAL(RFREAL),
DIMENSION(:),
ALLOCATABLE :: gradx,gradxx
138 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: pcv
140 TYPE(t_grid),
POINTER :: pgrid
146 global => pregion%global
149 'RFLU_ModExtractFlowDataUtils.F90')
155 pgrid => pregion%grid
156 pcv => pregion%mixt%cv
164 ALLOCATE(gradx(ncellsx-2),stat=errorflag)
165 global%error = errorflag
166 IF ( global%error /= err_none )
THEN
167 CALL
errorstop(global,err_allocate,__line__,
'gradx')
170 ALLOCATE(gradxx(ncellsx-2),stat=errorflag)
171 global%error = errorflag
172 IF ( global%error /= err_none )
THEN
173 CALL
errorstop(global,err_allocate,__line__,
'gradxx')
184 rp1 = pcv(cv_mixt_dens,icg+1)
185 r = pcv(cv_mixt_dens,icg )
186 rm1 = pcv(cv_mixt_dens,icg-1)
188 gradx(icl) = 0.5_rfreal*(rp1-rm1)
189 gradxx(icl) = rp1-2.0_rfreal*
r+rm1
192 dummy = maxloc(abs(gradx(1:ncellsx-2)))
204 IF ( (iclshock <= (ncellsx-icloffs-2)) .AND. &
205 (iclshock >= (icloffs+1)) )
THEN
206 DO icl = iclshock-icloffs,iclshock+icloffs-1
209 IF (
sign(1.0_rfreal,gradxx(icl)) /=
sign(1.0_rfreal,gradxx(icl+1)) )
THEN
210 rxxp1 = gradxx(icl+1)
213 xp1 = pgrid%cofg(xcoord,icg+1)
214 x = pgrid%cofg(xcoord,icg)
216 xs = (
x*rxxp1-xp1*rxx)/(rxxp1-rxx)
220 xs = pgrid%cofg(xcoord,icgbeg+iclshock)
227 DEALLOCATE(gradx,stat=errorflag)
228 global%error = errorflag
229 IF ( global%error /= err_none )
THEN
230 CALL
errorstop(global,err_deallocate,__line__,
'gradx')
233 DEALLOCATE(gradxx,stat=errorflag)
234 global%error = errorflag
235 IF ( global%error /= err_none )
THEN
236 CALL
errorstop(global,err_deallocate,__line__,
'gradxx')
static SURF_BEGIN_NAMESPACE double sign(double x)
subroutine registerfunction(global, funName, fileName)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)