21 double precision,
parameter :: weno_eps_machine = 1.0d-18
22 double precision,
parameter :: weno_dx_exp = 2.0d0/3.0d0
45 integer,
intent(in) :: ixi^
l, il^
l
46 double precision,
intent(in) :: wcin(ixi^s,1:nw)
47 double precision,
intent(inout) :: wcout(ixi^s,1:nw)
50 logical :: flagc(ixi^s,1:nw), flag(ixi^s)
61 flag(il^s)=flag(il^s).or.(flagc(il^s,iw))
66 where (flag(il^s) .eqv. .false.)
67 wcout(il^s,iw)=wcin(il^s,iw)
77 integer,
intent(in) :: ixi^
l, il^
l
78 double precision,
intent(in) :: wcin(ixi^s,1:nw)
79 double precision,
intent(inout) :: wcout(ixi^s,1:nw)
82 logical :: flagc(ixi^s,1:nw)
93 where (flagc(il^s,iw) .eqv. .false.)
94 wcout(il^s,iw)=wcin(il^s,iw)
104 integer,
intent(in) :: ixi^
l, il^
l
105 double precision,
intent(in) :: wrcin(ixi^s,1:nw),wlcin(ixi^s,1:nw)
106 double precision,
intent(inout) :: wrcout(ixi^s,1:nw),wlcout(ixi^s,1:nw)
109 logical :: flagl(ixi^s,1:nw), flagr(ixi^s,1:nw), flag(ixi^s)
122 flag(il^s)=flag(il^s).or.(flagl(il^s,iw).or.flagr(il^s,iw))
127 where (flag(il^s) .eqv. .false.)
128 wlcout(il^s,iw)=wlcin(il^s,iw)
129 wrcout(il^s,iw)=wrcin(il^s,iw)
139 integer,
intent(in) :: ixi^
l, il^
l
140 double precision,
intent(in) :: wrcin(ixi^s,1:nw),wlcin(ixi^s,1:nw)
141 double precision,
intent(inout) :: wrcout(ixi^s,1:nw),wlcout(ixi^s,1:nw)
144 logical :: flagl(ixi^s,1:nw), flagr(ixi^s,1:nw)
157 where ((flagl(il^s,iw) .eqv. .false.) .and. (flagr(il^s,iw) .eqv. .false.))
158 wlcout(il^s,iw)=wlcin(il^s,iw)
159 wrcout(il^s,iw)=wrcin(il^s,iw)
168 integer,
intent(in) :: ixi^
l, il^
l, idims, var
169 double precision,
intent(in) :: dxdim
170 double precision,
intent(in) :: w(ixi^s,1:nw)
171 double precision,
intent(inout) :: wrc(ixi^s,1:nw),wlc(ixi^s,1:nw)
173 integer :: ilm^
l, ilp^
l, ilpp^
l
174 double precision :: f_array(ixi^s,1:nw,2), d_array(2)
175 double precision :: beta(ixi^s,1:nw,2),tau(ixi^s,1:nw)
176 double precision :: u1_coeff(2), u2_coeff(2)
177 double precision :: alpha_array(ixi^s,1:nw,2), alpha_sum(ixi^s,1:nw), flux(ixi^s,1:nw)
180 double precision,
dimension(ixI^S,1:nw) :: wrctmp, wlctmp
183 ilm^
l=il^
l-
kr(idims,^
d);
184 ilp^
l=il^
l+
kr(idims,^
d);
185 ilpp^
l=ilp^
l+
kr(idims,^
d);
186 d_array(1:2) = (/ 1.0d0/3.0d0, 2.0d0/3.0d0 /)
187 u1_coeff(1:2) = (/ -1.d0/2.d0, 3.d0/2.d0 /)
188 u2_coeff(1:2) = (/ 1.d0/2.d0, 1.d0/2.d0 /)
191 f_array(il^s,1:nwflux,1) = u1_coeff(1) * w(ilm^s,1:nwflux) + u1_coeff(2) * w(il^s,1:nwflux)
192 f_array(il^s,1:nwflux,2) = u2_coeff(1) * w(il^s,1:nwflux) + u2_coeff(2) * w(ilp^s,1:nwflux)
194 beta(il^s,1:nwflux,1) = (w(il^s,1:nwflux) - w(ilm^s,1:nwflux))**2
195 beta(il^s,1:nwflux,2) = (w(ilp^s,1:nwflux) - w(il^s,1:nwflux))**2
197 alpha_sum(il^s,1:nwflux) = 0.0d0
201 alpha_array(il^s,1:nwflux,i) = d_array(i)/(beta(il^s,1:nwflux,i) + weno_eps_machine)**2
202 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
205 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,2) - beta(il^s,1:nwflux,1))
207 alpha_array(il^s,1:nwflux,i) = d_array(i) * (1.d0 + (tau(il^s,1:nwflux) / &
208 (beta(il^s,1:nwflux,i) + dxdim**2)))
209 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
213 flux(il^s,1:nwflux) = 0.0d0
215 flux(il^s,1:nwflux) = flux(il^s,1:nwflux) + f_array(il^s,1:nwflux,i) * alpha_array(il^s,1:nwflux,i)/(alpha_sum(il^s,1:nwflux))
219 wlctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
222 f_array(il^s,1:nwflux,1) = u1_coeff(1) * w(ilpp^s,1:nwflux) + u1_coeff(2) * w(ilp^s,1:nwflux)
223 f_array(il^s,1:nwflux,2) = u2_coeff(1) * w(ilp^s,1:nwflux) + u2_coeff(2) * w(il^s,1:nwflux)
225 beta(il^s,1:nwflux,1) = (w(ilpp^s,1:nwflux) - w(ilp^s,1:nwflux))**2
226 beta(il^s,1:nwflux,2) = (w(ilp^s,1:nwflux) - w(il^s,1:nwflux))**2
228 alpha_sum(il^s,1:nwflux) = 0.0d0
232 alpha_array(il^s,1:nwflux,i) = d_array(i)/(beta(il^s,1:nwflux,i) + weno_eps_machine)**2
233 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
236 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,2) - beta(il^s,1:nwflux,1))
238 alpha_array(il^s,1:nwflux,i) = d_array(i) * (1.d0 + (tau(il^s,1:nwflux) / &
239 (beta(il^s,1:nwflux,i) + dxdim**2)))
240 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
244 flux(il^s,1:nwflux) = 0.0d0
246 flux(il^s,1:nwflux) = flux(il^s,1:nwflux) + f_array(il^s,1:nwflux,i) * alpha_array(il^s,1:nwflux,i)/(alpha_sum(il^s,1:nwflux))
250 wrctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
259 integer,
intent(in) :: ixi^
l, il^
l, idims, var
260 double precision,
intent(in) :: dxdim
261 double precision,
intent(in) :: w(ixi^s,1:nw)
262 double precision,
intent(inout) :: wrc(ixi^s,1:nw),wlc(ixi^s,1:nw)
264 integer :: ilm^
l, ilmm^
l, ilp^
l, ilpp^
l, ilppp^
l
265 double precision :: f_array(ixi^s,1:nw,3), d_array(3)
266 double precision :: beta(ixi^s,1:nw,3), beta_coeff(2)
267 double precision :: tau(ixi^s,1:nw), tmp(ixi^s,1:nw)
268 double precision :: u1_coeff(3), u2_coeff(3), u3_coeff(3)
269 double precision :: alpha_array(ixi^s,1:nw,3), alpha_sum(ixi^s,1:nw), flux(ixi^s,1:nw)
271 double precision :: lambda
273 double precision,
dimension(ixI^S,1:nw) :: wrctmp, wlctmp
275 ilm^
l=il^
l-
kr(idims,^
d);
276 ilmm^
l=ilm^
l-
kr(idims,^
d);
277 ilp^
l=il^
l+
kr(idims,^
d);
278 ilpp^
l=ilp^
l+
kr(idims,^
d);
279 ilppp^
l=ilpp^
l+
kr(idims,^
d);
280 lambda = dxdim**weno_dx_exp
281 beta_coeff(1:2) = (/ 1.0833333333333333d0, 0.25d0/)
283 d_array(1:3) = (/ 1.0d0/10.0d0, 3.0d0/5.0d0, 3.0d0/10.0d0 /)
284 u1_coeff(1:3) = (/ 1.d0/3.d0, -7.d0/6.d0, 11.d0/6.d0 /)
285 u2_coeff(1:3) = (/ -1.d0/6.d0, 5.d0/6.d0, 1.d0/3.d0 /)
286 u3_coeff(1:3) = (/ 1.d0/3.d0, 5.d0/6.d0, -1.d0/6.d0 /)
294 f_array(il^s,1:nwflux,1) = u1_coeff(1) * w(ilmm^s,1:nwflux) + u1_coeff(2) * w(ilm^s,1:nwflux) + u1_coeff(3) * w(il^s,1:nwflux)
295 f_array(il^s,1:nwflux,2) = u2_coeff(1) * w(ilm^s,1:nwflux) + u2_coeff(2) * w(il^s,1:nwflux) + u2_coeff(3) * w(ilp^s,1:nwflux)
296 f_array(il^s,1:nwflux,3) = u3_coeff(1) * w(il^s,1:nwflux) + u3_coeff(2) * w(ilp^s,1:nwflux) + u3_coeff(3) * w(ilpp^s,1:nwflux)
298 beta(il^s,1:nwflux,1) = beta_coeff(1) * (w(ilmm^s,1:nwflux) + w(il^s,1:nwflux) - 2.0d0*w(ilm^s,1:nwflux))**2 &
299 + beta_coeff(2) * (w(ilmm^s,1:nwflux) - 4.0d0 * w(ilm^s,1:nwflux) + 3.0d0*w(il^s,1:nwflux))**2
300 beta(il^s,1:nwflux,2) = beta_coeff(1) * (w(ilm^s,1:nwflux) + w(ilp^s,1:nwflux) - 2.0d0 * w(il^s,1:nwflux))**2 &
301 + beta_coeff(2) * (w(ilm^s,1:nwflux) - w(ilp^s,1:nwflux))**2
302 beta(il^s,1:nwflux,3) = beta_coeff(1) * (w(il^s,1:nwflux) + w(ilpp^s,1:nwflux) - 2.0d0 * w(ilp^s,1:nwflux))**2 &
303 + beta_coeff(2) * (3.0d0 * w(il^s, 1:nwflux) - 4.0d0 * w(ilp^s,1:nwflux) + w(ilpp^s,1:nwflux))**2
309 alpha_array(il^s,1:nwflux,i) = d_array(i)/(beta(il^s,1:nwflux,i) + weno_eps_machine)**2
312 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3))
314 alpha_array(il^s,1:nwflux,i) = d_array(i) * (1.d0 + (tau(il^s,1:nwflux) / &
315 (beta(il^s,1:nwflux,i) + weno_eps_machine))**2)
318 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3))
320 tmp(il^s,1:nwflux) = (tau(il^s,1:nwflux) + weno_eps_machine) / (beta(il^s,1:nwflux,i) + weno_eps_machine)
321 alpha_array(il^s,1:nwflux,i) = d_array(i) * (1.0d0 + tmp(il^s,1:nwflux)**2 + lambda/tmp(il^s,1:nwflux))
325 alpha_sum(il^s,1:nwflux) = 0.0d0
327 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
329 flux(il^s,1:nwflux) = 0.0d0
331 flux(il^s,1:nwflux) = flux(il^s,1:nwflux) + f_array(il^s,1:nwflux,i) &
332 *alpha_array(il^s,1:nwflux,i)/(alpha_sum(il^s,1:nwflux))
334 wlctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
337 f_array(il^s,1:nwflux,1) = u1_coeff(1) * w(ilppp^s,1:nwflux) + u1_coeff(2) * w(ilpp^s,1:nwflux) + u1_coeff(3) * w(ilp^s,1:nwflux)
338 f_array(il^s,1:nwflux,2) = u2_coeff(1) * w(ilpp^s,1:nwflux) + u2_coeff(2) * w(ilp^s,1:nwflux) + u2_coeff(3) * w(il^s,1:nwflux)
339 f_array(il^s,1:nwflux,3) = u3_coeff(1) * w(ilp^s,1:nwflux) + u3_coeff(2) * w(il^s,1:nwflux) + u3_coeff(3) * w(ilm^s,1:nwflux)
341 beta(il^s,1:nwflux,1) = beta_coeff(1) * (w(ilppp^s,1:nwflux) + w(ilp^s,1:nwflux) - 2.0d0*w(ilpp^s,1:nwflux))**2 &
342 + beta_coeff(2) * (w(ilppp^s,1:nwflux) - 4.0d0 * w(ilpp^s,1:nwflux) + 3.0d0*w(ilp^s,1:nwflux))**2
343 beta(il^s,1:nwflux,2) = beta_coeff(1) * (w(ilpp^s,1:nwflux) + w(il^s,1:nwflux) - 2.0d0 * w(ilp^s,1:nwflux))**2 &
344 + beta_coeff(2) * (w(ilpp^s,1:nwflux) - w(il^s,1:nwflux))**2
345 beta(il^s,1:nwflux,3) = beta_coeff(1) * (w(ilp^s,1:nwflux) + w(ilm^s,1:nwflux) - 2.0d0 * w(il^s,1:nwflux))**2 &
346 + beta_coeff(2) * (3.0d0 * w(ilp^s, 1:nwflux) - 4.0d0 * w(il^s,1:nwflux) + w(ilm^s,1:nwflux))**2
351 alpha_array(il^s,1:nwflux,i) = d_array(i)/(beta(il^s,1:nwflux,i) + weno_eps_machine)**2
354 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3))
356 alpha_array(il^s,1:nwflux,i) = d_array(i) * (1.d0 + (tau(il^s,1:nwflux) / &
357 (beta(il^s,1:nwflux,i) + weno_eps_machine))**2)
360 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3))
362 tmp(il^s,1:nwflux) = (tau(il^s,1:nwflux) + weno_eps_machine) / (beta(il^s,1:nwflux,i) + weno_eps_machine)
363 alpha_array(il^s,1:nwflux,i) = d_array(i) * (1.0d0 + tmp(il^s,1:nwflux)**2 + lambda/tmp(il^s,1:nwflux))
367 alpha_sum(il^s,1:nwflux) = 0.0d0
370 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
372 flux(il^s,1:nwflux) = 0.0d0
374 flux(il^s,1:nwflux) = flux(il^s,1:nwflux) + f_array(il^s,1:nwflux,i) &
375 *alpha_array(il^s,1:nwflux,i)/(alpha_sum(il^s,1:nwflux))
377 wrctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
385 integer,
intent(in) :: ixi^
l, il^
l, idims
386 double precision,
intent(in) :: dxdim
387 double precision,
intent(in) :: w(ixi^s,1:nw)
388 double precision,
intent(inout) :: wrc(ixi^s,1:nw),wlc(ixi^s,1:nw)
390 integer :: ilm^
l, ilmm^
l, ilp^
l, ilpp^
l, ilppp^
l
391 double precision :: f_array(ixi^s,1:nw,3), d_array(3)
392 double precision :: beta(ixi^s,1:nw,3), beta_coeff(2)
393 double precision :: u1_coeff(3), u2_coeff(3), u3_coeff(3)
394 double precision :: gam_sum(ixi^s,1:nw),tau(ixi^s,1:nw),delta_sum(ixi^s,1:nw)
395 double precision :: gam(ixi^s,1:nw,3), kai(ixi^s,1:nw,3), delta(ixi^s,1:nw,3)
396 double precision :: flux(ixi^s,1:nw), kai1(ixi^s,1:nw,3), theta(ixi^s,1:nw)
397 integer :: marray(ixi^s,1:nw)
400 double precision,
dimension(ixI^S,1:nw) :: wrctmp, wlctmp
402 ilm^
l=il^
l-
kr(idims,^
d);
403 ilmm^
l=ilm^
l-
kr(idims,^
d);
404 ilp^
l=il^
l+
kr(idims,^
d);
405 ilpp^
l=ilp^
l+
kr(idims,^
d);
406 ilppp^
l=ilpp^
l+
kr(idims,^
d);
407 beta_coeff(1:2) = (/ 1.0833333333333333d0, 0.25d0/)
408 d_array(1:3) = (/ 1.0d0/10.0d0, 3.0d0/5.0d0, 3.0d0/10.0d0 /)
409 u1_coeff(1:3) = (/ 1.d0/3.d0, -7.d0/6.d0, 11.d0/6.d0 /)
410 u2_coeff(1:3) = (/ -1.d0/6.d0, 5.d0/6.d0, 1.d0/3.d0 /)
411 u3_coeff(1:3) = (/ 1.d0/3.d0, 5.d0/6.d0, -1.d0/6.d0 /)
414 f_array(il^s,1:nwflux,1) = u1_coeff(1) * w(ilmm^s,1:nwflux) + u1_coeff(2) * w(ilm^s,1:nwflux) + u1_coeff(3) * w(il^s,1:nwflux)
415 f_array(il^s,1:nwflux,2) = u2_coeff(1) * w(ilm^s,1:nwflux) + u2_coeff(2) * w(il^s,1:nwflux) + u2_coeff(3) * w(ilp^s,1:nwflux)
416 f_array(il^s,1:nwflux,3) = u3_coeff(1) * w(il^s,1:nwflux) + u3_coeff(2) * w(ilp^s,1:nwflux) + u3_coeff(3) * w(ilpp^s,1:nwflux)
418 beta(il^s,1:nwflux,1) = beta_coeff(1) * (w(ilmm^s,1:nwflux) + w(il^s,1:nwflux) - 2.0d0*w(ilm^s,1:nwflux))**2 &
419 + beta_coeff(2) * (w(ilmm^s,1:nwflux) - 4.0d0 * w(ilm^s,1:nwflux) + 3.0d0*w(il^s,1:nwflux))**2
420 beta(il^s,1:nwflux,2) = beta_coeff(1) * (w(ilm^s,1:nwflux) + w(ilp^s,1:nwflux) - 2.0d0 * w(il^s,1:nwflux))**2 &
421 + beta_coeff(2) * (w(ilm^s,1:nwflux) - w(ilp^s,1:nwflux))**2
422 beta(il^s,1:nwflux,3) = beta_coeff(1) * (w(il^s,1:nwflux) + w(ilpp^s,1:nwflux) - 2.0d0 * w(ilp^s,1:nwflux))**2 &
423 + beta_coeff(2) * (3.0d0 * w(il^s, 1:nwflux) - 4.0d0 * w(ilp^s,1:nwflux) + w(ilpp^s,1:nwflux))**2
425 gam_sum(il^s,1:nwflux) = 0.0d0
426 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3))
428 kai1(il^s,1:nwflux,i) = (tau(il^s,1:nwflux) / (beta(il^s,1:nwflux,i) + weno_eps_machine))
429 gam(il^s,1:nwflux,i) = (1.d0 + kai1(il^s,1:nwflux,i))**2
430 gam_sum(il^s,1:nwflux) = gam_sum(il^s,1:nwflux) + gam(il^s,1:nwflux,i)
432 theta(il^s,1:nwflux) = one / (one + maxval(kai1(il^s,1:nwflux,1:3)/10.d0, dim=
ndim+2))
433 marray(il^s,1:nwflux)=-floor(4.d0 + theta(il^s,1:nwflux)*6.d0)
435 kai(il^s,1:nwflux,i) = gam(il^s,1:nwflux,i) / gam_sum(il^s,1:nwflux)
436 where(kai(il^s,1:nwflux,i) .lt. 10**marray(il^s,1:nwflux))
437 delta(il^s,1:nwflux,i)=zero
439 delta(il^s,1:nwflux,i)=one
444 delta_sum(il^s,1:nwflux)=delta_sum(il^s,1:nwflux)+delta(il^s,1:nwflux,i)*d_array(i)
446 flux(il^s,1:nwflux)=0.0d0
448 flux(il^s,1:nwflux)=flux(il^s,1:nwflux)+f_array(il^s,1:nwflux,i)*delta(il^s,1:nwflux,i)*d_array(i)/(delta_sum(il^s,1:nwflux))
452 wlctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
455 f_array(il^s,1:nwflux,1) = u1_coeff(1) * w(ilppp^s,1:nwflux) + u1_coeff(2) * w(ilpp^s,1:nwflux) + u1_coeff(3) * w(ilp^s,1:nwflux)
456 f_array(il^s,1:nwflux,2) = u2_coeff(1) * w(ilpp^s,1:nwflux) + u2_coeff(2) * w(ilp^s,1:nwflux) + u2_coeff(3) * w(il^s,1:nwflux)
457 f_array(il^s,1:nwflux,3) = u3_coeff(1) * w(ilp^s,1:nwflux) + u3_coeff(2) * w(il^s,1:nwflux) + u3_coeff(3) * w(ilm^s,1:nwflux)
459 beta(il^s,1:nwflux,1) = beta_coeff(1) * (w(ilppp^s,1:nwflux) + w(ilp^s,1:nwflux) - 2.0d0*w(ilpp^s,1:nwflux))**2 &
460 + beta_coeff(2) * (w(ilppp^s,1:nwflux) - 4.0d0 * w(ilpp^s,1:nwflux) + 3.0d0*w(ilp^s,1:nwflux))**2
461 beta(il^s,1:nwflux,2) = beta_coeff(1) * (w(ilpp^s,1:nwflux) + w(il^s,1:nwflux) - 2.0d0 * w(ilp^s,1:nwflux))**2 &
462 + beta_coeff(2) * (w(ilpp^s,1:nwflux) - w(il^s,1:nwflux))**2
463 beta(il^s,1:nwflux,3) = beta_coeff(1) * (w(ilp^s,1:nwflux) + w(ilm^s,1:nwflux) - 2.0d0 * w(il^s,1:nwflux))**2 &
464 + beta_coeff(2) * (3.0d0 * w(ilp^s, 1:nwflux) - 4.0d0 * w(il^s,1:nwflux) + w(ilm^s,1:nwflux))**2
467 gam_sum(il^s,1:nwflux)=0.0d0
468 tau(il^s,1:nwflux)=abs(beta(il^s,1:nwflux,1)-beta(il^s,1:nwflux,3))
470 kai1(il^s,1:nwflux,i)=(tau(il^s,1:nwflux)/(beta(il^s,1:nwflux,i)+weno_eps_machine))
471 gam(il^s,1:nwflux,i)=(1.d0+kai1(il^s,1:nwflux,i))**6
472 gam_sum(il^s,1:nwflux)=gam_sum(il^s,1:nwflux)+gam(il^s,1:nwflux,i)
474 theta(il^s,1:nwflux)=one/(one+maxval(kai1(il^s,1:nwflux,1:3)/10.d0,dim=
ndim+2))
475 marray(il^s,1:nwflux)=-floor(4.d0+theta(il^s,1:nwflux)*6.d0)
477 kai(il^s,1:nwflux,i) = gam(il^s,1:nwflux,i)/gam_sum(il^s,1:nwflux)
478 where(kai(il^s,1:nwflux,i) .lt. 10**marray(il^s,1:nwflux))
479 delta(il^s,1:nwflux,i)=zero
481 delta(il^s,1:nwflux,i)=one
486 delta_sum(il^s,1:nwflux)=delta_sum(il^s,1:nwflux)+delta(il^s,1:nwflux,i)*d_array(i)
488 flux(il^s,1:nwflux)=0.0d0
490 flux(il^s,1:nwflux)=flux(il^s,1:nwflux)+f_array(il^s,1:nwflux,i)*delta(il^s,1:nwflux,i)*d_array(i)/(delta_sum(il^s,1:nwflux))
494 wrctmp(il^s,1:nwflux)=flux(il^s,1:nwflux)
503 integer,
intent(in) :: ixi^
l,il^
l,idims,var
504 double precision,
intent(in) :: dxdim
505 double precision,
intent(in) :: w(ixi^s,1:nw)
506 double precision,
intent(inout) :: wrc(ixi^s,1:nw),wlc(ixi^s,1:nw)
508 integer :: ilm^
l, ilmm^
l, ilp^
l, ilpp^
l, ilppp^
l
509 integer :: im^
l, imp^
l
510 double precision :: f_array(ixi^s,1:nw,3), d_array(3)
511 double precision :: beta(ixi^s,1:nw,3), beta_coeff(2)
512 double precision :: tau(ixi^s,1:nw), tmp(ixi^s,1:nw)
513 double precision :: u1_coeff(3), u2_coeff(3), u3_coeff(3)
514 double precision :: alpha_array(ixi^s,1:nw,3), alpha_sum(ixi^s,1:nw), flux(ixi^s,1:nw)
515 double precision :: wc(ixi^s,1:nw), wd(ixi^s,1:nw), we(ixi^s,1:nw)
517 double precision :: lambda(ixi^s)
519 double precision,
dimension(ixI^S,1:nw) :: wrctmp, wlctmp
521 ilm^
l=il^
l-
kr(idims,^
d);
522 ilmm^
l=ilm^
l-
kr(idims,^
d);
523 ilp^
l=il^
l+
kr(idims,^
d);
524 ilpp^
l=ilp^
l+
kr(idims,^
d);
525 ilppp^
l=ilpp^
l+
kr(idims,^
d);
528 imp^
l=im^
l+
kr(idims,^
d);
529 lambda(il^s)=
block%dx(il^s,idims)**weno_dx_exp
530 beta_coeff(1:2) = (/ 1.0833333333333333d0, 0.25d0/)
531 d_array(1:3) = (/ 1.0d0/10.0d0, 3.0d0/5.0d0, 3.0d0/10.0d0 /)
532 u1_coeff(1:3) = (/ -2.d0/3.d0, -1.d0/3.d0, 2.d0 /)
533 u2_coeff(1:3) = (/ -1.d0/3.d0, 2.d0/3.d0, 2.d0/3.d0 /)
534 u3_coeff(1:3) = (/ 2.d0/3.d0, 2.d0/3.d0, -1.d0/3.d0 /)
536 wc(im^s,i) = (
block%dx(imp^s,idims) * w(im^s,i) +
block%dx(im^s,idims) * w(imp^s,i)) / &
537 (
block%dx(imp^s,idims) +
block%dx(im^s,idims))
538 wd(il^s,i) = ((2.d0 *
block%dx(ilm^s,idims) +
block%dx(ilmm^s,idims)) * w(ilm^s,i) -
block%dx(ilm^s,idims) * w(ilmm^s,i)) / &
539 (
block%dx(ilmm^s,idims) +
block%dx(ilm^s,idims))
540 we(il^s,i) = ((2.d0 *
block%dx(ilpp^s,idims) +
block%dx(ilppp^s,idims)) * w(ilpp^s,i) -
block%dx(ilpp^s,idims) * w(ilppp^s,i)) / &
541 (
block%dx(ilppp^s,idims) +
block%dx(ilpp^s,idims))
544 f_array(il^s,1:nwflux,1) = u1_coeff(1) * wd(il^s,1:nwflux) + u1_coeff(2) * wc(ilm^s,1:nwflux)+ u1_coeff(3) * w(il^s,1:nwflux)
545 f_array(il^s,1:nwflux,2) = u2_coeff(1) * wc(ilm^s,1:nwflux) + u2_coeff(2) * w(il^s,1:nwflux) + u2_coeff(3) * wc(il^s,1:nwflux)
546 f_array(il^s,1:nwflux,3) = u3_coeff(1) * wc(il^s,1:nwflux) + u3_coeff(2) * w(ilp^s,1:nwflux) + u3_coeff(3) * wc(ilp^s,1:nwflux)
548 beta(il^s,1:nwflux,1) = beta_coeff(1) * (wc(ilm^s,1:nwflux) - wd(il^s,1:nwflux))**2 &
549 + beta_coeff(2) * (2.d0 * w(il^s,1:nwflux) - wc(ilm^s,1:nwflux) - wd(il^s,1:nwflux))**2
550 beta(il^s,1:nwflux,2) = beta_coeff(1) * (wc(ilm^s,1:nwflux) + wc(il^s,1:nwflux) - 2.0d0 * w(il^s,1:nwflux))**2 &
551 + beta_coeff(2) * (wc(ilm^s,1:nwflux) - wc(il^s,1:nwflux))**2
552 beta(il^s,1:nwflux,3) = beta_coeff(1) * (wc(il^s,1:nwflux) + wc(ilp^s,1:nwflux) - 2.0d0 * w(ilp^s,1:nwflux))**2 &
553 + beta_coeff(2) * (3.0d0 * wc(il^s, 1:nwflux) - 4.0d0 * w(ilp^s,1:nwflux) + wc(ilp^s,1:nwflux))**2
554 alpha_sum(il^s,1:nwflux) = 0.0d0
559 alpha_array(il^s,1:nwflux,i) = d_array(i)/(4.d0 * beta(il^s,1:nwflux,i) + weno_eps_machine)**2
560 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
563 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3)) * 4.d0
565 alpha_array(il^s,1:nwflux,i) = d_array(i) * (1.d0 + (tau(il^s,1:nwflux) / &
566 (4.d0 * beta(il^s,1:nwflux,i) + weno_eps_machine))**2)
567 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
570 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3)) * 4.d0
573 tmp(il^s,j) = (tau(il^s,j) + weno_eps_machine) / (4.d0 * beta(il^s,j,i) + weno_eps_machine)
574 alpha_array(il^s,j,i) = d_array(i) * (1.0d0 + tmp(il^s,j)**2 + lambda(il^s)/tmp(il^s,j))
575 alpha_sum(il^s,j) = alpha_sum(il^s,j) + alpha_array(il^s,j,i)
579 flux(il^s,1:nwflux) = 0.0d0
581 flux(il^s,1:nwflux) = flux(il^s,1:nwflux) + f_array(il^s,1:nwflux,i) * alpha_array(il^s,1:nwflux,i)/(alpha_sum(il^s,1:nwflux))
584 wlctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
587 f_array(il^s,1:nwflux,1) = u1_coeff(1) * we(il^s,1:nwflux) + u1_coeff(2) * wc(ilp^s,1:nwflux) + u1_coeff(3) * w(ilp^s,1:nwflux)
588 f_array(il^s,1:nwflux,2) = u2_coeff(1) * wc(ilp^s,1:nwflux) + u2_coeff(2) * w(ilp^s,1:nwflux) + u2_coeff(3) * wc(il^s,1:nwflux)
589 f_array(il^s,1:nwflux,3) = u3_coeff(1) * wc(il^s,1:nwflux) + u3_coeff(2) * w(il^s,1:nwflux) + u3_coeff(3) * wc(ilm^s,1:nwflux)
590 beta(il^s,1:nwflux,1) = beta_coeff(1) * (wc(ilp^s,1:nwflux) - we(il^s,1:nwflux))**2 &
591 + beta_coeff(2) * (2.d0 * w(ilp^s,1:nwflux) - wc(ilp^s,1:nwflux) - we(il^s,1:nwflux))**2
592 beta(il^s,1:nwflux,2) = beta_coeff(1) * (wc(ilp^s,1:nwflux) + wc(il^s,1:nwflux) - 2.0d0 * w(ilp^s,1:nwflux))**2 &
593 + beta_coeff(2) * (wc(ilp^s,1:nwflux) - wc(il^s,1:nwflux))**2
594 beta(il^s,1:nwflux,3) = beta_coeff(1) * (wc(il^s,1:nwflux) + wc(ilm^s,1:nwflux) - 2.0d0 * w(il^s,1:nwflux))**2 &
595 + beta_coeff(2) * (3.0d0 * wc(il^s, 1:nwflux) - 4.0d0 * w(il^s,1:nwflux) + wc(ilm^s,1:nwflux))**2
596 alpha_sum(il^s,1:nwflux) = 0.0d0
600 alpha_array(il^s,1:nwflux,i) = d_array(i)/(4.d0 * beta(il^s,1:nwflux,i) + weno_eps_machine)**2
601 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
604 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3)) * 4.d0
606 alpha_array(il^s,1:nwflux,i) = d_array(i) * (1.d0 + (tau(il^s,1:nwflux) / &
607 (4.d0 * beta(il^s,1:nwflux,i) + weno_eps_machine))**2)
608 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
611 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3)) * 4.d0
614 tmp(il^s,j) = (tau(il^s,j) + weno_eps_machine) / (4.d0 * beta(il^s,j,i) + weno_eps_machine)
615 alpha_array(il^s,j,i) = d_array(i) * (1.0d0 + tmp(il^s,j)**2 + lambda(il^s)/tmp(il^s,j))
616 alpha_sum(il^s,j) = alpha_sum(il^s,j) + alpha_array(il^s,j,i)
620 flux(il^s,1:nwflux) = 0.0d0
622 flux(il^s,1:nwflux) = flux(il^s,1:nwflux) + f_array(il^s,1:nwflux,i) * alpha_array(il^s,1:nwflux,i)/(alpha_sum(il^s,1:nwflux))
625 wrctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
634 integer,
intent(in) :: ixi^
l, il^
l, idims
635 integer,
intent(in) :: var
636 double precision,
intent(in) :: w(ixi^s,1:nw)
637 double precision,
intent(inout) :: wlc(ixi^s,1:nw)
639 integer :: ilm^
l, ilmm^
l, ilp^
l, ilpp^
l, ilppp^
l
640 double precision :: f_array(ixi^s,1:nw,3), d_array(3)
641 double precision :: beta(ixi^s,1:nw,3), beta_coeff(2)
642 double precision :: tau(ixi^s,1:nw), tmp(ixi^s,1:nw)
643 double precision :: u1_coeff(3), u2_coeff(3), u3_coeff(3)
644 double precision :: alpha_array(ixi^s,1:nw,3), alpha_sum(ixi^s,1:nw), flux(ixi^s,1:nw)
646 double precision :: lambda(ixi^s)
648 double precision,
dimension(ixI^S,1:nw) :: wlctmp
650 ilm^
l=il^
l-
kr(idims,^
d);
651 ilmm^
l=ilm^
l-
kr(idims,^
d);
652 ilp^
l=il^
l+
kr(idims,^
d);
653 ilpp^
l=ilp^
l+
kr(idims,^
d);
654 lambda=
block%dx(il^s,idims)**weno_dx_exp
655 beta_coeff(1:2) = (/ 1.0833333333333333d0, 0.25d0/)
657 d_array(1:3) = (/ 1.0d0/10.0d0, 3.0d0/5.0d0, 3.0d0/10.0d0 /)
658 u1_coeff(1:3) = (/ 1.d0/3.d0, -7.d0/6.d0, 11.d0/6.d0 /)
659 u2_coeff(1:3) = (/ -1.d0/6.d0, 5.d0/6.d0, 1.d0/3.d0 /)
660 u3_coeff(1:3) = (/ 1.d0/3.d0, 5.d0/6.d0, -1.d0/6.d0 /)
668 f_array(il^s,1:nwflux,1) = u1_coeff(1) * w(ilmm^s,1:nwflux) + u1_coeff(2) * w(ilm^s,1:nwflux) + u1_coeff(3) * w(il^s,1:nwflux)
669 f_array(il^s,1:nwflux,2) = u2_coeff(1) * w(ilm^s,1:nwflux) + u2_coeff(2) * w(il^s,1:nwflux) + u2_coeff(3) * w(ilp^s,1:nwflux)
670 f_array(il^s,1:nwflux,3) = u3_coeff(1) * w(il^s,1:nwflux) + u3_coeff(2) * w(ilp^s,1:nwflux) + u3_coeff(3) * w(ilpp^s,1:nwflux)
672 beta(il^s,1:nwflux,1) = beta_coeff(1) * (w(ilmm^s,1:nwflux) + w(il^s,1:nwflux) - 2.0d0*w(ilm^s,1:nwflux))**2 &
673 + beta_coeff(2) * (w(ilmm^s,1:nwflux) - 4.0d0 * w(ilm^s,1:nwflux) + 3.0d0*w(il^s,1:nwflux))**2
674 beta(il^s,1:nwflux,2) = beta_coeff(1) * (w(ilm^s,1:nwflux) + w(ilp^s,1:nwflux) - 2.0d0 * w(il^s,1:nwflux))**2 &
675 + beta_coeff(2) * (w(ilm^s,1:nwflux) - w(ilp^s,1:nwflux))**2
676 beta(il^s,1:nwflux,3) = beta_coeff(1) * (w(il^s,1:nwflux) + w(ilpp^s,1:nwflux) - 2.0d0 * w(ilp^s,1:nwflux))**2 &
677 + beta_coeff(2) * (3.0d0 * w(il^s, 1:nwflux) - 4.0d0 * w(ilp^s,1:nwflux) + w(ilpp^s,1:nwflux))**2
679 alpha_sum(il^s,1:nwflux) = 0.0d0
684 alpha_array(il^s,1:nwflux,i) = d_array(i)/(beta(il^s,1:nwflux,i) + weno_eps_machine)**2
685 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
688 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3))
690 alpha_array(il^s,1:nwflux,i) = d_array(i) * (1.d0 + (tau(il^s,1:nwflux) / &
691 (beta(il^s,1:nwflux,i) + weno_eps_machine))**2)
692 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
695 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3)) * 4.d0
698 tmp(il^s,j) = (tau(il^s,j) + weno_eps_machine) / (4.d0 * beta(il^s,j,i) + weno_eps_machine)
699 alpha_array(il^s,j,i) = d_array(i) * (1.0d0 + tmp(il^s,j)**2 + lambda(il^s)/tmp(il^s,j))
700 alpha_sum(il^s,j) = alpha_sum(il^s,j) + alpha_array(il^s,j,i)
704 flux(il^s,1:nwflux) = 0.0d0
706 flux(il^s,1:nwflux) = flux(il^s,1:nwflux) + f_array(il^s,1:nwflux,i) * alpha_array(il^s,1:nwflux,i)/(alpha_sum(il^s,1:nwflux))
710 wlctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
719 integer,
intent(in) :: ixi^
l, il^
l, idims
720 integer,
intent(in) :: var
721 double precision,
intent(in) :: w(ixi^s,1:nw)
722 double precision,
intent(inout) :: wrc(ixi^s,1:nw)
724 integer :: ilm^
l, ilmm^
l, ilp^
l, ilpp^
l, ilppp^
l
725 double precision :: f_array(ixi^s,1:nw,3), d_array(3)
726 double precision :: beta(ixi^s,1:nw,3), beta_coeff(2)
727 double precision :: tau(ixi^s,1:nw), tmp(ixi^s,1:nw)
728 double precision :: u1_coeff(3), u2_coeff(3), u3_coeff(3)
729 double precision :: alpha_array(ixi^s,1:nw,3), alpha_sum(ixi^s,1:nw), flux(ixi^s,1:nw)
731 double precision :: lambda(ixi^s)
733 double precision,
dimension(ixI^S,1:nw) :: wrctmp
735 ilm^
l=il^
l-
kr(idims,^
d);
736 ilp^
l=il^
l+
kr(idims,^
d);
737 ilpp^
l=ilp^
l+
kr(idims,^
d);
738 ilppp^
l=ilpp^
l+
kr(idims,^
d);
739 lambda=
block%dx(il^s,idims)**weno_dx_exp
740 beta_coeff(1:2) = (/ 1.0833333333333333d0, 0.25d0/)
742 d_array(1:3) = (/ 1.0d0/10.0d0, 3.0d0/5.0d0, 3.0d0/10.0d0 /)
743 u1_coeff(1:3) = (/ 1.d0/3.d0, -7.d0/6.d0, 11.d0/6.d0 /)
744 u2_coeff(1:3) = (/ -1.d0/6.d0, 5.d0/6.d0, 1.d0/3.d0 /)
745 u3_coeff(1:3) = (/ 1.d0/3.d0, 5.d0/6.d0, -1.d0/6.d0 /)
753 f_array(il^s,1:nwflux,1) = u1_coeff(1) * w(ilppp^s,1:nwflux) + u1_coeff(2) * w(ilpp^s,1:nwflux) + u1_coeff(3) * w(ilp^s,1:nwflux)
754 f_array(il^s,1:nwflux,2) = u2_coeff(1) * w(ilpp^s,1:nwflux) + u2_coeff(2) * w(ilp^s,1:nwflux) + u2_coeff(3) * w(il^s,1:nwflux)
755 f_array(il^s,1:nwflux,3) = u3_coeff(1) * w(ilp^s,1:nwflux) + u3_coeff(2) * w(il^s,1:nwflux) + u3_coeff(3) * w(ilm^s,1:nwflux)
757 beta(il^s,1:nwflux,1) = beta_coeff(1) * (w(ilppp^s,1:nwflux) + w(ilp^s,1:nwflux) - 2.0d0*w(ilpp^s,1:nwflux))**2 &
758 + beta_coeff(2) * (w(ilppp^s,1:nwflux) - 4.0d0 * w(ilpp^s,1:nwflux) + 3.0d0*w(ilp^s,1:nwflux))**2
759 beta(il^s,1:nwflux,2) = beta_coeff(1) * (w(ilpp^s,1:nwflux) + w(il^s,1:nwflux) - 2.0d0 * w(ilp^s,1:nwflux))**2 &
760 + beta_coeff(2) * (w(ilpp^s,1:nwflux) - w(il^s,1:nwflux))**2
761 beta(il^s,1:nwflux,3) = beta_coeff(1) * (w(ilp^s,1:nwflux) + w(ilm^s,1:nwflux) - 2.0d0 * w(il^s,1:nwflux))**2 &
762 + beta_coeff(2) * (3.0d0 * w(ilp^s, 1:nwflux) - 4.0d0 * w(il^s,1:nwflux) + w(ilm^s,1:nwflux))**2
764 alpha_sum(il^s,1:nwflux) = 0.0d0
768 alpha_array(il^s,1:nwflux,i) = d_array(i)/(beta(il^s,1:nwflux,i) + weno_eps_machine)**2
769 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
772 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3))
774 alpha_array(il^s,1:nwflux,i) = d_array(i) * (1.d0 + (tau(il^s,1:nwflux) / &
775 (beta(il^s,1:nwflux,i) + weno_eps_machine))**2)
776 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
779 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3)) * 4.d0
782 tmp(il^s,j) = (tau(il^s,j) + weno_eps_machine) / (4.d0 * beta(il^s,j,i) + weno_eps_machine)
783 alpha_array(il^s,j,i) = d_array(i) * (1.0d0 + tmp(il^s,j)**2 + lambda(il^s)/tmp(il^s,j))
784 alpha_sum(il^s,j) = alpha_sum(il^s,j) + alpha_array(il^s,j,i)
788 flux(il^s,1:nwflux) = 0.0d0
790 flux(il^s,1:nwflux) = flux(il^s,1:nwflux) + f_array(il^s,1:nwflux,i) * alpha_array(il^s,1:nwflux,i)/(alpha_sum(il^s,1:nwflux))
794 wrctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
803 integer,
intent(in) :: ixi^
l,il^
l,idims,var
804 double precision,
intent(in) :: w(ixi^s,1:nw)
805 double precision,
intent(inout) :: wlc(ixi^s,1:nw)
807 integer :: ilm^
l, ilmm^
l, ilp^
l, ilpp^
l
808 integer :: im^
l, imp^
l
809 double precision :: f_array(ixi^s,1:nw,3), d_array(3)
810 double precision :: beta(ixi^s,1:nw,3), beta_coeff(2)
811 double precision :: tau(ixi^s,1:nw), tmp(ixi^s,1:nw)
812 double precision :: u1_coeff(3), u2_coeff(3), u3_coeff(3)
813 double precision :: alpha_array(ixi^s,1:nw,3), alpha_sum(ixi^s,1:nw), flux(ixi^s,1:nw)
814 double precision :: wc(ixi^s,1:nw), wd(ixi^s,1:nw)
816 double precision :: lambda(ixi^s)
818 double precision,
dimension(ixI^S,1:nw) :: wlctmp
820 ilm^
l=il^
l-
kr(idims,^
d);
821 ilmm^
l=ilm^
l-
kr(idims,^
d);
822 ilp^
l=il^
l+
kr(idims,^
d);
823 ilpp^
l=ilp^
l+
kr(idims,^
d);
826 imp^
l=im^
l+
kr(idims,^
d);
827 lambda(il^s)=
block%dx(il^s,idims)**weno_dx_exp
828 beta_coeff(1:2) = (/ 1.0833333333333333d0, 0.25d0/)
829 d_array(1:3) = (/ 1.0d0/10.0d0, 3.0d0/5.0d0, 3.0d0/10.0d0 /)
830 u1_coeff(1:3) = (/ -2.d0/3.d0, -1.d0/3.d0, 2.d0 /)
831 u2_coeff(1:3) = (/ -1.d0/3.d0, 2.d0/3.d0, 2.d0/3.d0 /)
832 u3_coeff(1:3) = (/ 2.d0/3.d0, 2.d0/3.d0, -1.d0/3.d0 /)
834 wc(im^s,i) = (
block%dx(imp^s,idims) * w(im^s,i) +
block%dx(im^s,idims) * w(imp^s,i)) / &
835 (
block%dx(imp^s,idims) +
block%dx(im^s,idims))
836 wd(il^s,i) = ((2.d0 *
block%dx(ilm^s,idims) +
block%dx(ilmm^s,idims)) * w(ilm^s,i) -
block%dx(ilm^s,idims) * w(ilmm^s,i)) / &
837 (
block%dx(ilmm^s,idims) +
block%dx(ilm^s,idims))
839 f_array(il^s,1:nwflux,1) = u1_coeff(1) * wd(il^s,1:nwflux) + u1_coeff(2) * wc(ilm^s,1:nwflux)+ u1_coeff(3) * w(il^s,1:nwflux)
840 f_array(il^s,1:nwflux,2) = u2_coeff(1) * wc(ilm^s,1:nwflux) + u2_coeff(2) * w(il^s,1:nwflux) + u2_coeff(3) * wc(il^s,1:nwflux)
841 f_array(il^s,1:nwflux,3) = u3_coeff(1) * wc(il^s,1:nwflux) + u3_coeff(2) * w(ilp^s,1:nwflux) + u3_coeff(3) * wc(ilp^s,1:nwflux)
842 beta(il^s,1:nwflux,1) = beta_coeff(1) * (wc(ilm^s,1:nwflux) - wd(il^s,1:nwflux))**2 &
843 + beta_coeff(2) * (2.d0 * w(il^s,1:nwflux) - wc(ilm^s,1:nwflux) - wd(il^s,1:nwflux))**2
844 beta(il^s,1:nwflux,2) = beta_coeff(1) * (wc(ilm^s,1:nwflux) + wc(il^s,1:nwflux) - 2.0d0 * w(il^s,1:nwflux))**2 &
845 + beta_coeff(2) * (wc(ilm^s,1:nwflux) - wc(il^s,1:nwflux))**2
846 beta(il^s,1:nwflux,3) = beta_coeff(1) * (wc(il^s,1:nwflux) + wc(ilp^s,1:nwflux) - 2.0d0 * w(ilp^s,1:nwflux))**2 &
847 + beta_coeff(2) * (3.0d0 * wc(il^s, 1:nwflux) - 4.0d0 * w(ilp^s,1:nwflux) + wc(ilp^s,1:nwflux))**2
848 alpha_sum(il^s,1:nwflux) = 0.0d0
853 alpha_array(il^s,1:nwflux,i) = d_array(i)/(4.d0 * beta(il^s,1:nwflux,i) + weno_eps_machine)**2
854 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
857 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3)) * 4.d0
859 alpha_array(il^s,1:nwflux,i) = d_array(i) * (1.d0 + (tau(il^s,1:nwflux) / &
860 (4.d0 * beta(il^s,1:nwflux,i) + weno_eps_machine))**2)
861 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
864 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3)) * 4.d0
867 tmp(il^s,j) = (tau(il^s,j) + weno_eps_machine) / (4.d0 * beta(il^s,j,i) + weno_eps_machine)
868 alpha_array(il^s,j,i) = d_array(i) * (1.0d0 + tmp(il^s,j)**2 + lambda(il^s)/tmp(il^s,j))
869 alpha_sum(il^s,j) = alpha_sum(il^s,j) + alpha_array(il^s,j,i)
873 flux(il^s,1:nwflux) = 0.0d0
875 flux(il^s,1:nwflux) = flux(il^s,1:nwflux) + f_array(il^s,1:nwflux,i) * alpha_array(il^s,1:nwflux,i)/(alpha_sum(il^s,1:nwflux))
878 wlctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
887 integer,
intent(in) :: ixi^
l,il^
l,idims,var
888 double precision,
intent(in) :: w(ixi^s,1:nw)
889 double precision,
intent(inout) :: wrc(ixi^s,1:nw)
891 integer :: ilm^
l,ilp^
l,ilpp^
l,ilppp^
l
892 integer :: im^
l, imp^
l
893 double precision :: f_array(ixi^s,1:nw,3), d_array(3)
894 double precision :: beta(ixi^s,1:nw,3), beta_coeff(2)
895 double precision :: tau(ixi^s,1:nw), tmp(ixi^s,1:nw)
896 double precision :: u1_coeff(3), u2_coeff(3), u3_coeff(3)
897 double precision :: alpha_array(ixi^s,1:nw,3), alpha_sum(ixi^s,1:nw), flux(ixi^s,1:nw)
898 double precision :: wc(ixi^s,1:nw), we(ixi^s,1:nw)
900 double precision :: lambda(ixi^s)
902 double precision,
dimension(ixI^S,1:nw) :: wrctmp
904 ilm^
l=il^
l-
kr(idims,^
d);
905 ilp^
l=il^
l+
kr(idims,^
d);
906 ilpp^
l=ilp^
l+
kr(idims,^
d);
907 ilppp^
l=ilpp^
l+
kr(idims,^
d);
910 imp^
l=im^
l+
kr(idims,^
d);
911 lambda(il^s)=
block%dx(il^s,idims)**weno_dx_exp
912 beta_coeff(1:2) = (/ 1.0833333333333333d0, 0.25d0/)
913 d_array(1:3) = (/ 1.0d0/10.0d0, 3.0d0/5.0d0, 3.0d0/10.0d0 /)
914 u1_coeff(1:3) = (/ -2.d0/3.d0, -1.d0/3.d0, 2.d0 /)
915 u2_coeff(1:3) = (/ -1.d0/3.d0, 2.d0/3.d0, 2.d0/3.d0 /)
916 u3_coeff(1:3) = (/ 2.d0/3.d0, 2.d0/3.d0, -1.d0/3.d0 /)
918 wc(im^s,i) = (
block%dx(imp^s,idims) * w(im^s,i) +
block%dx(im^s,idims) * w(imp^s,i)) / &
919 (
block%dx(imp^s,idims) +
block%dx(im^s,idims))
920 we(il^s,i) = ((2.d0 *
block%dx(ilpp^s,idims) +
block%dx(ilppp^s,idims)) * w(ilpp^s,i) -
block%dx(ilpp^s,idims) * w(ilppp^s,i)) / &
921 (
block%dx(ilppp^s,idims) +
block%dx(ilpp^s,idims))
924 f_array(il^s,1:nwflux,1) = u1_coeff(1) * we(il^s,1:nwflux) + u1_coeff(2) * wc(ilp^s,1:nwflux) + u1_coeff(3) * w(ilp^s,1:nwflux)
925 f_array(il^s,1:nwflux,2) = u2_coeff(1) * wc(ilp^s,1:nwflux) + u2_coeff(2) * w(ilp^s,1:nwflux) + u2_coeff(3) * wc(il^s,1:nwflux)
926 f_array(il^s,1:nwflux,3) = u3_coeff(1) * wc(il^s,1:nwflux) + u3_coeff(2) * w(il^s,1:nwflux) + u3_coeff(3) * wc(ilm^s,1:nwflux)
927 beta(il^s,1:nwflux,1) = beta_coeff(1) * (wc(ilp^s,1:nwflux) - we(il^s,1:nwflux))**2 &
928 + beta_coeff(2) * (2.d0 * w(ilp^s,1:nwflux) - wc(ilp^s,1:nwflux) - we(il^s,1:nwflux))**2
929 beta(il^s,1:nwflux,2) = beta_coeff(1) * (wc(ilp^s,1:nwflux) + wc(il^s,1:nwflux) - 2.0d0 * w(ilp^s,1:nwflux))**2 &
930 + beta_coeff(2) * (wc(ilp^s,1:nwflux) - wc(il^s,1:nwflux))**2
931 beta(il^s,1:nwflux,3) = beta_coeff(1) * (wc(il^s,1:nwflux) + wc(ilm^s,1:nwflux) - 2.0d0 * w(il^s,1:nwflux))**2 &
932 + beta_coeff(2) * (3.0d0 * wc(il^s, 1:nwflux) - 4.0d0 * w(il^s,1:nwflux) + wc(ilm^s,1:nwflux))**2
933 alpha_sum(il^s,1:nwflux) = 0.0d0
937 alpha_array(il^s,1:nwflux,i) = d_array(i)/(4.d0 * beta(il^s,1:nwflux,i) + weno_eps_machine)**2
938 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
941 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3)) * 4.d0
943 alpha_array(il^s,1:nwflux,i) = d_array(i) * (1.d0 + (tau(il^s,1:nwflux) / &
944 (4.d0 * beta(il^s,1:nwflux,i) + weno_eps_machine))**2)
945 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
948 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3)) * 4.d0
951 tmp(il^s,j) = (tau(il^s,j) + weno_eps_machine) / (4.d0 * beta(il^s,j,i) + weno_eps_machine)
952 alpha_array(il^s,j,i) = d_array(i) * (1.0d0 + tmp(il^s,j)**2 + lambda(il^s)/tmp(il^s,j))
953 alpha_sum(il^s,j) = alpha_sum(il^s,j) + alpha_array(il^s,j,i)
957 flux(il^s,1:nwflux) = 0.0d0
959 flux(il^s,1:nwflux) = flux(il^s,1:nwflux) + f_array(il^s,1:nwflux,i) * alpha_array(il^s,1:nwflux,i)/(alpha_sum(il^s,1:nwflux))
962 wrctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
971 integer,
intent(in) :: ixi^
l, il^
l, idims
972 double precision,
intent(in) :: w(ixi^s,1:nw)
973 double precision,
intent(inout) :: wrc(ixi^s,1:nw),wlc(ixi^s,1:nw)
975 integer :: ilm^
l, ilmm^
l, ilp^
l, ilpp^
l, ilppp^
l
976 double precision :: f_array(ixi^s,1:nw,3), d_array(3)
977 double precision :: beta(ixi^s,1:nw,3), beta_coeff(2)
978 double precision :: u1_coeff(3), u2_coeff(3), u3_coeff(3)
979 double precision :: alpha_array(ixi^s,1:nw,3), alpha_sum(ixi^s,1:nw)
980 double precision :: theta2(ixi^s,1:nw)
982 double precision,
parameter :: theta_limit=0.7d0
984 double precision,
dimension(ixI^S,1:nw) :: wrctmp, wlctmp
986 ilm^
l=il^
l-
kr(idims,^
d);
987 ilmm^
l=ilm^
l-
kr(idims,^
d);
988 ilp^
l=il^
l+
kr(idims,^
d);
989 ilpp^
l=ilp^
l+
kr(idims,^
d);
990 ilppp^
l=ilpp^
l+
kr(idims,^
d);
992 beta_coeff(1:2) = (/ 1.0833333333333333d0, 0.25d0/)
993 d_array(1:3) = (/ 1.0d0/10.0d0, 3.0d0/5.0d0, 3.0d0/10.0d0 /)
994 u1_coeff(1:3) = (/ 1.d0/3.d0, -7.d0/6.d0, 11.d0/6.d0 /)
995 u2_coeff(1:3) = (/ -1.d0/6.d0, 5.d0/6.d0, 1.d0/3.d0 /)
996 u3_coeff(1:3) = (/ 1.d0/3.d0, 5.d0/6.d0, -1.d0/6.d0 /)
999 beta(il^s,1:nwflux,1)=beta_coeff(1)*(w(ilmm^s,1:nwflux)+w(il^s,1:nwflux)-2.0d0*w(ilm^s,1:nwflux))**2&
1000 +beta_coeff(2)*(w(ilmm^s,1:nwflux)-4.0d0*w(ilm^s,1:nwflux)+3.0d0*w(il^s,1:nwflux))**2
1001 beta(il^s,1:nwflux,2)=beta_coeff(1)*(w(ilm^s,1:nwflux)+w(ilp^s,1:nwflux)-2.0d0*w(il^s,1:nwflux))**2&
1002 +beta_coeff(2)*(w(ilm^s,1:nwflux)-w(ilp^s,1:nwflux))**2
1003 beta(il^s,1:nwflux,3)=beta_coeff(1)*(w(il^s,1:nwflux)+w(ilpp^s,1:nwflux)-2.0d0*w(ilp^s,1:nwflux))**2&
1004 +beta_coeff(2)*(3.0d0*w(il^s,1:nwflux)-4.0d0*w(ilp^s,1:nwflux)+w(ilpp^s,1:nwflux))**2
1005 alpha_sum(il^s,1:nwflux)=zero
1007 alpha_array(il^s,1:nwflux,i)=d_array(i)/(beta(il^s,1:nwflux,i)+weno_eps_machine)**2
1008 alpha_sum(il^s,1:nwflux)=alpha_sum(il^s,1:nwflux)+alpha_array(il^s,1:nwflux,i)
1011 alpha_array(il^s,1:nwflux,i)=alpha_array(il^s,1:nwflux,i)/alpha_sum(il^s,1:nwflux)
1013 theta2(il^s,1:nwflux)=((alpha_array(il^s,1:nwflux,1)/d_array(1)-1.d0)**2&
1014 +(alpha_array(il^s,1:nwflux,2)/d_array(2)-1.d0)**2&
1015 +(alpha_array(il^s,1:nwflux,3)/d_array(3)-1.d0)**2)/83.d0
1016 where(theta2(il^s,1:nwflux) .gt. theta_limit)
1017 f_array(il^s,1:nwflux,1)=u1_coeff(1)*w(ilmm^s,1:nwflux)+u1_coeff(2)*w(ilm^s,1:nwflux)+u1_coeff(3)*w(il^s,1:nwflux)
1018 f_array(il^s,1:nwflux,2)=u2_coeff(1)*w(ilm^s,1:nwflux)+u2_coeff(2)*w(il^s,1:nwflux)+u2_coeff(3)*w(ilp^s,1:nwflux)
1019 f_array(il^s,1:nwflux,3)=u3_coeff(1)*w(il^s,1:nwflux)+u3_coeff(2)*w(ilp^s,1:nwflux)+u3_coeff(3)*w(ilpp^s,1:nwflux)
1020 wlctmp(il^s,1:nwflux)=f_array(il^s,1:nwflux,1)*alpha_array(il^s,1:nwflux,1)&
1021 +f_array(il^s,1:nwflux,2)*alpha_array(il^s,1:nwflux,2)&
1022 +f_array(il^s,1:nwflux,3)*alpha_array(il^s,1:nwflux,3)
1024 wlctmp(il^s,1:nwflux)=1.d0/60.d0*(w(ilmm^s,1:nwflux)-8.d0*w(ilm^s,1:nwflux)+37.d0*w(il^s,1:nwflux)&
1025 +37.d0*w(ilp^s,1:nwflux)-8.d0*w(ilpp^s,1:nwflux)+w(ilppp^s,1:nwflux))
1029 beta(il^s,1:nwflux,1)=beta_coeff(1)*(w(ilppp^s,1:nwflux)+w(ilp^s,1:nwflux)-2.0d0*w(ilpp^s,1:nwflux))**2&
1030 +beta_coeff(2)*(w(ilppp^s,1:nwflux)-4.0d0*w(ilpp^s,1:nwflux)+3.0d0*w(ilp^s,1:nwflux))**2
1031 beta(il^s,1:nwflux,2)=beta_coeff(1)*(w(ilpp^s,1:nwflux)+w(il^s,1:nwflux)-2.0d0*w(ilp^s,1:nwflux))**2&
1032 +beta_coeff(2)*(w(ilpp^s,1:nwflux)-w(il^s,1:nwflux))**2
1033 beta(il^s,1:nwflux,3)=beta_coeff(1)*(w(ilp^s,1:nwflux)+w(ilm^s,1:nwflux)-2.0d0*w(il^s,1:nwflux))**2&
1034 +beta_coeff(2)*(3.0d0*w(ilp^s,1:nwflux)-4.0d0*w(il^s,1:nwflux)+w(ilm^s,1:nwflux))**2
1035 alpha_sum(il^s,1:nwflux)=zero
1037 alpha_array(il^s,1:nwflux,i)=d_array(i)/(beta(il^s,1:nwflux,i)+weno_eps_machine)**2
1038 alpha_sum(il^s,1:nwflux)=alpha_sum(il^s,1:nwflux)+alpha_array(il^s,1:nwflux,i)
1041 alpha_array(il^s,1:nwflux,i)=alpha_array(il^s,1:nwflux,i)/alpha_sum(il^s,1:nwflux)
1043 theta2(il^s,1:nwflux)=((alpha_array(il^s,1:nwflux,1)/d_array(1)-1.d0)**2&
1044 +(alpha_array(il^s,1:nwflux,2)/d_array(2)-1.d0)**2&
1045 +(alpha_array(il^s,1:nwflux,3)/d_array(3)-1.d0)**2)/83.d0
1046 where(theta2(il^s,1:nwflux) .gt. theta_limit)
1047 f_array(il^s,1:nwflux,1)=u1_coeff(1)*w(ilppp^s,1:nwflux)+u1_coeff(2)*w(ilpp^s,1:nwflux)+u1_coeff(3)*w(ilp^s,1:nwflux)
1048 f_array(il^s,1:nwflux,2)=u2_coeff(1)*w(ilpp^s,1:nwflux)+u2_coeff(2)*w(ilp^s,1:nwflux)+u2_coeff(3)*w(il^s,1:nwflux)
1049 f_array(il^s,1:nwflux,3)=u3_coeff(1)*w(ilp^s,1:nwflux)+u3_coeff(2)*w(il^s,1:nwflux)+u3_coeff(3)*w(ilm^s,1:nwflux)
1050 wrctmp(il^s,1:nwflux)=f_array(il^s,1:nwflux,1)*alpha_array(il^s,1:nwflux,1)&
1051 +f_array(il^s,1:nwflux,2)*alpha_array(il^s,1:nwflux,2)&
1052 +f_array(il^s,1:nwflux,3)*alpha_array(il^s,1:nwflux,3)
1054 wrctmp(il^s,1:nwflux)=1.d0/60.d0*(w(ilppp^s,1:nwflux)-8.d0*w(ilpp^s,1:nwflux)+37.d0*w(ilp^s,1:nwflux)&
1055 +37.d0*w(il^s,1:nwflux)-8.d0*w(ilm^s,1:nwflux)+w(ilmm^s,1:nwflux))
1065 integer,
intent(in) :: ixi^
l, il^
l, idims, var
1066 double precision,
intent(in) :: w(ixi^s,1:nw)
1067 double precision,
intent(inout) :: wrc(ixi^s,1:nw),wlc(ixi^s,1:nw)
1069 integer :: ilm^
l, ilmm^
l, ilmmm^
l
1070 integer :: ilp^
l, ilpp^
l, ilppp^
l, ilpppp^
l
1071 integer :: id^
l, idp^
l, idpp^
l, idm^
l, ie^
l, iem^
l, iep^
l, iepp^
l
1073 double precision,
dimension(4) :: d_array, u1_coeff, u2_coeff, u3_coeff, u4_coeff
1074 double precision,
dimension(ixI^S,1:nw,4) :: f_array, beta, alpha_array
1075 double precision,
dimension(ixI^S) :: a, b, c, tmp, tmp2, tmp3
1076 double precision,
dimension(ixI^S,1:nw) :: alpha_sum,
d, dm4
1077 double precision,
dimension(ixI^S,1:nw) :: flux, flux_min, flux_max, flux_ul, flux_md, flux_lc
1079 double precision,
parameter :: mpalpha = 2.d0, mpbeta = 4.d0
1081 double precision,
dimension(ixI^S,1:nw) :: wrctmp, wlctmp
1083 ilm^
l=il^
l-
kr(idims,^
d);
1084 ilmm^
l=ilm^
l-
kr(idims,^
d);
1085 ilmmm^
l=ilmm^
l-
kr(idims,^
d);
1086 ilp^
l=il^
l+
kr(idims,^
d);
1087 ilpp^
l=ilp^
l+
kr(idims,^
d);
1088 ilppp^
l=ilpp^
l+
kr(idims,^
d);
1089 ilpppp^
l=ilppp^
l+
kr(idims,^
d);
1091 d_array(1:4) = (/ 1.d0/35.d0, 12.d0/35.d0, 18.d0/35.d0, 4.d0/35.d0 /)
1092 u1_coeff(1:4) = (/ -1.d0/4.d0, 13.d0/12.d0, -23.d0/12.d0, 25.d0/12.d0 /)
1093 u2_coeff(1:4) = (/ 1.d0/12.d0, -5.d0/12.d0, 13.d0/12.d0, 1.d0/4.d0 /)
1094 u3_coeff(1:4) = (/ -1.d0/12.d0, 7.d0/12.d0, 7.d0/12.d0, -1.d0/12.d0 /)
1095 u4_coeff(1:4) = (/ 1.d0/4.d0, 13.d0/12.d0, -5.d0/12.d0, 1.d0/12.d0 /)
1098 f_array(il^s,1:nwflux,1) = u1_coeff(1) * w(ilmmm^s,1:nwflux) + u1_coeff(2) * w(ilmm^s,1:nwflux) + u1_coeff(3) * w(ilm^s,1:nwflux) &
1099 + u1_coeff(4) * w(il^s,1:nwflux)
1100 f_array(il^s,1:nwflux,2) = u2_coeff(1) * w(ilmm^s,1:nwflux) + u2_coeff(2) * w(ilm^s,1:nwflux) + u2_coeff(3) * w(il^s,1:nwflux) &
1101 + u2_coeff(4) * w(ilp^s,1:nwflux)
1102 f_array(il^s,1:nwflux,3) = u3_coeff(1) * w(ilm^s,1:nwflux) + u3_coeff(2) * w(il^s,1:nwflux) + u3_coeff(3) * w(ilp^s,1:nwflux) &
1103 + u3_coeff(4) * w(ilpp^s,1:nwflux)
1104 f_array(il^s,1:nwflux,4) = u4_coeff(1) * w(il^s,1:nwflux) + u4_coeff(2) * w(ilp^s,1:nwflux) + u4_coeff(3) * w(ilpp^s,1:nwflux) &
1105 + u4_coeff(4) * w(ilppp^s,1:nwflux)
1107 beta(il^s,1:nwflux,1) = w(ilmmm^s,1:nwflux) * (547.d0 * w(ilmmm^s,1:nwflux) - 3882.d0 * w(ilmm^s,1:nwflux) + 4642.d0 * w(ilm^s,1:nwflux) &
1108 - 1854.d0 * w(il^s,1:nwflux)) &
1109 + w(ilmm^s,1:nwflux) * (7043.d0 * w(ilmm^s,1:nwflux) - 17246.d0 * w(ilm^s,1:nwflux) + 7042.d0 * w(il^s,1:nwflux)) &
1110 + w(ilm^s,1:nwflux) * (11003.d0 * w(ilm^s,1:nwflux) - 9402.d0 * w(il^s,1:nwflux)) + 2107.d0 * w(il^s,1:nwflux)**2
1111 beta(il^s,1:nwflux,2) = w(ilmm^s,1:nwflux) * (267.d0 * w(ilmm^s,1:nwflux) - 1642.d0 * w(ilm^s,1:nwflux) + 1602.d0 * w(il^s,1:nwflux) &
1112 - 494.d0 * w(ilp^s,1:nwflux)) &
1113 + w(ilm^s,1:nwflux) * (2843.d0 * w(ilm^s,1:nwflux) - 5966.d0 * w(il^s,1:nwflux) + 1922.d0 * w(ilp^s,1:nwflux)) &
1114 + w(il^s,1:nwflux) * (3443.d0 * w(il^s,1:nwflux) - 2522.d0 * w(ilp^s,1:nwflux)) + 547.d0 * w(ilp^s,1:nwflux) ** 2
1115 beta(il^s,1:nwflux,3) = w(ilm^s,1:nwflux) * (547.d0 * w(ilm^s,1:nwflux) - 2522.d0 * w(il^s,1:nwflux) + 1922.d0 * w(ilp^s,1:nwflux) &
1116 - 494.d0 * w(ilpp^s,1:nwflux)) &
1117 + w(il^s,1:nwflux) * (3443.d0 * w(il^s,1:nwflux) - 5966.d0 * w(ilp^s,1:nwflux) + 1602.d0 * w(ilpp^s,1:nwflux)) &
1118 + w(ilp^s,1:nwflux) * (2843.d0 * w(ilp^s,1:nwflux) - 1642.d0 * w(ilpp^s,1:nwflux)) + 267.d0 * w(ilpp^s,1:nwflux) ** 2
1119 beta(il^s,1:nwflux,4) = w(il^s,1:nwflux) * (2107.d0 * w(il^s,1:nwflux) - 9402.d0 * w(ilp^s,1:nwflux) + 7042.d0 * w(ilpp^s,1:nwflux) &
1120 - 1854.d0 * w(ilppp^s,1:nwflux)) &
1121 + w(ilp^s,1:nwflux) * (11003.d0 * w(ilp^s,1:nwflux) - 17246.d0 * w(ilpp^s,1:nwflux) + 4642.d0 * w(ilppp^s,1:nwflux)) &
1122 + w(ilpp^s,1:nwflux) * (7043.d0 * w(ilpp^s,1:nwflux) - 3882.d0 * w(ilppp^s,1:nwflux)) &
1123 + 547.d0 * w(ilppp^s,1:nwflux) ** 2
1125 alpha_sum(il^s,1:nwflux) = 0.0d0
1127 alpha_array(il^s,1:nwflux,i) = d_array(i)/(beta(il^s,1:nwflux,i) + weno_eps_machine)**2
1128 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
1130 flux(il^s,1:nwflux) = 0.0d0
1132 flux(il^s,1:nwflux) = flux(il^s,1:nwflux) + f_array(il^s,1:nwflux,i) * alpha_array(il^s,1:nwflux,i)/(alpha_sum(il^s,1:nwflux))
1138 wlctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
1140 idmax^
d=ilmax^
d; idmin^
d=ilmin^
d-
kr(idims,^
d);
1141 idm^
l=id^
l-
kr(idims,^
d);
1142 idp^
l=id^
l+
kr(idims,^
d);
1144 iemax^
d=idmax^
d+
kr(idims,^
d); iemin^
d=idmin^
d;
1145 iem^
l=ie^
l-
kr(idims,^
d);
1146 iep^
l=ie^
l+
kr(idims,^
d);
1148 d(ie^s,1:nwflux) = w(iep^s,1:nwflux)-2.0d0*w(ie^s,1:nwflux)+w(iem^s,1:nwflux)
1151 a(id^s) = 4.0d0*
d(id^s,iw)-
d(idp^s,iw)
1152 b(id^s) = 4.0d0*
d(idp^s,iw)-
d(id^s,iw)
1154 a(id^s) =
d(id^s,iw)
1155 b(id^s) =
d(idp^s,iw)
1157 call minmod(ixi^
l,id^
l,tmp,tmp2,tmp3)
1158 dm4(id^s,iw) = tmp3(id^s)
1161 flux_ul(il^s,1:nwflux) = w(il^s,1:nwflux) + mpalpha * (w(il^s,1:nwflux) - w(ilm^s,1:nwflux))
1162 flux_md(il^s,1:nwflux) = half * (w(il^s,1:nwflux) + w(ilp^s,1:nwflux) - dm4(il^s,1:nwflux))
1163 flux_lc(il^s,1:nwflux) = half * (3.d0 * w(il^s,1:nwflux) - w(ilm^s,1:nwflux)) + mpbeta / 3.d0 * dm4(ilm^s,1:nwflux)
1165 flux_min(il^s,1:nwflux) = max(min(w(il^s,1:nwflux), w(ilp^s,1:nwflux), flux_md(il^s,1:nwflux)), &
1166 min(w(il^s,1:nwflux), flux_ul(il^s,1:nwflux),flux_lc(il^s,1:nwflux)))
1168 flux_max(il^s,1:nwflux) = min(max(w(il^s,1:nwflux), w(ilp^s,1:nwflux), flux_md(il^s,1:nwflux)), &
1169 max(w(il^s,1:nwflux), flux_ul(il^s,1:nwflux),flux_lc(il^s,1:nwflux)))
1171 a(il^s) = flux(il^s,iw)
1172 b(il^s) = flux_min(il^s,iw)
1173 c(il^s) = flux_max(il^s,iw)
1174 call median(ixi^
l, il^
l, a, b, c, tmp)
1175 wlctmp(il^s,iw) = tmp(il^s)
1187 f_array(il^s,1:nwflux,1) = u1_coeff(1) * w(ilpppp^s,1:nwflux) + u1_coeff(2) * w(ilppp^s,1:nwflux) + u1_coeff(3) * w(ilpp^s,1:nwflux) &
1188 + u1_coeff(4) * w(ilp^s,1:nwflux)
1189 f_array(il^s,1:nwflux,2) = u2_coeff(1) * w(ilppp^s,1:nwflux) + u2_coeff(2) * w(ilpp^s,1:nwflux) + u2_coeff(3) * w(ilp^s,1:nwflux) &
1190 + u2_coeff(4) * w(il^s,1:nwflux)
1191 f_array(il^s,1:nwflux,3) = u3_coeff(1) * w(ilpp^s,1:nwflux) + u3_coeff(2) * w(ilp^s,1:nwflux) + u3_coeff(3) * w(il^s,1:nwflux) &
1192 + u3_coeff(4) * w(ilm^s,1:nwflux)
1193 f_array(il^s,1:nwflux,4) = u4_coeff(1) * w(ilp^s,1:nwflux) + u4_coeff(2) * w(il^s,1:nwflux) + u4_coeff(3) * w(ilm^s,1:nwflux) &
1194 + u4_coeff(4) * w(ilmm^s,1:nwflux)
1196 beta(il^s,1:nwflux,1) = w(ilpppp^s,1:nwflux) * (547.d0 * w(ilpppp^s,1:nwflux) - 3882.d0 * w(ilppp^s,1:nwflux) + 4642.d0 * w(ilpp^s,1:nwflux) &
1197 - 1854.d0 * w(ilp^s,1:nwflux)) &
1198 + w(ilppp^s,1:nwflux) * (7043.d0 * w(ilppp^s,1:nwflux) - 17246.d0 * w(ilpp^s,1:nwflux) + 7042.d0 * w(ilp^s,1:nwflux)) &
1199 + w(ilpp^s,1:nwflux) * (11003.d0 * w(ilpp^s,1:nwflux) - 9402.d0 * w(ilp^s,1:nwflux)) + 2107.d0 * w(ilp^s,1:nwflux)**2
1200 beta(il^s,1:nwflux,2) = w(ilppp^s,1:nwflux) * (267.d0 * w(ilppp^s,1:nwflux) - 1642.d0 * w(ilpp^s,1:nwflux) + 1602.d0 * w(ilp^s,1:nwflux) &
1201 - 494.d0 * w(il^s,1:nwflux)) &
1202 + w(ilpp^s,1:nwflux) * (2843.d0 * w(ilpp^s,1:nwflux) - 5966.d0 * w(ilp^s,1:nwflux) + 1922.d0 * w(il^s,1:nwflux)) &
1203 + w(ilp^s,1:nwflux) * (3443.d0 * w(ilp^s,1:nwflux) - 2522.d0 * w(il^s,1:nwflux)) + 547.d0 * w(il^s,1:nwflux) ** 2
1204 beta(il^s,1:nwflux,3) = w(ilpp^s,1:nwflux) * (547.d0 * w(ilpp^s,1:nwflux) - 2522.d0 * w(ilp^s,1:nwflux) + 1922.d0 * w(il^s,1:nwflux) &
1205 - 494.d0 * w(ilm^s,1:nwflux)) &
1206 + w(ilp^s,1:nwflux) * (3443.d0 * w(ilp^s,1:nwflux) - 5966.d0 * w(il^s,1:nwflux) + 1602.d0 * w(ilm^s,1:nwflux)) &
1207 + w(il^s,1:nwflux) * (2843.d0 * w(il^s,1:nwflux) - 1642.d0 * w(ilm^s,1:nwflux)) + 267.d0 * w(ilm^s,1:nwflux) ** 2
1208 beta(il^s,1:nwflux,4) = w(ilp^s,1:nwflux) * (2107.d0 * w(ilp^s,1:nwflux) - 9402.d0 * w(il^s,1:nwflux) + 7042.d0 * w(ilm^s,1:nwflux) &
1209 - 1854.d0 * w(ilmm^s,1:nwflux)) &
1210 + w(il^s,1:nwflux) * (11003.d0 * w(il^s,1:nwflux) - 17246.d0 * w(ilm^s,1:nwflux) + 4642.d0 * w(ilmm^s,1:nwflux)) &
1211 + w(ilm^s,1:nwflux) * (7043.d0 * w(ilm^s,1:nwflux) - 3882.d0 * w(ilmm^s,1:nwflux)) + 547.d0 * w(ilmm^s,1:nwflux) ** 2
1213 alpha_sum(il^s,1:nwflux) = 0.0d0
1215 alpha_array(il^s,1:nwflux,i) = d_array(i)/(beta(il^s,1:nwflux,i) + weno_eps_machine)**2
1216 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
1218 flux(il^s,1:nwflux) = 0.0d0
1220 flux(il^s,1:nwflux) = flux(il^s,1:nwflux) + f_array(il^s,1:nwflux,i) * alpha_array(il^s,1:nwflux,i)/(alpha_sum(il^s,1:nwflux))
1225 wrctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
1227 idmax^
d=ilmax^
d+
kr(idims,^
d); idmin^
d=ilmin^
d;
1228 idm^
l=id^
l-
kr(idims,^
d);
1229 idp^
l=id^
l+
kr(idims,^
d);
1231 iemax^
d=idmax^
d; iemin^
d=idmin^
d-
kr(idims,^
d);
1232 iem^
l=ie^
l-
kr(idims,^
d);
1233 iep^
l=ie^
l+
kr(idims,^
d);
1234 iepp^
l=iep^
l+
kr(idims,^
d);
1236 d(ie^s,1:nwflux) = w(ie^s,1:nwflux)-2.0d0*w(iep^s,1:nwflux)+w(iepp^s,1:nwflux)
1239 a(id^s) = 4.0d0*
d(id^s,iw)-
d(idm^s,iw)
1240 b(id^s) = 4.0d0*
d(idm^s,iw)-
d(id^s,iw)
1242 a(id^s) =
d(id^s,iw)
1243 b(id^s) =
d(idm^s,iw)
1245 call minmod(ixi^
l,id^
l,tmp,tmp2,tmp3)
1246 dm4(id^s,iw) = tmp3(id^s)
1249 flux_ul(il^s,1:nwflux) = w(ilp^s,1:nwflux) + mpalpha * (w(ilp^s,1:nwflux) - w(ilpp^s,1:nwflux))
1250 flux_md(il^s,1:nwflux) = half * (w(il^s,1:nwflux) + w(ilp^s,1:nwflux) - dm4(il^s,1:nwflux))
1251 flux_lc(il^s,1:nwflux) = half * (3.d0 * w(ilp^s,1:nwflux) - w(ilpp^s,1:nwflux)) + mpbeta / 3.d0 * dm4(ilp^s,1:nwflux)
1253 flux_min(il^s,1:nwflux) = max(min(w(ilp^s,1:nwflux), w(il^s,1:nwflux), flux_md(il^s,1:nwflux)), &
1254 min(w(ilp^s,1:nwflux), flux_ul(il^s,1:nwflux),flux_lc(il^s,1:nwflux)))
1256 flux_max(il^s,1:nwflux) = min(max(w(ilp^s,1:nwflux), w(il^s,1:nwflux), flux_md(il^s,1:nwflux)), &
1257 max(w(ilp^s,1:nwflux), flux_ul(il^s,1:nwflux),flux_lc(il^s,1:nwflux)))
1259 a(il^s) = flux(il^s,iw)
1260 b(il^s) = flux_min(il^s,iw)
1261 c(il^s) = flux_max(il^s,iw)
1262 call median(ixi^
l, il^
l, a, b, c, tmp)
1263 wrctmp(il^s,iw) = tmp(il^s)
1275 integer,
intent(in) :: ixI^L, ixO^L
1276 double precision,
intent(in) :: a(ixI^S), b(ixI^S)
1277 double precision,
intent(out):: minm(ixI^S)
1279 minm(ixo^s) = (sign(one,a(ixo^s))+sign(one,b(ixo^s)))/2.0d0 * &
1280 min(abs(a(ixo^s)),abs(b(ixo^s)))
1288 integer,
intent(in) :: ixI^L, ixO^L
1289 double precision,
intent(in) :: a(ixI^S), b(ixI^S), c(ixI^S)
1290 double precision,
intent(out):: med(ixI^S)
1292 double precision :: tmp1(ixI^S),tmp2(ixI^S)
1294 tmp1(ixo^s) = b(ixo^s) - a(ixo^s); tmp2(ixo^s) = c(ixo^s) - a(ixo^s)
1296 med(ixo^s) = a(ixo^s) + (sign(one,tmp1(ixo^s))+sign(one,tmp2(ixo^s)))/2.0d0 * &
1297 min(abs(tmp1(ixo^s)),abs(tmp2(ixo^s)))
This module contains definitions of global parameters and variables and some generic functions/subrou...
type(state), pointer block
Block pointer for using one block and its previous state.
integer, dimension(3, 3) kr
Kronecker delta tensor.
integer, parameter ndim
Number of spatial dimensions for grid variables.
integer, dimension(:), allocatable, parameter d
This module defines the procedures of a physics module. It contains function pointers for the various...
procedure(sub_check_w), pointer phys_check_w
subroutine, public fix_onelimiter(ixIL, iLL, wCin, wCout)
subroutine, public weno5limiterl(ixIL, iLL, idims, w, wLC, var)
subroutine, public fix_onelimiter1(ixIL, iLL, wCin, wCout)
subroutine, public weno5nmlimiter(ixIL, iLL, idims, dxdim, w, wLC, wRC, var)
subroutine, public teno5adlimiter(ixIL, iLL, idims, dxdim, w, wLC, wRC)
subroutine, public weno5limiterr(ixIL, iLL, idims, w, wRC, var)
subroutine, public weno5nmlimiterl(ixIL, iLL, idims, w, wLC, var)
subroutine, public fix_limiter(ixIL, iLL, wLCin, wRCin, wLCout, wRCout)
subroutine, public weno5cu6limiter(ixIL, iLL, idims, w, wLC, wRC)
subroutine, public weno7limiter(ixIL, iLL, idims, w, wLC, wRC, var)
subroutine, public fix_limiter1(ixIL, iLL, wLCin, wRCin, wLCout, wRCout)
subroutine, public weno3limiter(ixIL, iLL, idims, dxdim, w, wLC, wRC, var)
subroutine minmod(ixIL, ixOL, a, b, minm)
subroutine, public weno5limiter(ixIL, iLL, idims, dxdim, w, wLC, wRC, var)
subroutine, public weno5nmlimiterr(ixIL, iLL, idims, w, wRC, var)
subroutine median(ixIL, ixOL, a, b, c, med)