-
Notifications
You must be signed in to change notification settings - Fork 1
/
rhs.F90
executable file
·96 lines (80 loc) · 2.39 KB
/
rhs.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
module rhs
contains
SUBROUTINE rhs_WENO(fout, fin)
USE prms
IMPLICIT NONE
integer :: i
REAL, INTENT(OUT) :: fout(3,0:n)
REAL, INTENT(IN) :: fin(3,0:n)
fout = 0.
do i = 1,3
fout(i,6:n-5) = -dxi * (fin(i,6:n-5) - fin(i,5:n-6))
fout(i,0:5) = 0.; fout(i,n-4:n) = 0.
end do
END SUBROUTINE rhs_WENO
SUBROUTINE rhs_FV(fout, fin, uin)
use prms
IMPLICIT NONE
integer :: i
real, INTENT(IN) :: fin(3,0:n), uin(3,0:n)
real, INTENT(OUT) :: fout(3,0:n)
real :: myeps
myeps = maxwavespeed
fout = 0.
do i = 1,3
fout(i,1:n-1) = -dxi * 0.5 *( fin(i,2:n) - fin(i,0:n-2) - myeps*(uin(i,2:n) -2.*uin(i,1:n-1) + uin(i,0:n-2)) )
end do
fout(i,0:5) = 0.; fout(i,n-4:n) = 0.
END SUBROUTINE rhs_FV
SUBROUTINE rhs_FVb(fout, uin)
use prms
IMPLICIT NONE
integer :: i
real, INTENT(IN) :: uin(3,0:n)
real, INTENT(OUT) :: fout(3,0:n)
real :: myeps
!myeps = maxwavespeed
!myeps = 1
!myeps = minval( (/ maxwavespeed, 1. /) )
myeps = 0.
fout = 0.
do i = 1,3
!fout(i,1:n-1) = dxi * 0.5 *( uin(i,2:n) - uin(i,0:n-2) + myeps*(uin(i,2:n) -2.*uin(i,1:n-1) + uin(i,0:n-2)) )
fout(i,5:n-6) = dxi * 0.5 *( uin(i,6:n-5) - uin(i,4:n-7) + myeps*(uin(i,6:n-5) -2.*uin(i,5:n-6) + uin(i,4:n-7)) )
end do
fout(i,0:5) = 0.; fout(i,n-4:n) = 0.
END SUBROUTINE rhs_FVb
SUBROUTINE rhs_split(fout, fin, uin)
use prms
IMPLICIT NONE
integer :: i
real, INTENT(IN) :: uin(3,0:n), fin(3,0:n)
real, INTENT(OUT) :: fout(3,0:n)
real :: myeps
!myeps = maxwavespeed
myeps = 0.
fout = 0.
do i = 1,3
!fout(i,1:n-1) = dxi * 0.5 *( fin(i,2:n) - fin(i,0:n-2) + myeps*(uin(i,2:n) -2.*uin(i,1:n-1) + uin(i,0:n-2)) )
fout(i,5:n-6) = dxi * 0.5 *( uin(i,6:n-5) - uin(i,4:n-7) + myeps*(uin(i,6:n-5) -2.*uin(i,5:n-6) + uin(i,4:n-7)) )
end do
fout(i,0:5) = 0.; fout(i,n-4:n) = 0.
END SUBROUTINE rhs_split
SUBROUTINE rhs_diag(fout,Lambdas,uin)
use prms
IMPLICIT NONE
integer :: i,j
real, INTENT(IN) :: Lambdas(3,0:n), uin(3,0:n)
real, INTENT(OUT) :: fout(3,0:n)
real :: myeps
!myeps = maxwavespeed
!myeps = 1.
myeps = 0.
fout = 0.
do i = 1,3
fout(i,1:n-1) = dxi * 0.5 *( lambdas(i,1:n-1)*(uin(i,2:n) - uin(i,0:n-2)) + &
myeps*(uin(i,2:n) -2.*uin(i,1:n-1) + uin(i,0:n-2)) )
end do
fout(:,0:1) = 0.; fout(:,n-1:n) = 0.
END SUBROUTINE rhs_diag
end module rhs