This repository has been archived by the owner on Jul 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
stella_time.f90
82 lines (51 loc) · 1.66 KB
/
stella_time.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
module stella_time
implicit none
private
real :: code_dt
real :: cfl_dt = -1.
real :: code_dt_min, code_dt_max
! added May 18, 2009 to take care of problems
! in exb_shear calculation after change in time step size
real :: code_dt_old = 0.
real :: code_time = 0.
public :: code_dt, update_time, code_dt_old
public :: code_time
public :: save_dt_min, save_dt, save_dt_cfl, write_dt
public :: init_tstart, init_delt
public :: cfl_dt
public :: code_dt_min, code_dt_max
contains
subroutine init_tstart (tstart)
real, intent (in) :: tstart
code_time = tstart
end subroutine init_tstart
subroutine init_delt (delt)
real, intent (in) :: delt
code_dt = delt
! do not allow code_dt to increase beyond input value
code_dt_max = code_dt
end subroutine init_delt
subroutine update_time
! MAB+CMR, 21/5/09: set code_dt_old to code_dt BEFORE any changes in timestep
code_dt_old = code_dt
code_time = code_time + code_dt
end subroutine update_time
subroutine save_dt_cfl (delt_cfl)
real, intent (in) :: delt_cfl
cfl_dt = delt_cfl
end subroutine save_dt_cfl
subroutine save_dt_min (dt_min)
real, intent (in) :: dt_min
code_dt_min = dt_min
end subroutine save_dt_min
subroutine save_dt(delt)
real, intent (in) :: delt
code_dt = delt
end subroutine save_dt
subroutine write_dt
if (cfl_dt > 0. .and. cfl_dt < 1.e7) &
write (*,*) 'TIME STEP:'
write (*,'(A12, ES10.2E2)') " cfl_dt:"//REPEAT(' ',50),cfl_dt
write (*,'(A12, ES10.2E2)') " code_dt:"//REPEAT(' ',50),code_dt
end subroutine write_dt
end module stella_time