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 double precision :: f_array(ixi^s,1:nw,2), d_array(2)
174 double precision :: beta(ixi^s,1:nw,2),tau(ixi^s,1:nw)
175 double precision :: u1_coeff(2), u2_coeff(2)
176 double precision :: alpha_array(ixi^s,1:nw,2), alpha_sum(ixi^s,1:nw), flux(ixi^s,1:nw)
177 double precision,
dimension(ixI^S,1:nw) :: wrctmp, wlctmp
178 integer :: ilm^
l, ilp^
l, ilpp^
l, i
181 ilm^
l=il^
l-
kr(idims,^
d);
182 ilp^
l=il^
l+
kr(idims,^
d);
183 ilpp^
l=ilp^
l+
kr(idims,^
d);
184 d_array(1:2) = (/ 1.0d0/3.0d0, 2.0d0/3.0d0 /)
185 u1_coeff(1:2) = (/ -1.d0/2.d0, 3.d0/2.d0 /)
186 u2_coeff(1:2) = (/ 1.d0/2.d0, 1.d0/2.d0 /)
189 f_array(il^s,1:nwflux,1) = u1_coeff(1) * w(ilm^s,1:nwflux) + u1_coeff(2) * w(il^s,1:nwflux)
190 f_array(il^s,1:nwflux,2) = u2_coeff(1) * w(il^s,1:nwflux) + u2_coeff(2) * w(ilp^s,1:nwflux)
192 beta(il^s,1:nwflux,1) = (w(il^s,1:nwflux) - w(ilm^s,1:nwflux))**2
193 beta(il^s,1:nwflux,2) = (w(ilp^s,1:nwflux) - w(il^s,1:nwflux))**2
195 alpha_sum(il^s,1:nwflux) = 0.0d0
199 alpha_array(il^s,1:nwflux,i) = d_array(i)/(beta(il^s,1:nwflux,i) + weno_eps_machine)**2
200 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
203 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,2) - beta(il^s,1:nwflux,1))
205 alpha_array(il^s,1:nwflux,i) = d_array(i) * (1.d0 + (tau(il^s,1:nwflux) / &
206 (beta(il^s,1:nwflux,i) + dxdim**2)))
207 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
211 flux(il^s,1:nwflux) = 0.0d0
213 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))
217 wlctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
220 f_array(il^s,1:nwflux,1) = u1_coeff(1) * w(ilpp^s,1:nwflux) + u1_coeff(2) * w(ilp^s,1:nwflux)
221 f_array(il^s,1:nwflux,2) = u2_coeff(1) * w(ilp^s,1:nwflux) + u2_coeff(2) * w(il^s,1:nwflux)
223 beta(il^s,1:nwflux,1) = (w(ilpp^s,1:nwflux) - w(ilp^s,1:nwflux))**2
224 beta(il^s,1:nwflux,2) = (w(ilp^s,1:nwflux) - w(il^s,1:nwflux))**2
226 alpha_sum(il^s,1:nwflux) = 0.0d0
230 alpha_array(il^s,1:nwflux,i) = d_array(i)/(beta(il^s,1:nwflux,i) + weno_eps_machine)**2
231 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
234 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,2) - beta(il^s,1:nwflux,1))
236 alpha_array(il^s,1:nwflux,i) = d_array(i) * (1.d0 + (tau(il^s,1:nwflux) / &
237 (beta(il^s,1:nwflux,i) + dxdim**2)))
238 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
242 flux(il^s,1:nwflux) = 0.0d0
244 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))
248 wrctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
257 integer,
intent(in) :: ixi^
l, il^
l, idims, var
258 double precision,
intent(in) :: dxdim
259 double precision,
intent(in) :: w(ixi^s,1:nw)
260 double precision,
intent(inout) :: wrc(ixi^s,1:nw),wlc(ixi^s,1:nw)
262 double precision :: f_array(ixi^s,1:nw,3), d_array(3)
263 double precision :: beta(ixi^s,1:nw,3), beta_coeff(2)
264 double precision :: tau(ixi^s,1:nw), tmp(ixi^s,1:nw)
265 double precision :: u1_coeff(3), u2_coeff(3), u3_coeff(3)
266 double precision :: alpha_array(ixi^s,1:nw,3), alpha_sum(ixi^s,1:nw), flux(ixi^s,1:nw)
267 double precision :: lambda
268 double precision,
dimension(ixI^S,1:nw) :: wrctmp, wlctmp
269 integer :: ilm^
l, ilmm^
l, ilp^
l, ilpp^
l, ilppp^
l, i
271 ilm^
l=il^
l-
kr(idims,^
d);
272 ilmm^
l=ilm^
l-
kr(idims,^
d);
273 ilp^
l=il^
l+
kr(idims,^
d);
274 ilpp^
l=ilp^
l+
kr(idims,^
d);
275 ilppp^
l=ilpp^
l+
kr(idims,^
d);
276 lambda = dxdim**weno_dx_exp
277 beta_coeff(1:2) = (/ 1.0833333333333333d0, 0.25d0/)
279 d_array(1:3) = (/ 1.0d0/10.0d0, 3.0d0/5.0d0, 3.0d0/10.0d0 /)
280 u1_coeff(1:3) = (/ 1.d0/3.d0, -7.d0/6.d0, 11.d0/6.d0 /)
281 u2_coeff(1:3) = (/ -1.d0/6.d0, 5.d0/6.d0, 1.d0/3.d0 /)
282 u3_coeff(1:3) = (/ 1.d0/3.d0, 5.d0/6.d0, -1.d0/6.d0 /)
290 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)
291 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)
292 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)
294 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 &
295 + beta_coeff(2) * (w(ilmm^s,1:nwflux) - 4.0d0 * w(ilm^s,1:nwflux) + 3.0d0*w(il^s,1:nwflux))**2
296 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 &
297 + beta_coeff(2) * (w(ilm^s,1:nwflux) - w(ilp^s,1:nwflux))**2
298 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 &
299 + beta_coeff(2) * (3.0d0 * w(il^s, 1:nwflux) - 4.0d0 * w(ilp^s,1:nwflux) + w(ilpp^s,1:nwflux))**2
305 alpha_array(il^s,1:nwflux,i) = d_array(i)/(beta(il^s,1:nwflux,i) + weno_eps_machine)**2
308 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3))
310 alpha_array(il^s,1:nwflux,i) = d_array(i) * (1.d0 + (tau(il^s,1:nwflux) / &
311 (beta(il^s,1:nwflux,i) + weno_eps_machine))**2)
314 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3))
316 tmp(il^s,1:nwflux) = (tau(il^s,1:nwflux) + weno_eps_machine) / (beta(il^s,1:nwflux,i) + weno_eps_machine)
317 alpha_array(il^s,1:nwflux,i) = d_array(i) * (1.0d0 + tmp(il^s,1:nwflux)**2 + lambda/tmp(il^s,1:nwflux))
321 alpha_sum(il^s,1:nwflux) = 0.0d0
323 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
325 flux(il^s,1:nwflux) = 0.0d0
327 flux(il^s,1:nwflux) = flux(il^s,1:nwflux) + f_array(il^s,1:nwflux,i) &
328 *alpha_array(il^s,1:nwflux,i)/(alpha_sum(il^s,1:nwflux))
330 wlctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
333 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)
334 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)
335 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)
337 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 &
338 + beta_coeff(2) * (w(ilppp^s,1:nwflux) - 4.0d0 * w(ilpp^s,1:nwflux) + 3.0d0*w(ilp^s,1:nwflux))**2
339 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 &
340 + beta_coeff(2) * (w(ilpp^s,1:nwflux) - w(il^s,1:nwflux))**2
341 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 &
342 + beta_coeff(2) * (3.0d0 * w(ilp^s, 1:nwflux) - 4.0d0 * w(il^s,1:nwflux) + w(ilm^s,1:nwflux))**2
347 alpha_array(il^s,1:nwflux,i) = d_array(i)/(beta(il^s,1:nwflux,i) + weno_eps_machine)**2
350 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3))
352 alpha_array(il^s,1:nwflux,i) = d_array(i) * (1.d0 + (tau(il^s,1:nwflux) / &
353 (beta(il^s,1:nwflux,i) + weno_eps_machine))**2)
356 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3))
358 tmp(il^s,1:nwflux) = (tau(il^s,1:nwflux) + weno_eps_machine) / (beta(il^s,1:nwflux,i) + weno_eps_machine)
359 alpha_array(il^s,1:nwflux,i) = d_array(i) * (1.0d0 + tmp(il^s,1:nwflux)**2 + lambda/tmp(il^s,1:nwflux))
363 alpha_sum(il^s,1:nwflux) = 0.0d0
366 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
368 flux(il^s,1:nwflux) = 0.0d0
370 flux(il^s,1:nwflux) = flux(il^s,1:nwflux) + f_array(il^s,1:nwflux,i) &
371 *alpha_array(il^s,1:nwflux,i)/(alpha_sum(il^s,1:nwflux))
373 wrctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
381 integer,
intent(in) :: ixi^
l, il^
l, idims
382 double precision,
intent(in) :: dxdim
383 double precision,
intent(in) :: w(ixi^s,1:nw)
384 double precision,
intent(inout) :: wrc(ixi^s,1:nw),wlc(ixi^s,1:nw)
386 double precision :: f_array(ixi^s,1:nw,3), d_array(3)
387 double precision :: beta(ixi^s,1:nw,3), beta_coeff(2)
388 double precision :: u1_coeff(3), u2_coeff(3), u3_coeff(3)
389 double precision :: gam_sum(ixi^s,1:nw),tau(ixi^s,1:nw),delta_sum(ixi^s,1:nw)
390 double precision :: gam(ixi^s,1:nw,3), kai(ixi^s,1:nw,3), delta(ixi^s,1:nw,3)
391 double precision :: flux(ixi^s,1:nw), kai1(ixi^s,1:nw,3), theta(ixi^s,1:nw)
392 double precision,
dimension(ixI^S,1:nw) :: wrctmp, wlctmp
393 integer :: marray(ixi^s,1:nw)
394 integer :: ilm^
l, ilmm^
l, ilp^
l, ilpp^
l, ilppp^
l, i
396 ilm^
l=il^
l-
kr(idims,^
d);
397 ilmm^
l=ilm^
l-
kr(idims,^
d);
398 ilp^
l=il^
l+
kr(idims,^
d);
399 ilpp^
l=ilp^
l+
kr(idims,^
d);
400 ilppp^
l=ilpp^
l+
kr(idims,^
d);
401 beta_coeff(1:2) = (/ 1.0833333333333333d0, 0.25d0/)
402 d_array(1:3) = (/ 1.0d0/10.0d0, 3.0d0/5.0d0, 3.0d0/10.0d0 /)
403 u1_coeff(1:3) = (/ 1.d0/3.d0, -7.d0/6.d0, 11.d0/6.d0 /)
404 u2_coeff(1:3) = (/ -1.d0/6.d0, 5.d0/6.d0, 1.d0/3.d0 /)
405 u3_coeff(1:3) = (/ 1.d0/3.d0, 5.d0/6.d0, -1.d0/6.d0 /)
408 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)
409 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)
410 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)
412 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 &
413 + beta_coeff(2) * (w(ilmm^s,1:nwflux) - 4.0d0 * w(ilm^s,1:nwflux) + 3.0d0*w(il^s,1:nwflux))**2
414 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 &
415 + beta_coeff(2) * (w(ilm^s,1:nwflux) - w(ilp^s,1:nwflux))**2
416 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 &
417 + beta_coeff(2) * (3.0d0 * w(il^s, 1:nwflux) - 4.0d0 * w(ilp^s,1:nwflux) + w(ilpp^s,1:nwflux))**2
419 gam_sum(il^s,1:nwflux) = 0.0d0
420 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3))
422 kai1(il^s,1:nwflux,i) = (tau(il^s,1:nwflux) / (beta(il^s,1:nwflux,i) + weno_eps_machine))
423 gam(il^s,1:nwflux,i) = (1.d0 + kai1(il^s,1:nwflux,i))**2
424 gam_sum(il^s,1:nwflux) = gam_sum(il^s,1:nwflux) + gam(il^s,1:nwflux,i)
426 theta(il^s,1:nwflux) = one / (one + maxval(kai1(il^s,1:nwflux,1:3)/10.d0, dim=
ndim+2))
427 marray(il^s,1:nwflux)=-floor(4.d0 + theta(il^s,1:nwflux)*6.d0)
429 kai(il^s,1:nwflux,i) = gam(il^s,1:nwflux,i) / gam_sum(il^s,1:nwflux)
430 where(kai(il^s,1:nwflux,i) .lt. 10**marray(il^s,1:nwflux))
431 delta(il^s,1:nwflux,i)=zero
433 delta(il^s,1:nwflux,i)=one
438 delta_sum(il^s,1:nwflux)=delta_sum(il^s,1:nwflux)+delta(il^s,1:nwflux,i)*d_array(i)
440 flux(il^s,1:nwflux)=0.0d0
442 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))
446 wlctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
449 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)
450 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)
451 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)
453 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 &
454 + beta_coeff(2) * (w(ilppp^s,1:nwflux) - 4.0d0 * w(ilpp^s,1:nwflux) + 3.0d0*w(ilp^s,1:nwflux))**2
455 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 &
456 + beta_coeff(2) * (w(ilpp^s,1:nwflux) - w(il^s,1:nwflux))**2
457 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 &
458 + beta_coeff(2) * (3.0d0 * w(ilp^s, 1:nwflux) - 4.0d0 * w(il^s,1:nwflux) + w(ilm^s,1:nwflux))**2
461 gam_sum(il^s,1:nwflux)=0.0d0
462 tau(il^s,1:nwflux)=abs(beta(il^s,1:nwflux,1)-beta(il^s,1:nwflux,3))
464 kai1(il^s,1:nwflux,i)=(tau(il^s,1:nwflux)/(beta(il^s,1:nwflux,i)+weno_eps_machine))
465 gam(il^s,1:nwflux,i)=(1.d0+kai1(il^s,1:nwflux,i))**6
466 gam_sum(il^s,1:nwflux)=gam_sum(il^s,1:nwflux)+gam(il^s,1:nwflux,i)
468 theta(il^s,1:nwflux)=one/(one+maxval(kai1(il^s,1:nwflux,1:3)/10.d0,dim=
ndim+2))
469 marray(il^s,1:nwflux)=-floor(4.d0+theta(il^s,1:nwflux)*6.d0)
471 kai(il^s,1:nwflux,i) = gam(il^s,1:nwflux,i)/gam_sum(il^s,1:nwflux)
472 where(kai(il^s,1:nwflux,i) .lt. 10**marray(il^s,1:nwflux))
473 delta(il^s,1:nwflux,i)=zero
475 delta(il^s,1:nwflux,i)=one
480 delta_sum(il^s,1:nwflux)=delta_sum(il^s,1:nwflux)+delta(il^s,1:nwflux,i)*d_array(i)
482 flux(il^s,1:nwflux)=0.0d0
484 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))
488 wrctmp(il^s,1:nwflux)=flux(il^s,1:nwflux)
497 integer,
intent(in) :: ixi^
l,il^
l,idims,var
498 double precision,
intent(in) :: dxdim
499 double precision,
intent(in) :: w(ixi^s,1:nw)
500 double precision,
intent(inout) :: wrc(ixi^s,1:nw),wlc(ixi^s,1:nw)
502 double precision :: f_array(ixi^s,1:nw,3), d_array(3)
503 double precision :: beta(ixi^s,1:nw,3), beta_coeff(2)
504 double precision :: tau(ixi^s,1:nw), tmp(ixi^s,1:nw)
505 double precision :: u1_coeff(3), u2_coeff(3), u3_coeff(3)
506 double precision :: alpha_array(ixi^s,1:nw,3), alpha_sum(ixi^s,1:nw), flux(ixi^s,1:nw)
507 double precision :: wc(ixi^s,1:nw), wd(ixi^s,1:nw), we(ixi^s,1:nw)
508 double precision :: lambda(ixi^s)
509 double precision,
dimension(ixI^S,1:nw) :: wrctmp, wlctmp
510 integer :: ilm^
l, ilmm^
l, ilp^
l, ilpp^
l, ilppp^
l
511 integer :: im^
l, imp^
l
514 ilm^
l=il^
l-
kr(idims,^
d);
515 ilmm^
l=ilm^
l-
kr(idims,^
d);
516 ilp^
l=il^
l+
kr(idims,^
d);
517 ilpp^
l=ilp^
l+
kr(idims,^
d);
518 ilppp^
l=ilpp^
l+
kr(idims,^
d);
521 imp^
l=im^
l+
kr(idims,^
d);
522 lambda(il^s)=
block%dx(il^s,idims)**weno_dx_exp
523 beta_coeff(1:2) = (/ 1.0833333333333333d0, 0.25d0/)
524 d_array(1:3) = (/ 1.0d0/10.0d0, 3.0d0/5.0d0, 3.0d0/10.0d0 /)
525 u1_coeff(1:3) = (/ -2.d0/3.d0, -1.d0/3.d0, 2.d0 /)
526 u2_coeff(1:3) = (/ -1.d0/3.d0, 2.d0/3.d0, 2.d0/3.d0 /)
527 u3_coeff(1:3) = (/ 2.d0/3.d0, 2.d0/3.d0, -1.d0/3.d0 /)
529 wc(im^s,i) = (
block%dx(imp^s,idims) * w(im^s,i) +
block%dx(im^s,idims) * w(imp^s,i)) / &
530 (
block%dx(imp^s,idims) +
block%dx(im^s,idims))
531 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)) / &
532 (
block%dx(ilmm^s,idims) +
block%dx(ilm^s,idims))
533 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)) / &
534 (
block%dx(ilppp^s,idims) +
block%dx(ilpp^s,idims))
537 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)
538 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)
539 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)
541 beta(il^s,1:nwflux,1) = beta_coeff(1) * (wc(ilm^s,1:nwflux) - wd(il^s,1:nwflux))**2 &
542 + beta_coeff(2) * (2.d0 * w(il^s,1:nwflux) - wc(ilm^s,1:nwflux) - wd(il^s,1:nwflux))**2
543 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 &
544 + beta_coeff(2) * (wc(ilm^s,1:nwflux) - wc(il^s,1:nwflux))**2
545 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 &
546 + beta_coeff(2) * (3.0d0 * wc(il^s, 1:nwflux) - 4.0d0 * w(ilp^s,1:nwflux) + wc(ilp^s,1:nwflux))**2
547 alpha_sum(il^s,1:nwflux) = 0.0d0
552 alpha_array(il^s,1:nwflux,i) = d_array(i)/(4.d0 * beta(il^s,1:nwflux,i) + weno_eps_machine)**2
553 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
556 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3)) * 4.d0
558 alpha_array(il^s,1:nwflux,i) = d_array(i) * (1.d0 + (tau(il^s,1:nwflux) / &
559 (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
566 tmp(il^s,j) = (tau(il^s,j) + weno_eps_machine) / (4.d0 * beta(il^s,j,i) + weno_eps_machine)
567 alpha_array(il^s,j,i) = d_array(i) * (1.0d0 + tmp(il^s,j)**2 + lambda(il^s)/tmp(il^s,j))
568 alpha_sum(il^s,j) = alpha_sum(il^s,j) + alpha_array(il^s,j,i)
572 flux(il^s,1:nwflux) = 0.0d0
574 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))
577 wlctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
580 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)
581 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)
582 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)
583 beta(il^s,1:nwflux,1) = beta_coeff(1) * (wc(ilp^s,1:nwflux) - we(il^s,1:nwflux))**2 &
584 + beta_coeff(2) * (2.d0 * w(ilp^s,1:nwflux) - wc(ilp^s,1:nwflux) - we(il^s,1:nwflux))**2
585 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 &
586 + beta_coeff(2) * (wc(ilp^s,1:nwflux) - wc(il^s,1:nwflux))**2
587 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 &
588 + beta_coeff(2) * (3.0d0 * wc(il^s, 1:nwflux) - 4.0d0 * w(il^s,1:nwflux) + wc(ilm^s,1:nwflux))**2
589 alpha_sum(il^s,1:nwflux) = 0.0d0
593 alpha_array(il^s,1:nwflux,i) = d_array(i)/(4.d0 * beta(il^s,1:nwflux,i) + weno_eps_machine)**2
594 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
597 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3)) * 4.d0
599 alpha_array(il^s,1:nwflux,i) = d_array(i) * (1.d0 + (tau(il^s,1:nwflux) / &
600 (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
607 tmp(il^s,j) = (tau(il^s,j) + weno_eps_machine) / (4.d0 * beta(il^s,j,i) + weno_eps_machine)
608 alpha_array(il^s,j,i) = d_array(i) * (1.0d0 + tmp(il^s,j)**2 + lambda(il^s)/tmp(il^s,j))
609 alpha_sum(il^s,j) = alpha_sum(il^s,j) + alpha_array(il^s,j,i)
613 flux(il^s,1:nwflux) = 0.0d0
615 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))
618 wrctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
627 integer,
intent(in) :: ixi^
l, il^
l, idims
628 integer,
intent(in) :: var
629 double precision,
intent(in) :: w(ixi^s,1:nw)
630 double precision,
intent(inout) :: wlc(ixi^s,1:nw)
632 double precision :: f_array(ixi^s,1:nw,3), d_array(3)
633 double precision :: beta(ixi^s,1:nw,3), beta_coeff(2)
634 double precision :: tau(ixi^s,1:nw), tmp(ixi^s,1:nw)
635 double precision :: u1_coeff(3), u2_coeff(3), u3_coeff(3)
636 double precision :: alpha_array(ixi^s,1:nw,3), alpha_sum(ixi^s,1:nw), flux(ixi^s,1:nw)
637 double precision :: lambda(ixi^s)
638 double precision,
dimension(ixI^S,1:nw) :: wlctmp
639 integer :: ilm^
l, ilmm^
l, ilp^
l, ilpp^
l, ilppp^
l
642 ilm^
l=il^
l-
kr(idims,^
d);
643 ilmm^
l=ilm^
l-
kr(idims,^
d);
644 ilp^
l=il^
l+
kr(idims,^
d);
645 ilpp^
l=ilp^
l+
kr(idims,^
d);
646 lambda=
block%dx(il^s,idims)**weno_dx_exp
647 beta_coeff(1:2) = (/ 1.0833333333333333d0, 0.25d0/)
649 d_array(1:3) = (/ 1.0d0/10.0d0, 3.0d0/5.0d0, 3.0d0/10.0d0 /)
650 u1_coeff(1:3) = (/ 1.d0/3.d0, -7.d0/6.d0, 11.d0/6.d0 /)
651 u2_coeff(1:3) = (/ -1.d0/6.d0, 5.d0/6.d0, 1.d0/3.d0 /)
652 u3_coeff(1:3) = (/ 1.d0/3.d0, 5.d0/6.d0, -1.d0/6.d0 /)
660 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)
661 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)
662 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)
664 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 &
665 + beta_coeff(2) * (w(ilmm^s,1:nwflux) - 4.0d0 * w(ilm^s,1:nwflux) + 3.0d0*w(il^s,1:nwflux))**2
666 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 &
667 + beta_coeff(2) * (w(ilm^s,1:nwflux) - w(ilp^s,1:nwflux))**2
668 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 &
669 + beta_coeff(2) * (3.0d0 * w(il^s, 1:nwflux) - 4.0d0 * w(ilp^s,1:nwflux) + w(ilpp^s,1:nwflux))**2
671 alpha_sum(il^s,1:nwflux) = 0.0d0
676 alpha_array(il^s,1:nwflux,i) = d_array(i)/(beta(il^s,1:nwflux,i) + weno_eps_machine)**2
677 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
680 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3))
682 alpha_array(il^s,1:nwflux,i) = d_array(i) * (1.d0 + (tau(il^s,1:nwflux) / &
683 (beta(il^s,1:nwflux,i) + weno_eps_machine))**2)
684 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
687 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3)) * 4.d0
690 tmp(il^s,j) = (tau(il^s,j) + weno_eps_machine) / (4.d0 * beta(il^s,j,i) + weno_eps_machine)
691 alpha_array(il^s,j,i) = d_array(i) * (1.0d0 + tmp(il^s,j)**2 + lambda(il^s)/tmp(il^s,j))
692 alpha_sum(il^s,j) = alpha_sum(il^s,j) + alpha_array(il^s,j,i)
696 flux(il^s,1:nwflux) = 0.0d0
698 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))
702 wlctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
711 integer,
intent(in) :: ixi^
l, il^
l, idims
712 integer,
intent(in) :: var
713 double precision,
intent(in) :: w(ixi^s,1:nw)
714 double precision,
intent(inout) :: wrc(ixi^s,1:nw)
716 double precision :: f_array(ixi^s,1:nw,3), d_array(3)
717 double precision :: beta(ixi^s,1:nw,3), beta_coeff(2)
718 double precision :: tau(ixi^s,1:nw), tmp(ixi^s,1:nw)
719 double precision :: u1_coeff(3), u2_coeff(3), u3_coeff(3)
720 double precision :: alpha_array(ixi^s,1:nw,3), alpha_sum(ixi^s,1:nw), flux(ixi^s,1:nw)
721 double precision :: lambda(ixi^s)
722 double precision,
dimension(ixI^S,1:nw) :: wrctmp
723 integer :: ilm^
l, ilmm^
l, ilp^
l, ilpp^
l, ilppp^
l
726 ilm^
l=il^
l-
kr(idims,^
d);
727 ilp^
l=il^
l+
kr(idims,^
d);
728 ilpp^
l=ilp^
l+
kr(idims,^
d);
729 ilppp^
l=ilpp^
l+
kr(idims,^
d);
730 lambda=
block%dx(il^s,idims)**weno_dx_exp
731 beta_coeff(1:2) = (/ 1.0833333333333333d0, 0.25d0/)
733 d_array(1:3) = (/ 1.0d0/10.0d0, 3.0d0/5.0d0, 3.0d0/10.0d0 /)
734 u1_coeff(1:3) = (/ 1.d0/3.d0, -7.d0/6.d0, 11.d0/6.d0 /)
735 u2_coeff(1:3) = (/ -1.d0/6.d0, 5.d0/6.d0, 1.d0/3.d0 /)
736 u3_coeff(1:3) = (/ 1.d0/3.d0, 5.d0/6.d0, -1.d0/6.d0 /)
744 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)
745 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)
746 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)
748 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 &
749 + beta_coeff(2) * (w(ilppp^s,1:nwflux) - 4.0d0 * w(ilpp^s,1:nwflux) + 3.0d0*w(ilp^s,1:nwflux))**2
750 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 &
751 + beta_coeff(2) * (w(ilpp^s,1:nwflux) - w(il^s,1:nwflux))**2
752 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 &
753 + beta_coeff(2) * (3.0d0 * w(ilp^s, 1:nwflux) - 4.0d0 * w(il^s,1:nwflux) + w(ilm^s,1:nwflux))**2
755 alpha_sum(il^s,1:nwflux) = 0.0d0
759 alpha_array(il^s,1:nwflux,i) = d_array(i)/(beta(il^s,1:nwflux,i) + weno_eps_machine)**2
760 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
763 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3))
765 alpha_array(il^s,1:nwflux,i) = d_array(i) * (1.d0 + (tau(il^s,1:nwflux) / &
766 (beta(il^s,1:nwflux,i) + weno_eps_machine))**2)
767 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
770 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3)) * 4.d0
773 tmp(il^s,j) = (tau(il^s,j) + weno_eps_machine) / (4.d0 * beta(il^s,j,i) + weno_eps_machine)
774 alpha_array(il^s,j,i) = d_array(i) * (1.0d0 + tmp(il^s,j)**2 + lambda(il^s)/tmp(il^s,j))
775 alpha_sum(il^s,j) = alpha_sum(il^s,j) + alpha_array(il^s,j,i)
779 flux(il^s,1:nwflux) = 0.0d0
781 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))
785 wrctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
794 integer,
intent(in) :: ixi^
l,il^
l,idims,var
795 double precision,
intent(in) :: w(ixi^s,1:nw)
796 double precision,
intent(inout) :: wlc(ixi^s,1:nw)
798 double precision :: f_array(ixi^s,1:nw,3), d_array(3)
799 double precision :: beta(ixi^s,1:nw,3), beta_coeff(2)
800 double precision :: tau(ixi^s,1:nw), tmp(ixi^s,1:nw)
801 double precision :: u1_coeff(3), u2_coeff(3), u3_coeff(3)
802 double precision :: alpha_array(ixi^s,1:nw,3), alpha_sum(ixi^s,1:nw), flux(ixi^s,1:nw)
803 double precision :: wc(ixi^s,1:nw), wd(ixi^s,1:nw)
804 double precision :: lambda(ixi^s)
805 double precision,
dimension(ixI^S,1:nw) :: wlctmp
806 integer :: ilm^
l, ilmm^
l, ilp^
l, ilpp^
l
807 integer :: im^
l, imp^
l
810 ilm^
l=il^
l-
kr(idims,^
d);
811 ilmm^
l=ilm^
l-
kr(idims,^
d);
812 ilp^
l=il^
l+
kr(idims,^
d);
813 ilpp^
l=ilp^
l+
kr(idims,^
d);
816 imp^
l=im^
l+
kr(idims,^
d);
817 lambda(il^s)=
block%dx(il^s,idims)**weno_dx_exp
818 beta_coeff(1:2) = (/ 1.0833333333333333d0, 0.25d0/)
819 d_array(1:3) = (/ 1.0d0/10.0d0, 3.0d0/5.0d0, 3.0d0/10.0d0 /)
820 u1_coeff(1:3) = (/ -2.d0/3.d0, -1.d0/3.d0, 2.d0 /)
821 u2_coeff(1:3) = (/ -1.d0/3.d0, 2.d0/3.d0, 2.d0/3.d0 /)
822 u3_coeff(1:3) = (/ 2.d0/3.d0, 2.d0/3.d0, -1.d0/3.d0 /)
824 wc(im^s,i) = (
block%dx(imp^s,idims) * w(im^s,i) +
block%dx(im^s,idims) * w(imp^s,i)) / &
825 (
block%dx(imp^s,idims) +
block%dx(im^s,idims))
826 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)) / &
827 (
block%dx(ilmm^s,idims) +
block%dx(ilm^s,idims))
829 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)
830 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)
831 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)
832 beta(il^s,1:nwflux,1) = beta_coeff(1) * (wc(ilm^s,1:nwflux) - wd(il^s,1:nwflux))**2 &
833 + beta_coeff(2) * (2.d0 * w(il^s,1:nwflux) - wc(ilm^s,1:nwflux) - wd(il^s,1:nwflux))**2
834 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 &
835 + beta_coeff(2) * (wc(ilm^s,1:nwflux) - wc(il^s,1:nwflux))**2
836 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 &
837 + beta_coeff(2) * (3.0d0 * wc(il^s, 1:nwflux) - 4.0d0 * w(ilp^s,1:nwflux) + wc(ilp^s,1:nwflux))**2
838 alpha_sum(il^s,1:nwflux) = 0.0d0
843 alpha_array(il^s,1:nwflux,i) = d_array(i)/(4.d0 * beta(il^s,1:nwflux,i) + weno_eps_machine)**2
844 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
847 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3)) * 4.d0
849 alpha_array(il^s,1:nwflux,i) = d_array(i) * (1.d0 + (tau(il^s,1:nwflux) / &
850 (4.d0 * beta(il^s,1:nwflux,i) + weno_eps_machine))**2)
851 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
854 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3)) * 4.d0
857 tmp(il^s,j) = (tau(il^s,j) + weno_eps_machine) / (4.d0 * beta(il^s,j,i) + weno_eps_machine)
858 alpha_array(il^s,j,i) = d_array(i) * (1.0d0 + tmp(il^s,j)**2 + lambda(il^s)/tmp(il^s,j))
859 alpha_sum(il^s,j) = alpha_sum(il^s,j) + alpha_array(il^s,j,i)
863 flux(il^s,1:nwflux) = 0.0d0
865 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))
868 wlctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
877 integer,
intent(in) :: ixi^
l,il^
l,idims,var
878 double precision,
intent(in) :: w(ixi^s,1:nw)
879 double precision,
intent(inout) :: wrc(ixi^s,1:nw)
881 double precision :: f_array(ixi^s,1:nw,3), d_array(3)
882 double precision :: beta(ixi^s,1:nw,3), beta_coeff(2)
883 double precision :: tau(ixi^s,1:nw), tmp(ixi^s,1:nw)
884 double precision :: u1_coeff(3), u2_coeff(3), u3_coeff(3)
885 double precision :: alpha_array(ixi^s,1:nw,3), alpha_sum(ixi^s,1:nw), flux(ixi^s,1:nw)
886 double precision :: wc(ixi^s,1:nw), we(ixi^s,1:nw)
887 double precision :: lambda(ixi^s)
888 double precision,
dimension(ixI^S,1:nw) :: wrctmp
889 integer :: ilm^
l,ilp^
l,ilpp^
l,ilppp^
l
890 integer :: im^
l, imp^
l
893 ilm^
l=il^
l-
kr(idims,^
d);
894 ilp^
l=il^
l+
kr(idims,^
d);
895 ilpp^
l=ilp^
l+
kr(idims,^
d);
896 ilppp^
l=ilpp^
l+
kr(idims,^
d);
899 imp^
l=im^
l+
kr(idims,^
d);
900 lambda(il^s)=
block%dx(il^s,idims)**weno_dx_exp
901 beta_coeff(1:2) = (/ 1.0833333333333333d0, 0.25d0/)
902 d_array(1:3) = (/ 1.0d0/10.0d0, 3.0d0/5.0d0, 3.0d0/10.0d0 /)
903 u1_coeff(1:3) = (/ -2.d0/3.d0, -1.d0/3.d0, 2.d0 /)
904 u2_coeff(1:3) = (/ -1.d0/3.d0, 2.d0/3.d0, 2.d0/3.d0 /)
905 u3_coeff(1:3) = (/ 2.d0/3.d0, 2.d0/3.d0, -1.d0/3.d0 /)
907 wc(im^s,i) = (
block%dx(imp^s,idims) * w(im^s,i) +
block%dx(im^s,idims) * w(imp^s,i)) / &
908 (
block%dx(imp^s,idims) +
block%dx(im^s,idims))
909 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)) / &
910 (
block%dx(ilppp^s,idims) +
block%dx(ilpp^s,idims))
913 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)
914 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)
915 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)
916 beta(il^s,1:nwflux,1) = beta_coeff(1) * (wc(ilp^s,1:nwflux) - we(il^s,1:nwflux))**2 &
917 + beta_coeff(2) * (2.d0 * w(ilp^s,1:nwflux) - wc(ilp^s,1:nwflux) - we(il^s,1:nwflux))**2
918 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 &
919 + beta_coeff(2) * (wc(ilp^s,1:nwflux) - wc(il^s,1:nwflux))**2
920 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 &
921 + beta_coeff(2) * (3.0d0 * wc(il^s, 1:nwflux) - 4.0d0 * w(il^s,1:nwflux) + wc(ilm^s,1:nwflux))**2
922 alpha_sum(il^s,1:nwflux) = 0.0d0
926 alpha_array(il^s,1:nwflux,i) = d_array(i)/(4.d0 * beta(il^s,1:nwflux,i) + weno_eps_machine)**2
927 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
930 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3)) * 4.d0
932 alpha_array(il^s,1:nwflux,i) = d_array(i) * (1.d0 + (tau(il^s,1:nwflux) / &
933 (4.d0 * beta(il^s,1:nwflux,i) + weno_eps_machine))**2)
934 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
937 tau(il^s,1:nwflux) = abs(beta(il^s,1:nwflux,1) - beta(il^s,1:nwflux,3)) * 4.d0
940 tmp(il^s,j) = (tau(il^s,j) + weno_eps_machine) / (4.d0 * beta(il^s,j,i) + weno_eps_machine)
941 alpha_array(il^s,j,i) = d_array(i) * (1.0d0 + tmp(il^s,j)**2 + lambda(il^s)/tmp(il^s,j))
942 alpha_sum(il^s,j) = alpha_sum(il^s,j) + alpha_array(il^s,j,i)
946 flux(il^s,1:nwflux) = 0.0d0
948 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))
951 wrctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
960 integer,
intent(in) :: ixi^
l, il^
l, idims
961 double precision,
intent(in) :: w(ixi^s,1:nw)
962 double precision,
intent(inout) :: wrc(ixi^s,1:nw),wlc(ixi^s,1:nw)
964 double precision :: f_array(ixi^s,1:nw,3), d_array(3)
965 double precision :: beta(ixi^s,1:nw,3), beta_coeff(2)
966 double precision :: u1_coeff(3), u2_coeff(3), u3_coeff(3)
967 double precision :: alpha_array(ixi^s,1:nw,3), alpha_sum(ixi^s,1:nw)
968 double precision :: theta2(ixi^s,1:nw)
969 double precision,
parameter :: theta_limit=0.7d0
970 double precision,
dimension(ixI^S,1:nw) :: wrctmp, wlctmp
971 integer :: ilm^
l, ilmm^
l, ilp^
l, ilpp^
l, ilppp^
l
974 ilm^
l=il^
l-
kr(idims,^
d);
975 ilmm^
l=ilm^
l-
kr(idims,^
d);
976 ilp^
l=il^
l+
kr(idims,^
d);
977 ilpp^
l=ilp^
l+
kr(idims,^
d);
978 ilppp^
l=ilpp^
l+
kr(idims,^
d);
980 beta_coeff(1:2) = (/ 1.0833333333333333d0, 0.25d0/)
981 d_array(1:3) = (/ 1.0d0/10.0d0, 3.0d0/5.0d0, 3.0d0/10.0d0 /)
982 u1_coeff(1:3) = (/ 1.d0/3.d0, -7.d0/6.d0, 11.d0/6.d0 /)
983 u2_coeff(1:3) = (/ -1.d0/6.d0, 5.d0/6.d0, 1.d0/3.d0 /)
984 u3_coeff(1:3) = (/ 1.d0/3.d0, 5.d0/6.d0, -1.d0/6.d0 /)
987 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&
988 +beta_coeff(2)*(w(ilmm^s,1:nwflux)-4.0d0*w(ilm^s,1:nwflux)+3.0d0*w(il^s,1:nwflux))**2
989 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&
990 +beta_coeff(2)*(w(ilm^s,1:nwflux)-w(ilp^s,1:nwflux))**2
991 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&
992 +beta_coeff(2)*(3.0d0*w(il^s,1:nwflux)-4.0d0*w(ilp^s,1:nwflux)+w(ilpp^s,1:nwflux))**2
993 alpha_sum(il^s,1:nwflux)=zero
995 alpha_array(il^s,1:nwflux,i)=d_array(i)/(beta(il^s,1:nwflux,i)+weno_eps_machine)**2
996 alpha_sum(il^s,1:nwflux)=alpha_sum(il^s,1:nwflux)+alpha_array(il^s,1:nwflux,i)
999 alpha_array(il^s,1:nwflux,i)=alpha_array(il^s,1:nwflux,i)/alpha_sum(il^s,1:nwflux)
1001 theta2(il^s,1:nwflux)=((alpha_array(il^s,1:nwflux,1)/d_array(1)-1.d0)**2&
1002 +(alpha_array(il^s,1:nwflux,2)/d_array(2)-1.d0)**2&
1003 +(alpha_array(il^s,1:nwflux,3)/d_array(3)-1.d0)**2)/83.d0
1004 where(theta2(il^s,1:nwflux) .gt. theta_limit)
1005 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)
1006 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)
1007 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)
1008 wlctmp(il^s,1:nwflux)=f_array(il^s,1:nwflux,1)*alpha_array(il^s,1:nwflux,1)&
1009 +f_array(il^s,1:nwflux,2)*alpha_array(il^s,1:nwflux,2)&
1010 +f_array(il^s,1:nwflux,3)*alpha_array(il^s,1:nwflux,3)
1012 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)&
1013 +37.d0*w(ilp^s,1:nwflux)-8.d0*w(ilpp^s,1:nwflux)+w(ilppp^s,1:nwflux))
1017 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&
1018 +beta_coeff(2)*(w(ilppp^s,1:nwflux)-4.0d0*w(ilpp^s,1:nwflux)+3.0d0*w(ilp^s,1:nwflux))**2
1019 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&
1020 +beta_coeff(2)*(w(ilpp^s,1:nwflux)-w(il^s,1:nwflux))**2
1021 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&
1022 +beta_coeff(2)*(3.0d0*w(ilp^s,1:nwflux)-4.0d0*w(il^s,1:nwflux)+w(ilm^s,1:nwflux))**2
1023 alpha_sum(il^s,1:nwflux)=zero
1025 alpha_array(il^s,1:nwflux,i)=d_array(i)/(beta(il^s,1:nwflux,i)+weno_eps_machine)**2
1026 alpha_sum(il^s,1:nwflux)=alpha_sum(il^s,1:nwflux)+alpha_array(il^s,1:nwflux,i)
1029 alpha_array(il^s,1:nwflux,i)=alpha_array(il^s,1:nwflux,i)/alpha_sum(il^s,1:nwflux)
1031 theta2(il^s,1:nwflux)=((alpha_array(il^s,1:nwflux,1)/d_array(1)-1.d0)**2&
1032 +(alpha_array(il^s,1:nwflux,2)/d_array(2)-1.d0)**2&
1033 +(alpha_array(il^s,1:nwflux,3)/d_array(3)-1.d0)**2)/83.d0
1034 where(theta2(il^s,1:nwflux) .gt. theta_limit)
1035 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)
1036 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)
1037 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)
1038 wrctmp(il^s,1:nwflux)=f_array(il^s,1:nwflux,1)*alpha_array(il^s,1:nwflux,1)&
1039 +f_array(il^s,1:nwflux,2)*alpha_array(il^s,1:nwflux,2)&
1040 +f_array(il^s,1:nwflux,3)*alpha_array(il^s,1:nwflux,3)
1042 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)&
1043 +37.d0*w(il^s,1:nwflux)-8.d0*w(ilm^s,1:nwflux)+w(ilmm^s,1:nwflux))
1053 integer,
intent(in) :: ixi^
l, il^
l, idims, var
1054 double precision,
intent(in) :: w(ixi^s,1:nw)
1055 double precision,
intent(inout) :: wrc(ixi^s,1:nw),wlc(ixi^s,1:nw)
1057 double precision,
dimension(4) :: d_array, u1_coeff, u2_coeff, u3_coeff, u4_coeff
1058 double precision,
dimension(ixI^S,1:nw,4) :: f_array, beta, alpha_array
1059 double precision,
dimension(ixI^S) :: a, b, c, tmp, tmp2, tmp3
1060 double precision,
dimension(ixI^S,1:nw) :: alpha_sum,
d, dm4
1061 double precision,
dimension(ixI^S,1:nw) :: flux, flux_min, flux_max, flux_ul, flux_md, flux_lc
1062 double precision,
parameter :: mpalpha = 2.d0, mpbeta = 4.d0
1063 double precision,
dimension(ixI^S,1:nw) :: wrctmp, wlctmp
1064 integer :: ilm^
l, ilmm^
l, ilmmm^
l
1065 integer :: ilp^
l, ilpp^
l, ilppp^
l, ilpppp^
l
1066 integer :: id^
l, idp^
l, idpp^
l, idm^
l, ie^
l, iem^
l, iep^
l, iepp^
l
1069 ilm^
l=il^
l-
kr(idims,^
d);
1070 ilmm^
l=ilm^
l-
kr(idims,^
d);
1071 ilmmm^
l=ilmm^
l-
kr(idims,^
d);
1072 ilp^
l=il^
l+
kr(idims,^
d);
1073 ilpp^
l=ilp^
l+
kr(idims,^
d);
1074 ilppp^
l=ilpp^
l+
kr(idims,^
d);
1075 ilpppp^
l=ilppp^
l+
kr(idims,^
d);
1077 d_array(1:4) = (/ 1.d0/35.d0, 12.d0/35.d0, 18.d0/35.d0, 4.d0/35.d0 /)
1078 u1_coeff(1:4) = (/ -1.d0/4.d0, 13.d0/12.d0, -23.d0/12.d0, 25.d0/12.d0 /)
1079 u2_coeff(1:4) = (/ 1.d0/12.d0, -5.d0/12.d0, 13.d0/12.d0, 1.d0/4.d0 /)
1080 u3_coeff(1:4) = (/ -1.d0/12.d0, 7.d0/12.d0, 7.d0/12.d0, -1.d0/12.d0 /)
1081 u4_coeff(1:4) = (/ 1.d0/4.d0, 13.d0/12.d0, -5.d0/12.d0, 1.d0/12.d0 /)
1084 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) &
1085 + u1_coeff(4) * w(il^s,1:nwflux)
1086 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) &
1087 + u2_coeff(4) * w(ilp^s,1:nwflux)
1088 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) &
1089 + u3_coeff(4) * w(ilpp^s,1:nwflux)
1090 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) &
1091 + u4_coeff(4) * w(ilppp^s,1:nwflux)
1093 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) &
1094 - 1854.d0 * w(il^s,1:nwflux)) &
1095 + 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)) &
1096 + 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
1097 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) &
1098 - 494.d0 * w(ilp^s,1:nwflux)) &
1099 + 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)) &
1100 + 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
1101 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) &
1102 - 494.d0 * w(ilpp^s,1:nwflux)) &
1103 + 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)) &
1104 + 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
1105 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) &
1106 - 1854.d0 * w(ilppp^s,1:nwflux)) &
1107 + 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)) &
1108 + w(ilpp^s,1:nwflux) * (7043.d0 * w(ilpp^s,1:nwflux) - 3882.d0 * w(ilppp^s,1:nwflux)) &
1109 + 547.d0 * w(ilppp^s,1:nwflux) ** 2
1111 alpha_sum(il^s,1:nwflux) = 0.0d0
1113 alpha_array(il^s,1:nwflux,i) = d_array(i)/(beta(il^s,1:nwflux,i) + weno_eps_machine)**2
1114 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
1116 flux(il^s,1:nwflux) = 0.0d0
1118 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))
1124 wlctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
1126 idmax^
d=ilmax^
d; idmin^
d=ilmin^
d-
kr(idims,^
d);
1127 idm^
l=id^
l-
kr(idims,^
d);
1128 idp^
l=id^
l+
kr(idims,^
d);
1130 iemax^
d=idmax^
d+
kr(idims,^
d); iemin^
d=idmin^
d;
1131 iem^
l=ie^
l-
kr(idims,^
d);
1132 iep^
l=ie^
l+
kr(idims,^
d);
1134 d(ie^s,1:nwflux) = w(iep^s,1:nwflux)-2.0d0*w(ie^s,1:nwflux)+w(iem^s,1:nwflux)
1137 a(id^s) = 4.0d0*
d(id^s,iw)-
d(idp^s,iw)
1138 b(id^s) = 4.0d0*
d(idp^s,iw)-
d(id^s,iw)
1140 a(id^s) =
d(id^s,iw)
1141 b(id^s) =
d(idp^s,iw)
1143 call minmod(ixi^
l,id^
l,tmp,tmp2,tmp3)
1144 dm4(id^s,iw) = tmp3(id^s)
1147 flux_ul(il^s,1:nwflux) = w(il^s,1:nwflux) + mpalpha * (w(il^s,1:nwflux) - w(ilm^s,1:nwflux))
1148 flux_md(il^s,1:nwflux) = half * (w(il^s,1:nwflux) + w(ilp^s,1:nwflux) - dm4(il^s,1:nwflux))
1149 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)
1151 flux_min(il^s,1:nwflux) = max(min(w(il^s,1:nwflux), w(ilp^s,1:nwflux), flux_md(il^s,1:nwflux)), &
1152 min(w(il^s,1:nwflux), flux_ul(il^s,1:nwflux),flux_lc(il^s,1:nwflux)))
1154 flux_max(il^s,1:nwflux) = min(max(w(il^s,1:nwflux), w(ilp^s,1:nwflux), flux_md(il^s,1:nwflux)), &
1155 max(w(il^s,1:nwflux), flux_ul(il^s,1:nwflux),flux_lc(il^s,1:nwflux)))
1157 a(il^s) = flux(il^s,iw)
1158 b(il^s) = flux_min(il^s,iw)
1159 c(il^s) = flux_max(il^s,iw)
1160 call median(ixi^
l, il^
l, a, b, c, tmp)
1161 wlctmp(il^s,iw) = tmp(il^s)
1173 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) &
1174 + u1_coeff(4) * w(ilp^s,1:nwflux)
1175 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) &
1176 + u2_coeff(4) * w(il^s,1:nwflux)
1177 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) &
1178 + u3_coeff(4) * w(ilm^s,1:nwflux)
1179 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) &
1180 + u4_coeff(4) * w(ilmm^s,1:nwflux)
1182 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) &
1183 - 1854.d0 * w(ilp^s,1:nwflux)) &
1184 + 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)) &
1185 + 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
1186 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) &
1187 - 494.d0 * w(il^s,1:nwflux)) &
1188 + 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)) &
1189 + 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
1190 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) &
1191 - 494.d0 * w(ilm^s,1:nwflux)) &
1192 + 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)) &
1193 + 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
1194 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) &
1195 - 1854.d0 * w(ilmm^s,1:nwflux)) &
1196 + 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)) &
1197 + 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
1199 alpha_sum(il^s,1:nwflux) = 0.0d0
1201 alpha_array(il^s,1:nwflux,i) = d_array(i)/(beta(il^s,1:nwflux,i) + weno_eps_machine)**2
1202 alpha_sum(il^s,1:nwflux) = alpha_sum(il^s,1:nwflux) + alpha_array(il^s,1:nwflux,i)
1204 flux(il^s,1:nwflux) = 0.0d0
1206 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))
1211 wrctmp(il^s,1:nwflux) = flux(il^s,1:nwflux)
1213 idmax^
d=ilmax^
d+
kr(idims,^
d); idmin^
d=ilmin^
d;
1214 idm^
l=id^
l-
kr(idims,^
d);
1215 idp^
l=id^
l+
kr(idims,^
d);
1217 iemax^
d=idmax^
d; iemin^
d=idmin^
d-
kr(idims,^
d);
1218 iem^
l=ie^
l-
kr(idims,^
d);
1219 iep^
l=ie^
l+
kr(idims,^
d);
1220 iepp^
l=iep^
l+
kr(idims,^
d);
1222 d(ie^s,1:nwflux) = w(ie^s,1:nwflux)-2.0d0*w(iep^s,1:nwflux)+w(iepp^s,1:nwflux)
1225 a(id^s) = 4.0d0*
d(id^s,iw)-
d(idm^s,iw)
1226 b(id^s) = 4.0d0*
d(idm^s,iw)-
d(id^s,iw)
1228 a(id^s) =
d(id^s,iw)
1229 b(id^s) =
d(idm^s,iw)
1231 call minmod(ixi^
l,id^
l,tmp,tmp2,tmp3)
1232 dm4(id^s,iw) = tmp3(id^s)
1235 flux_ul(il^s,1:nwflux) = w(ilp^s,1:nwflux) + mpalpha * (w(ilp^s,1:nwflux) - w(ilpp^s,1:nwflux))
1236 flux_md(il^s,1:nwflux) = half * (w(il^s,1:nwflux) + w(ilp^s,1:nwflux) - dm4(il^s,1:nwflux))
1237 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)
1239 flux_min(il^s,1:nwflux) = max(min(w(ilp^s,1:nwflux), w(il^s,1:nwflux), flux_md(il^s,1:nwflux)), &
1240 min(w(ilp^s,1:nwflux), flux_ul(il^s,1:nwflux),flux_lc(il^s,1:nwflux)))
1242 flux_max(il^s,1:nwflux) = min(max(w(ilp^s,1:nwflux), w(il^s,1:nwflux), flux_md(il^s,1:nwflux)), &
1243 max(w(ilp^s,1:nwflux), flux_ul(il^s,1:nwflux),flux_lc(il^s,1:nwflux)))
1245 a(il^s) = flux(il^s,iw)
1246 b(il^s) = flux_min(il^s,iw)
1247 c(il^s) = flux_max(il^s,iw)
1248 call median(ixi^
l, il^
l, a, b, c, tmp)
1249 wrctmp(il^s,iw) = tmp(il^s)
1261 integer,
intent(in) :: ixI^L, ixO^L
1262 double precision,
intent(in) :: a(ixI^S), b(ixI^S)
1263 double precision,
intent(out):: minm(ixI^S)
1265 minm(ixo^s) = (sign(one,a(ixo^s))+sign(one,b(ixo^s)))/2.0d0 * &
1266 min(abs(a(ixo^s)),abs(b(ixo^s)))
1274 integer,
intent(in) :: ixI^L, ixO^L
1275 double precision,
intent(in) :: a(ixI^S), b(ixI^S), c(ixI^S)
1276 double precision,
intent(out):: med(ixI^S)
1278 double precision :: tmp1(ixI^S),tmp2(ixI^S)
1280 tmp1(ixo^s) = b(ixo^s) - a(ixo^s); tmp2(ixo^s) = c(ixo^s) - a(ixo^s)
1282 med(ixo^s) = a(ixo^s) + (sign(one,tmp1(ixo^s))+sign(one,tmp2(ixo^s)))/2.0d0 * &
1283 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.
double precision, 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)