3 #include "cpp_macros.h"
10 integer,
parameter :: af_num_limiters = 7
13 integer,
parameter,
public :: af_limiter_none_t = 1
15 integer,
parameter,
public :: af_limiter_vanleer_t = 2
17 integer,
parameter,
public :: af_limiter_koren_t = 3
19 integer,
parameter,
public :: af_limiter_minmod_t = 4
21 integer,
parameter,
public :: af_limiter_mc_t = 5
23 integer,
parameter,
public :: af_limiter_gminmod43_t = 6
25 integer,
parameter,
public :: af_limiter_zero_t = 7
28 logical,
parameter,
public :: af_limiter_symmetric(af_num_limiters) = &
29 [.true., .true., .false., .true., .true., .true., .true.]
31 public :: af_limiter_apply
32 public :: af_limiter_koren
33 public :: af_limiter_vanleer
34 public :: af_limiter_minmod
35 public :: af_limiter_gminmod43
36 public :: af_limiter_mc
41 elemental function af_limiter_apply(a, b, limiter)
result(slope)
42 real(dp),
intent(in) :: a
43 real(dp),
intent(in) :: b
44 integer,
intent(in) :: limiter
48 case (af_limiter_none_t)
49 slope = 0.5_dp * (a + b)
50 case (af_limiter_vanleer_t)
51 slope = af_limiter_vanleer(a, b)
52 case (af_limiter_koren_t)
53 slope = af_limiter_koren(a, b)
54 case (af_limiter_minmod_t)
55 slope = af_limiter_minmod(a, b)
56 case (af_limiter_mc_t)
57 slope = af_limiter_mc(a, b)
58 case (af_limiter_gminmod43_t)
59 slope = af_limiter_gminmod43(a, b)
60 case (af_limiter_zero_t)
64 slope = af_limiter_vanleer(a, b)
66 end function af_limiter_apply
72 elemental function af_limiter_koren(a, b)
result(bphi)
73 real(dp),
intent(in) :: a
74 real(dp),
intent(in) :: b
75 real(dp),
parameter :: third = 1/3.0_dp
76 real(dp) :: bphi, aa, ab
85 else if (aa <= 0.25_dp * ab)
then
88 else if (aa <= 2.5_dp * ab)
then
90 bphi = third * (b + 2*a)
95 end function af_limiter_koren
97 elemental function af_limiter_vanleer(a, b)
result(phi)
98 real(dp),
intent(in) :: a
99 real(dp),
intent(in) :: b
106 phi = 2 * ab / (a + b)
110 end function af_limiter_vanleer
112 elemental function af_limiter_minmod(a, b)
result(phi)
113 real(dp),
intent(in) :: a
114 real(dp),
intent(in) :: b
116 phi = af_limiter_gminmod(a, b, 1.0_dp)
117 end function af_limiter_minmod
120 elemental function af_limiter_gminmod43(a, b)
result(phi)
121 real(dp),
intent(in) :: a
122 real(dp),
intent(in) :: b
124 real(dp),
parameter :: theta = 4/3.0_dp
125 phi = af_limiter_gminmod(a, b, theta)
126 end function af_limiter_gminmod43
129 elemental function af_limiter_mc(a, b)
result(phi)
130 real(dp),
intent(in) :: a
131 real(dp),
intent(in) :: b
133 phi = af_limiter_gminmod(a, b, 2.0_dp)
134 end function af_limiter_mc
139 elemental function af_limiter_gminmod(a, b, theta)
result(phi)
140 real(dp),
intent(in) :: a, b, theta
144 phi = sign(minval(abs([theta * a, theta * b, &
145 0.5_dp * (a + b)])), a)
149 end function af_limiter_gminmod
Module containing slope limiters.
This module contains the basic types and constants that are used in the NDIM-dimensional version of A...