62 TYPE(t_region
),
POINTER :: pregion
66 INTEGER :: c1g,c2g,errorflag,
i,iint,ic1l,ic2l,ifc,ifcp,ifun,ifunnz,
key,l, &
67 loopcounter,
m,
n,ncells,nfun,nfunnz,restartflag,vloc
68 REAL(RFREAL) :: normfact,normfactterm
70 TYPE(t_grid),
POINTER :: pgrid
77 global => pregion%global
80 'RFLU_ComputeIntegral4OLES.F90')
82 IF ( global%myProcid == masterproc .AND. &
83 global%verbLevel > verbose_low )
THEN
84 WRITE(stdout,
'(A,3X,A)') solver_name,
'Computing integral 4...'
106 errabsreq = 10.0_rfreal*epsilon(1.0_rfreal)
107 errrelreq = 5.0e-3_rfreal
113 maxcalls = max_calls_limit
118 ALLOCATE(integral(nfun),stat=errorflag)
119 global%error = errorflag
120 IF ( global%error /= err_none )
THEN
121 CALL
errorstop(global,err_allocate,__line__,
'integral')
124 ALLOCATE(workarray(workarraysize),stat=errorflag)
125 global%error = errorflag
126 IF ( global%error /= err_none )
THEN
127 CALL
errorstop(global,err_allocate,__line__,
'workArray')
134 normfactterm = 1.0_rfreal/(pgrid%deltaOLES**8)
141 ifc = pgrid%fp2fOLES(ifcp)
147 c1g = pgrid%f2c(1,ifc)
149 dummy = maxloc(abs(pgrid%fn(1:3,ifc)))
151 nzval = pgrid%fc(nzloc,ifc)
152 nzsgn = nint(pgrid%fn(nzloc,ifc))
157 IF (
m /= nzloc )
THEN
160 lowlim(
n) = pgrid%intLimOLES(int_lim_low,
m,c1g)
161 upplim(
n) = pgrid%intLimOLES(int_lim_upp,
m,c1g)
175 ncells =
SIZE(pgrid%fsOLES,1)
178 c1g = pgrid%fsOLES(ic1l,ifc)
180 lowlim(1) = pgrid%intLimOLES(int_lim_low,xcoord,c1g)
181 lowlim(2) = pgrid%intLimOLES(int_lim_low,ycoord,c1g)
182 lowlim(3) = pgrid%intLimOLES(int_lim_low,zcoord,c1g)
184 upplim(1) = pgrid%intLimOLES(int_lim_upp,xcoord,c1g)
185 upplim(2) = pgrid%intLimOLES(int_lim_upp,ycoord,c1g)
186 upplim(3) = pgrid%intLimOLES(int_lim_upp,zcoord,c1g)
189 c2g = pgrid%fsOLES(ic2l,ifc)
191 lowlim(4) = pgrid%intLimOLES(int_lim_low,xcoord,c2g)
192 lowlim(5) = pgrid%intLimOLES(int_lim_low,ycoord,c2g)
193 lowlim(6) = pgrid%intLimOLES(int_lim_low,zcoord,c2g)
195 upplim(4) = pgrid%intLimOLES(int_lim_upp,xcoord,c2g)
196 upplim(5) = pgrid%intLimOLES(int_lim_upp,ycoord,c2g)
197 upplim(6) = pgrid%intLimOLES(int_lim_upp,zcoord,c2g)
203 maxcalls = max_calls_start
206 integral(:) = 0.0_rfreal
207 integralnz(:) = 0.0_rfreal
209 DO loopcounter = 1,dcuhre_loop_limit
210 IF ( iint == 1 )
THEN
211 CALL dcuhre(ndim,nfunnz,lowlim,upplim,min_calls,maxcalls, &
213 key,workarraysize,restartflag,integralnz, &
214 errabsest,neval,errorflag,workarray)
215 ELSE IF ( iint == 2 )
THEN
216 CALL dcuhre(ndim,nfunnz,lowlim,upplim,min_calls,maxcalls, &
218 key,workarraysize,restartflag,integralnz, &
219 errabsest,neval,errorflag,workarray)
220 ELSE IF ( iint == 3 )
THEN
221 CALL dcuhre(ndim,nfunnz,lowlim,upplim,min_calls,maxcalls, &
223 key,workarraysize,restartflag,integralnz, &
224 errabsest,neval,errorflag,workarray)
227 IF ( errorflag == 0 .OR. loopcounter == dcuhre_loop_limit )
THEN
229 ELSE IF ( errorflag == 1 )
THEN
231 maxcalls = max_calls_factor*maxcalls
236 IF ( workarraysizenew > workarraysize )
THEN
240 CALL
errorstop(global,err_dcuhre_output,__line__)
246 IF ( iint == 1 )
THEN
247 normfact = normfactterm
248 ELSE IF ( iint == 2 )
THEN
249 normfact = normfactterm*const_kolmogorov/ &
250 (6.0_rfreal*pgrid%rhoOLES(ifc)**(2.0_rfreal/3.0_rfreal))
251 ELSE IF ( iint == 3 )
THEN
252 normfact = normfactterm*const_kolmogorov*const_kolmogorov/ &
253 (36.0_rfreal*pgrid%rhoOLES(ifc)**(4.0_rfreal/3.0_rfreal))
257 ifun = mapfunnz2funcorr43(ifunnz)
258 integral(ifun) = normfact*integralnz(ifunnz)
268 IF ( iint == 1 )
THEN
269 pgrid%int40OLES(
i,ifcp,vloc) = integral(ifun)
270 ELSE IF ( iint == 2 )
THEN
271 pgrid%int41OLES(
i,ifcp,vloc) = integral(ifun)
273 pgrid%int42OLES(
i,ifcp,vloc) = integral(ifun)
283 #ifdef CHECK_DATASTRUCT
285 WRITE(stdout,
'(A)') solver_name
286 WRITE(stdout,
'(A,1X,A)') solver_name,
'### START CHECK OUTPUT ###'
287 WRITE(stdout,
'(A,1X,A)') solver_name,
'Optimal LES I40 integral vector'
289 WRITE(stdout,
'(2(A,1X),I1)') solver_name,
'Component:',
i
291 WRITE(stdout,
'(A,3X,A,1X,I2)') solver_name,
'Face:',ifcp
292 DO vloc = 1,9*ncells*ncells
293 WRITE(stdout,
'(A,1X,I6,1X,E11.4)') solver_name,vloc, &
294 pgrid%int40OLES(
i,ifcp,vloc)
298 WRITE(stdout,
'(A,1X,A)') solver_name,
'Optimal LES I41 integral matrix'
300 WRITE(stdout,
'(2(A,1X),I1)') solver_name,
'Component:',
i
302 WRITE(stdout,
'(A,3X,A,1X,I2)') solver_name,
'Face:',ifcp
303 DO vloc = 1,9*ncells*ncells
304 WRITE(stdout,
'(A,1X,I6,1X,E11.4)') solver_name,vloc, &
305 pgrid%int41OLES(
i,ifcp,vloc)
309 WRITE(stdout,
'(A,1X,A)') solver_name,
'Optimal LES I42 integral matrix'
311 WRITE(stdout,
'(2(A,1X),I1)') solver_name,
'Component:',
i
313 WRITE(stdout,
'(A,3X,A,1X,I2)') solver_name,
'Face:',ifcp
314 DO vloc = 1,9*ncells*ncells
315 WRITE(stdout,
'(A,1X,I6,1X,E11.4)') solver_name,vloc, &
316 pgrid%int42OLES(
i,ifcp,vloc)
320 WRITE(stdout,
'(A,1X,A)') solver_name,
'### END CHECK OUTPUT ###'
321 WRITE(stdout,
'(A)') solver_name
331 DEALLOCATE(integral,stat=errorflag)
332 global%error = errorflag
333 IF ( global%error /= err_none )
THEN
334 CALL
errorstop(global,err_deallocate,__line__,
'integral')
337 DEALLOCATE(workarray,stat=errorflag)
338 global%error = errorflag
339 IF ( global%error /= err_none )
THEN
340 CALL
errorstop(global,err_deallocate,__line__,
'workArray')
subroutine rflu_computedcuhreinfo(global, NDIM, NF, KEY, MAXCLS, NW)
subroutine, public rflu_definecorrelation432(nDim, z, nFunNZ, f)
subroutine rflu_computeintegral4oles(pRegion)
subroutine, public rflu_definecorrelation430(nDim, z, nFunNZ, f)
subroutine registerfunction(global, funName, fileName)
subroutine rflu_allocatedcuhrearrays(nDim, nFunNZ, nFun)
subroutine, public rflu_definecorrelation431(nDim, z, nFunNZ, f)
subroutine rflu_deallocatedcuhrearrays
INTEGER function, public rflu_geti4posoles(l, m, d, e, nCells)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine, public rflu_mapl2ijk(l, i, j, k)
subroutine deregisterfunction(global)
subroutine, public rflu_setmapfunnz2funcorr43(nFunNZ)