-
Notifications
You must be signed in to change notification settings - Fork 0
/
RK3.f90
71 lines (39 loc) · 1.24 KB
/
RK3.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
subroutine RK3
include 'com.txt'
t = 0
count = 0
call set_bc
call TVB_Limiter
do while (t < tend)
call calculate_dt
if (t + dt >= tend) then
dt = tend - t
t = tend
else
t = t + dt
end if
call set_bc
call Lh
uI = uh + dt*du
uh0 = uh
uh = uI
call set_bc
call TVB_Limiter
if (RKorder == 3) then
call set_bc
call Lh
uII = (3d0/4d0)*uh0 + (1d0/4d0)*uI + (1d0/4d0)*dt*du
uh = uII
call set_bc
call TVB_Limiter
call set_bc
call Lh
uh = (1d0/3d0)*uh0 + (2d0/3d0)*uII + (2d0/3d0)*dt*du
call set_bc
call TVB_Limiter
end if
count = count + 1
call calculate_umax
print *,count," ",t," ",umax
end do
end subroutine RK3