This repository has been archived by the owner on Jul 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
physics_parameters.f90
78 lines (53 loc) · 1.7 KB
/
physics_parameters.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
module physics_parameters
implicit none
public :: init_physics_parameters
public :: finish_physics_parameters
public :: beta, zeff, tite, nine, rhostar, vnew_ref
public :: g_exb, g_exbfac, omprimfac
private
real :: beta, zeff, tite, nine, rhostar, vnew_ref
real :: g_exb, g_exbfac, omprimfac
logical :: initialized = .false.
contains
subroutine init_physics_parameters
implicit none
if (initialized) return
initialized = .true.
call read_parameters
end subroutine init_physics_parameters
subroutine read_parameters
use file_utils, only: input_unit_exist
use mp, only: proc0, broadcast
implicit none
integer :: in_file
logical :: rpexist
namelist /parameters/ beta, zeff, tite, nine, rhostar, vnew_ref &
,g_exb, g_exbfac, omprimfac
if (proc0) then
beta = 0.0
vnew_ref = -1.0 ! various input options will override this value if it is negative
rhostar = -1.0 ! = m_ref * vt_ref / (e * B_ref * a_ref), with refs in SI
zeff = 1.0
tite = 1.0
nine = 1.0
g_exb = 0.0
g_exbfac = 1.0
omprimfac = 1.0
in_file = input_unit_exist("parameters", rpexist)
if (rpexist) read (unit=in_file,nml=parameters)
end if
call broadcast (beta)
call broadcast (vnew_ref)
call broadcast (zeff)
call broadcast (rhostar)
call broadcast (tite)
call broadcast (nine)
call broadcast (g_exb)
call broadcast (g_exbfac)
call broadcast (omprimfac)
end subroutine read_parameters
subroutine finish_physics_parameters
implicit none
initialized = .false.
end subroutine finish_physics_parameters
end module physics_parameters