-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathModLimiter.f90
35 lines (27 loc) · 902 Bytes
/
ModLimiter.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
module ModLimiterGitm
implicit none
contains
!============================================================================
real function Limiter_minmod(dUp, dDown)
real :: dUp, dDown
Limiter_minmod = (sign(0.5,dUp) + sign(0.5,dDown))*min(abs(dUp),abs(dDown))
end function Limiter_minmod
!============================================================================
real function Limiter_mc(dUp, dDown)
use ModInputs, only:BetaLimiter
real :: dUp, dDown
if (dUp > 0.0) then
if (dDown > 0.0) then
Limiter_mc = min(BetaLimiter*dUp,BetaLimiter*dDown,(dUp+dDown)*0.5)
else
Limiter_mc = 0.0
endif
else
if (dDown < 0.0) then
Limiter_mc = max(BetaLimiter*dUp,BetaLimiter*dDown,(dUp+dDown)*0.5)
else
Limiter_mc = 0.0
endif
endif
end function Limiter_mc
end module ModLimiterGitm