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
/
physics_flags.f90
97 lines (71 loc) · 2.41 KB
/
physics_flags.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
97
module physics_flags
implicit none
public :: init_physics_flags
public :: finish_physics_flags
public :: full_flux_surface
public :: radial_variation
public :: include_parallel_nonlinearity
public :: include_parallel_streaming
public :: include_mirror
public :: prp_shear_enabled
public :: hammett_flow_shear
public :: include_pressure_variation
public :: include_geometric_variation
public :: nonlinear
private
logical :: full_flux_surface
logical :: radial_variation
logical :: include_parallel_nonlinearity
logical :: include_parallel_streaming
logical :: include_pressure_variation
logical :: include_geometric_variation
logical :: include_mirror
logical :: nonlinear
logical :: prp_shear_enabled
logical :: hammett_flow_shear
logical :: initialized = .false.
contains
subroutine init_physics_flags
implicit none
if (initialized) return
initialized = .true.
call read_parameters
end subroutine init_physics_flags
subroutine read_parameters
use file_utils, only: input_unit_exist
use mp, only: proc0, broadcast
implicit none
integer :: in_file
logical :: rpexist
namelist /physics_flags/ full_flux_surface, radial_variation, &
include_parallel_nonlinearity, include_parallel_streaming, &
include_mirror, nonlinear, &
include_pressure_variation, include_geometric_variation
if (proc0) then
full_flux_surface = .false.
radial_variation = .false.
include_pressure_variation = .true.
include_geometric_variation = .true.
include_parallel_nonlinearity = .false.
include_parallel_streaming = .true.
include_mirror = .true.
nonlinear = .false.
in_file = input_unit_exist("physics_flags", rpexist)
if (rpexist) read (unit=in_file,nml=physics_flags)
end if
prp_shear_enabled = .false.
hammett_flow_shear = .true.
call broadcast (full_flux_surface)
call broadcast (radial_variation)
call broadcast (include_pressure_variation)
call broadcast (include_geometric_variation)
call broadcast (include_parallel_nonlinearity)
call broadcast (include_parallel_streaming)
call broadcast (include_mirror)
call broadcast (nonlinear)
end subroutine read_parameters
subroutine finish_physics_flags
implicit none
initialized = .false.
end subroutine finish_physics_flags
end module physics_flags