20 integer,
intent(in) :: ixi^
l, il^
l, idims
21 double precision,
intent(in) :: w(ixi^s,1:nw)
23 double precision,
intent(inout) :: wrc(ixi^s,1:nw),wlc(ixi^s,1:nw)
25 double precision,
dimension(ixI^S,1:nw) :: f, fmp, fmin, fmax, ful, dm4,
d, fmd, flc, flim
26 double precision,
dimension(ixI^S,1:nw) :: wrctmp, wlctmp
27 double precision,
dimension(ixI^S) :: tmp, tmp2, tmp3, a, b, c
28 double precision,
parameter :: eps=0.d0, alpha=4.0d0
30 integer :: ilm^
l, ilmm^
l, ilp^
l, ilpp^
l, ilppp^
l
31 integer :: id^
l, idp^
l, idpp^
l, idm^
l, ie^
l, iem^
l, iep^
l, iepp^
l
49 ilm^
l=il^
l-
kr(idims,^
d);
50 ilmm^
l=ilm^
l-
kr(idims,^
d);
51 ilp^
l=il^
l+
kr(idims,^
d);
52 ilpp^
l=ilp^
l+
kr(idims,^
d);
54 f(il^s,1:nwflux) = 1.0d0/60.0d0 * (&
55 2.0d0* w(ilmm^s,1:nwflux) &
56 - 13.0d0* w(ilm^s,1:nwflux) &
57 + 47.0d0* w(il^s,1:nwflux) &
58 + 27.0d0* w(ilp^s,1:nwflux) &
59 - 3.0d0* w(ilpp^s,1:nwflux))
63 a(il^s) = w(ilp^s,iw)-w(il^s,iw)
64 b(il^s) = alpha*(w(il^s,iw)-w(ilm^s,iw))
66 fmp(il^s,iw) = w(il^s,iw) + tmp(il^s)
67 ful(il^s,iw) = w(il^s,iw) + b(il^s)
71 idmax^
d=ilmax^
d; idmin^
d=ilmin^
d-
kr(idims,^
d);
72 idm^
l=id^
l-
kr(idims,^
d);
73 idp^
l=id^
l+
kr(idims,^
d);
75 iemax^
d=idmax^
d+
kr(idims,^
d); iemin^
d=idmin^
d;
76 iem^
l=ie^
l-
kr(idims,^
d);
77 iep^
l=ie^
l+
kr(idims,^
d);
79 d(ie^s,1:nwflux) = w(iep^s,1:nwflux)-2.0d0*w(ie^s,1:nwflux)+w(iem^s,1:nwflux)
82 a(id^s) = 4.0d0*
d(id^s,iw)-
d(idp^s,iw)
83 b(id^s) = 4.0d0*
d(idp^s,iw)-
d(id^s,iw)
88 call minmod(ixi^
l,id^
l,tmp,tmp2,tmp3)
89 dm4(id^s,iw) = tmp3(id^s)
93 fmd(il^s,1:nwflux) = (w(il^s,1:nwflux)+w(ilp^s,1:nwflux))/2.0d0-dm4(il^s,1:nwflux)/2.0d0
96 flc(il^s,1:nwflux) = half*(3.0d0*w(il^s,1:nwflux) &
97 - w(ilm^s,1:nwflux)) + 4.0d0/3.0d0*dm4(ilm^s,1:nwflux)
99 fmin(il^s,1:nwflux) = max(min(w(il^s,1:nwflux),w(ilp^s,1:nwflux),fmd(il^s,1:nwflux)),&
100 min(w(il^s,1:nwflux),ful(il^s,1:nwflux),flc(il^s,1:nwflux)))
102 fmax(il^s,1:nwflux) = min(max(w(il^s,1:nwflux),w(ilp^s,1:nwflux),fmd(il^s,1:nwflux)),&
103 max(w(il^s,1:nwflux),ful(il^s,1:nwflux),flc(il^s,1:nwflux)))
106 a(il^s) = fmin(il^s,iw)
108 c(il^s) = fmax(il^s,iw)
110 flim(il^s,iw) = tmp(il^s)
114 where ((f(il^s,1:nwflux)-w(il^s,1:nwflux))*(f(il^s,1:nwflux)-fmp(il^s,1:nwflux)) .le. eps)
115 wlctmp(il^s,1:nwflux) = f(il^s,1:nwflux)
117 wlctmp(il^s,1:nwflux) = flim(il^s,1:nwflux)
130 ilppp^
l=ilpp^
l+
kr(idims,^
d);
132 f(il^s,1:nwflux) = 1.0d0/60.0d0 * (&
133 2.0d0* w(ilppp^s,1:nwflux) &
134 - 13.0d0* w(ilpp^s,1:nwflux) &
135 + 47.0d0* w(ilp^s,1:nwflux) &
136 + 27.0d0* w(il^s,1:nwflux) &
137 - 3.0d0* w(ilm^s,1:nwflux))
141 a(il^s) = w(il^s,iw)-w(ilp^s,iw)
142 b(il^s) = alpha*(w(ilp^s,iw)-w(ilpp^s,iw))
144 fmp(il^s,iw) = w(ilp^s,iw) + tmp(il^s)
145 ful(il^s,iw) = w(ilp^s,iw) + b(il^s)
149 idmax^
d=ilmax^
d+
kr(idims,^
d); idmin^
d=ilmin^
d;
150 idm^
l=id^
l-
kr(idims,^
d);
151 idp^
l=id^
l+
kr(idims,^
d);
153 iemax^
d=idmax^
d; iemin^
d=idmin^
d-
kr(idims,^
d);
154 iem^
l=ie^
l-
kr(idims,^
d);
155 iep^
l=ie^
l+
kr(idims,^
d);
156 iepp^
l=iep^
l+
kr(idims,^
d);
158 d(ie^s,1:nwflux) = w(ie^s,1:nwflux)-2.0d0*w(iep^s,1:nwflux)+w(iepp^s,1:nwflux)
161 a(id^s) = 4.0d0*
d(id^s,iw)-
d(idm^s,iw)
162 b(id^s) = 4.0d0*
d(idm^s,iw)-
d(id^s,iw)
165 b(id^s) =
d(idm^s,iw)
167 call minmod(ixi^
l,id^
l,tmp,tmp2,tmp3)
168 dm4(id^s,iw) = tmp3(id^s)
172 fmd(il^s,1:nwflux) = (w(il^s,1:nwflux)+w(ilp^s,1:nwflux))/2.0d0-dm4(il^s,1:nwflux)/2.0d0
175 flc(il^s,1:nwflux) = half*(3.0d0*w(ilp^s,1:nwflux) &
176 - w(ilpp^s,1:nwflux)) + 4.0d0/3.0d0*dm4(ilp^s,1:nwflux)
178 fmin(il^s,1:nwflux) = max(min(w(ilp^s,1:nwflux),w(il^s,1:nwflux),fmd(il^s,1:nwflux)),&
179 min(w(ilp^s,1:nwflux),ful(il^s,1:nwflux),flc(il^s,1:nwflux)))
181 fmax(il^s,1:nwflux) = min(max(w(ilp^s,1:nwflux),w(il^s,1:nwflux),fmd(il^s,1:nwflux)),&
182 max(w(ilp^s,1:nwflux),ful(il^s,1:nwflux),flc(il^s,1:nwflux)))
185 a(il^s) = fmin(il^s,iw)
187 c(il^s) = fmax(il^s,iw)
189 flim(il^s,iw) = tmp(il^s)
193 where ((f(il^s,1:nwflux)-w(ilp^s,1:nwflux))*(f(il^s,1:nwflux)-fmp(il^s,1:nwflux)) .le. eps)
194 wrctmp(il^s,1:nwflux) = f(il^s,1:nwflux)
196 wrctmp(il^s,1:nwflux) = flim(il^s,1:nwflux)
207 integer,
intent(in) :: ixi^
l, il^
l, idims
208 double precision,
intent(in) :: w(ixi^s,1:nw)
210 double precision,
intent(inout) :: wlc(ixi^s,1:nw)
212 double precision,
dimension(ixI^S,1:nw) :: f, fmp, fmin, fmax, ful, dm4,
d, fmd, flc, flim
213 double precision,
dimension(ixI^S) :: tmp, tmp2, tmp3, a, b, c
214 double precision,
parameter :: eps=0.d0, alpha=4.0d0
217 integer :: ilm^
l, ilmm^
l, ilp^
l, ilpp^
l
218 integer :: id^
l, idp^
l, idpp^
l, idm^
l, ie^
l, iem^
l, iep^
l, iepp^
l
225 ilm^
l=il^
l-
kr(idims,^
d);
226 ilmm^
l=ilm^
l-
kr(idims,^
d);
227 ilp^
l=il^
l+
kr(idims,^
d);
228 ilpp^
l=ilp^
l+
kr(idims,^
d);
230 f(il^s,1:nwflux) = 1.0d0/60.0d0 * (&
231 2.0d0* w(ilmm^s,1:nwflux) &
232 - 13.0d0* w(ilm^s,1:nwflux) &
233 + 47.0d0* w(il^s,1:nwflux) &
234 + 27.0d0* w(ilp^s,1:nwflux) &
235 - 3.0d0* w(ilpp^s,1:nwflux))
239 a(il^s) = w(ilp^s,iw)-w(il^s,iw)
240 b(il^s) = alpha*(w(il^s,iw)-w(ilm^s,iw))
242 fmp(il^s,iw) = w(il^s,iw) + tmp(il^s)
243 ful(il^s,iw) = w(il^s,iw) + b(il^s)
247 idmax^
d=ilmax^
d; idmin^
d=ilmin^
d-
kr(idims,^
d);
248 idm^
l=id^
l-
kr(idims,^
d);
249 idp^
l=id^
l+
kr(idims,^
d);
251 iemax^
d=idmax^
d+
kr(idims,^
d); iemin^
d=idmin^
d;
252 iem^
l=ie^
l-
kr(idims,^
d);
253 iep^
l=ie^
l+
kr(idims,^
d);
255 d(ie^s,1:nwflux) = w(iep^s,1:nwflux)-2.0d0*w(ie^s,1:nwflux)+w(iem^s,1:nwflux)
258 a(id^s) = 4.0d0*
d(id^s,iw)-
d(idp^s,iw)
259 b(id^s) = 4.0d0*
d(idp^s,iw)-
d(id^s,iw)
262 b(id^s) =
d(idp^s,iw)
264 call minmod(ixi^
l,id^
l,tmp,tmp2,tmp3)
265 dm4(id^s,iw) = tmp3(id^s)
269 fmd(il^s,1:nwflux) = (w(il^s,1:nwflux)+w(ilp^s,1:nwflux))/2.0d0-dm4(il^s,1:nwflux)/2.0d0
272 flc(il^s,1:nwflux) = half*(3.0d0*w(il^s,1:nwflux) &
273 - w(ilm^s,1:nwflux)) + 4.0d0/3.0d0*dm4(ilm^s,1:nwflux)
275 fmin(il^s,1:nwflux) = max(min(w(il^s,1:nwflux),w(ilp^s,1:nwflux),fmd(il^s,1:nwflux)),&
276 min(w(il^s,1:nwflux),ful(il^s,1:nwflux),flc(il^s,1:nwflux)))
278 fmax(il^s,1:nwflux) = min(max(w(il^s,1:nwflux),w(ilp^s,1:nwflux),fmd(il^s,1:nwflux)),&
279 max(w(il^s,1:nwflux),ful(il^s,1:nwflux),flc(il^s,1:nwflux)))
282 a(il^s) = fmin(il^s,iw)
284 c(il^s) = fmax(il^s,iw)
286 flim(il^s,iw) = tmp(il^s)
290 where ((f(il^s,1:nwflux)-w(il^s,1:nwflux))*(f(il^s,1:nwflux)-fmp(il^s,1:nwflux)) .le. eps)
291 wlc(il^s,1:nwflux) = f(il^s,1:nwflux)
293 wlc(il^s,1:nwflux) = flim(il^s,1:nwflux)
304 integer,
intent(in) :: ixi^
l, il^
l, idims
305 double precision,
intent(in) :: w(ixi^s,1:nw)
307 double precision,
intent(inout) :: wrc(ixi^s,1:nw)
309 double precision,
dimension(ixI^S,1:nw) :: f, fmp, fmin, fmax, ful, dm4,
d, fmd, flc, flim
310 double precision,
dimension(ixI^S) :: tmp, tmp2, tmp3, a, b, c
311 double precision,
parameter :: eps=0.d0, alpha=4.0d0
312 integer :: ilm^
l, ilp^
l, ilpp^
l, ilppp^
l
313 integer :: id^
l, idp^
l, idpp^
l, idm^
l, ie^
l, iem^
l, iep^
l, iepp^
l
328 ilm^
l=il^
l-
kr(idims,^
d);
329 ilp^
l=il^
l+
kr(idims,^
d);
330 ilpp^
l=ilp^
l+
kr(idims,^
d);
331 ilppp^
l=ilpp^
l+
kr(idims,^
d);
333 f(il^s,1:nwflux) = 1.0d0/60.0d0 * (&
334 2.0d0* w(ilppp^s,1:nwflux) &
335 - 13.0d0* w(ilpp^s,1:nwflux) &
336 + 47.0d0* w(ilp^s,1:nwflux) &
337 + 27.0d0* w(il^s,1:nwflux) &
338 - 3.0d0* w(ilm^s,1:nwflux))
342 a(il^s) = w(il^s,iw)-w(ilp^s,iw)
343 b(il^s) = alpha*(w(ilp^s,iw)-w(ilpp^s,iw))
345 fmp(il^s,iw) = w(ilp^s,iw) + tmp(il^s)
346 ful(il^s,iw) = w(ilp^s,iw) + b(il^s)
350 idmax^
d=ilmax^
d+
kr(idims,^
d); idmin^
d=ilmin^
d;
351 idm^
l=id^
l-
kr(idims,^
d);
352 idp^
l=id^
l+
kr(idims,^
d);
354 iemax^
d=idmax^
d; iemin^
d=idmin^
d-
kr(idims,^
d);
355 iem^
l=ie^
l-
kr(idims,^
d);
356 iep^
l=ie^
l+
kr(idims,^
d);
357 iepp^
l=iep^
l+
kr(idims,^
d);
359 d(ie^s,1:nwflux) = w(ie^s,1:nwflux)-2.0d0*w(iep^s,1:nwflux)+w(iepp^s,1:nwflux)
362 a(id^s) = 4.0d0*
d(id^s,iw)-
d(idm^s,iw)
363 b(id^s) = 4.0d0*
d(idm^s,iw)-
d(id^s,iw)
366 b(id^s) =
d(idm^s,iw)
368 call minmod(ixi^
l,id^
l,tmp,tmp2,tmp3)
369 dm4(id^s,iw) = tmp3(id^s)
373 fmd(il^s,1:nwflux) = (w(il^s,1:nwflux)+w(ilp^s,1:nwflux))/2.0d0-dm4(il^s,1:nwflux)/2.0d0
376 flc(il^s,1:nwflux) = half*(3.0d0*w(ilp^s,1:nwflux) &
377 - w(ilpp^s,1:nwflux)) + 4.0d0/3.0d0*dm4(ilp^s,1:nwflux)
379 fmin(il^s,1:nwflux) = max(min(w(ilp^s,1:nwflux),w(il^s,1:nwflux),fmd(il^s,1:nwflux)),&
380 min(w(ilp^s,1:nwflux),ful(il^s,1:nwflux),flc(il^s,1:nwflux)))
382 fmax(il^s,1:nwflux) = min(max(w(ilp^s,1:nwflux),w(il^s,1:nwflux),fmd(il^s,1:nwflux)),&
383 max(w(ilp^s,1:nwflux),ful(il^s,1:nwflux),flc(il^s,1:nwflux)))
386 a(il^s) = fmin(il^s,iw)
388 c(il^s) = fmax(il^s,iw)
390 flim(il^s,iw) = tmp(il^s)
394 where ((f(il^s,1:nwflux)-w(ilp^s,1:nwflux))*(f(il^s,1:nwflux)-fmp(il^s,1:nwflux)) .le. eps)
395 wrc(il^s,1:nwflux) = f(il^s,1:nwflux)
397 wrc(il^s,1:nwflux) = flim(il^s,1:nwflux)
408 integer,
intent(in) :: ixI^L, ixO^L
409 double precision,
intent(in) :: a(ixI^S), b(ixI^S)
410 double precision,
intent(out):: minm(ixI^S)
412 minm(ixo^s) = (sign(one,a(ixo^s))+sign(one,b(ixo^s)))/2.0d0 * &
413 min(abs(a(ixo^s)),abs(b(ixo^s)))
421 integer,
intent(in) :: ixI^L, ixO^L
422 double precision,
intent(in) :: a(ixI^S), b(ixI^S), c(ixI^S)
423 double precision,
intent(out):: med(ixI^S)
425 double precision :: tmp1(ixI^S),tmp2(ixI^S)
427 tmp1(ixo^s) = b(ixo^s) - a(ixo^s); tmp2(ixo^s) = c(ixo^s) - a(ixo^s)
429 med(ixo^s) = a(ixo^s) + (sign(one,tmp1(ixo^s))+sign(one,tmp2(ixo^s)))/2.0d0 * &
430 min(abs(tmp1(ixo^s)),abs(tmp2(ixo^s)))
441 integer,
intent(in) :: ixi^
l, il^
l, idims
442 double precision,
intent(in) :: w(ixi^s)
443 double precision,
intent(inout) :: wrc(ixi^s),wlc(ixi^s)
445 double precision,
dimension(ixI^S) :: f, fmp, fmin, fmax, ful, dm4,
d, fmd, flc, flim
446 double precision,
dimension(ixI^S) :: wrctmp, wlctmp
447 double precision,
dimension(ixI^S) :: tmp, tmp2, tmp3, a, b, c
448 double precision,
parameter :: eps=0.0d0, alpha=4.0d0
450 integer :: ilm^
l, ilmm^
l, ilp^
l, ilpp^
l, ilppp^
l
451 integer :: id^
l, idp^
l, idpp^
l, idm^
l, ie^
l, iem^
l, iep^
l, iepp^
l
467 ilm^
l=il^
l-
kr(idims,^
d);
468 ilmm^
l=ilm^
l-
kr(idims,^
d);
469 ilp^
l=il^
l+
kr(idims,^
d);
470 ilpp^
l=ilp^
l+
kr(idims,^
d);
472 f(il^s) = 1.0d0/60.0d0 * (&
480 a(il^s) = w(ilp^s)-w(il^s)
481 b(il^s) = alpha*(w(il^s)-w(ilm^s))
483 fmp(il^s) = w(il^s) + tmp(il^s)
484 ful(il^s) = w(il^s) + b(il^s)
487 idmax^
d=ilmax^
d; idmin^
d=ilmin^
d-
kr(idims,^
d);
488 idm^
l=id^
l-
kr(idims,^
d);
489 idp^
l=id^
l+
kr(idims,^
d);
491 iemax^
d=idmax^
d+
kr(idims,^
d); iemin^
d=idmin^
d;
492 iem^
l=ie^
l-
kr(idims,^
d);
493 iep^
l=ie^
l+
kr(idims,^
d);
495 d(ie^s) = w(iep^s)-2.0d0*w(ie^s)+w(iem^s)
497 a(id^s) = 4.0d0*
d(id^s)-
d(idp^s)
498 b(id^s) = 4.0d0*
d(idp^s)-
d(id^s)
503 call minmod(ixi^
l,id^
l,tmp,tmp2,tmp3)
504 dm4(id^s) = tmp3(id^s)
507 fmd(il^s) = (w(il^s)+w(ilp^s))/2.0d0-dm4(il^s)/2.0d0
510 flc(il^s) = half*(3.0d0*w(il^s) &
511 - w(ilm^s)) + 4.0d0/3.0d0*dm4(ilm^s)
513 fmin(il^s) = max(min(w(il^s),w(ilp^s),fmd(il^s)),&
514 min(w(il^s),ful(il^s),flc(il^s)))
516 fmax(il^s) = min(max(w(il^s),w(ilp^s),fmd(il^s)),&
517 max(w(il^s),ful(il^s),flc(il^s)))
519 call median(ixi^
l,il^
l,fmin,f,fmax,tmp)
520 flim(il^s) = tmp(il^s)
523 where ((f(il^s)-w(il^s))*(f(il^s)-fmp(il^s)) .le. eps)
526 wlc(il^s) = flim(il^s)
539 ilppp^
l=ilpp^
l+
kr(idims,^
d);
541 f(il^s) = 1.0d0/60.0d0 * (&
543 - 13.0d0* w(ilpp^s) &
549 a(il^s) = w(il^s)-w(ilp^s)
550 b(il^s) = alpha*(w(ilp^s)-w(ilpp^s))
552 fmp(il^s) = w(ilp^s) + tmp(il^s)
553 ful(il^s) = w(ilp^s) + b(il^s)
556 idmax^
d=ilmax^
d+
kr(idims,^
d); idmin^
d=ilmin^
d;
557 idm^
l=id^
l-
kr(idims,^
d);
558 idp^
l=id^
l+
kr(idims,^
d);
560 iemax^
d=idmax^
d; iemin^
d=idmin^
d-
kr(idims,^
d);
561 iem^
l=ie^
l-
kr(idims,^
d);
562 iep^
l=ie^
l+
kr(idims,^
d);
563 iepp^
l=iep^
l+
kr(idims,^
d);
565 d(ie^s) = w(ie^s)-2.0d0*w(iep^s)+w(iepp^s)
567 a(id^s) = 4.0d0*
d(id^s)-
d(idm^s)
568 b(id^s) = 4.0d0*
d(idm^s)-
d(id^s)
573 call minmod(ixi^
l,id^
l,tmp,tmp2,tmp3)
574 dm4(id^s) = tmp3(id^s)
577 fmd(il^s) = (w(il^s)+w(ilp^s))/2.0d0-dm4(il^s)/2.0d0
580 flc(il^s) = half*(3.0d0*w(ilp^s) &
581 - w(ilpp^s)) + 4.0d0/3.0d0*dm4(ilp^s)
583 fmin(il^s) = max(min(w(ilp^s),w(il^s),fmd(il^s)),&
584 min(w(ilp^s),ful(il^s),flc(il^s)))
586 fmax(il^s) = min(max(w(ilp^s),w(il^s),fmd(il^s)),&
587 max(w(ilp^s),ful(il^s),flc(il^s)))
589 call median(ixi^
l,il^
l,fmin,f,fmax,flim)
592 where ((f(il^s)-w(ilp^s))*(f(il^s)-fmp(il^s)) .le. eps)
595 wrc(il^s) = flim(il^s)
This module contains definitions of global parameters and variables and some generic functions/subrou...
integer, dimension(3, 3) kr
Kronecker delta tensor.
double precision, dimension(:), allocatable, parameter d
Module containing the MP5 (fifth order) flux scheme.
subroutine, public mp5limiter(ixIL, iLL, idims, w, wLC, wRC)
MP5 limiter from Suresh & Huynh 1997 Following the convention of Mignone et al. 2010....
subroutine median(ixIL, ixOL, a, b, c, med)
subroutine minmod(ixIL, ixOL, a, b, minm)
subroutine, public mp5limitervar(ixIL, iLL, idims, w, wLC, wRC)
MP5 limiter from Suresh & Huynh 1997 Following the convention of Mignone et al. 2010....
subroutine, public mp5limiterr(ixIL, iLL, idims, w, wRC)
subroutine, public mp5limiterl(ixIL, iLL, idims, w, wLC)
subroutine, public fix_limiter1(ixIL, iLL, wLCin, wRCin, wLCout, wRCout)