-
Notifications
You must be signed in to change notification settings - Fork 0
/
density_temperature_profile.f90
108 lines (88 loc) · 3.28 KB
/
density_temperature_profile.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
98
99
100
101
102
103
104
105
106
107
108
module density_temperature_profile_mod
use constants,only: p_
implicit none
real(p_),parameter :: a=0.6_p_ !meter, minor radius
real(p_),parameter :: r0=a*0.5_p_ !meter, radial center of the simulation box
real(p_),parameter :: te_scale=0.3_p_ !dimension-less
real(p_),parameter :: ne_scale=0.3_p_ !dimension-less
real(p_),parameter :: ti_scale=0.3_p_ !dimension-less
real(p_),parameter :: ni_scale=0.3_p_ !dimension-less
contains
pure function te_func(radcor,ns) result (z) !unit: kev
use constants,only: one
use gk_module,only: te0,kappa_te
use magnetic_field,only : minor_r_radcor !function
real(p_),intent(in) :: radcor
integer,intent(in) :: ns
real(p_) :: r, z
r=minor_r_radcor(radcor)
z=te0(ns)*exp(-kappa_te(ns)*a*te_scale*tanh((r-r0)/(a*te_scale)))
end function te_func
function ti_func(radcor) result (z) !in the unit of kev
use constants,only: one
use fk_module,only: ti0,kappa_ti
use magnetic_field,only : minor_r_radcor !function
real(p_),intent(in) :: radcor
real(p_) :: r, z
r=minor_r_radcor(radcor)
z=ti0*exp(-kappa_ti*a*ti_scale*tanh((r-r0)/(a*ti_scale)))
end function ti_func
pure function ne_func(radcor,ns) result (z) !in the SI unit
use constants,only: one
use gk_module,only: ne0,kappa_ne
use magnetic_field,only : minor_r_radcor !function
real(p_),intent(in) :: radcor
integer,intent(in) :: ns
real(p_) :: r, z
r=minor_r_radcor(radcor)
z=ne0(ns)*exp(-kappa_ne(ns)*a*ne_scale*tanh((r-r0)/(a*ne_scale)))
end function ne_func
function ni_func(radcor) result (z) !in the SI unit
use constants,only: one
use fk_module,only: ni0,kappa_ni
use magnetic_field,only : minor_r_radcor !function
real(p_),intent(in) :: radcor
real(p_) :: r, z
r=minor_r_radcor(radcor)
z=ni0*exp(-kappa_ni*a*ni_scale*tanh((r-r0)/(a*ni_scale)))
end function ni_func
function kappa_te_func(radcor,ns) result (z)
use constants,only: one
use gk_module,only: kappa_te
use magnetic_field,only : minor_r_radcor !function
real(p_),intent(in) :: radcor
integer,intent(in) :: ns
real(p_) :: r, z
r=minor_r_radcor(radcor)
z=kappa_te(ns)*(one-tanh((r-r0)/(a*te_scale))**2)
end function kappa_te_func
function kappa_ti_func(radcor) result (z)
use constants,only: one
use fk_module,only: kappa_ti
use magnetic_field,only : minor_r_radcor !function
real(p_),intent(in) :: radcor
real(p_) :: r, z
r=minor_r_radcor(radcor)
z=kappa_ti*(one-tanh((r-r0)/(a*ti_scale))**2)
end function kappa_ti_func
function kappa_ne_func(radcor,ns) result (z)
use constants,only: one
use gk_module,only : kappa_ne
use magnetic_field, only : minor_r_radcor !function
implicit none
real(p_),intent(in) :: radcor
integer,intent(in) :: ns
real(p_) :: r, z
r=minor_r_radcor(radcor)
z=kappa_ne(ns)*(one-tanh((r-r0)/(a*ne_scale))**2)
end function kappa_ne_func
function kappa_ni_func(radcor) result (z)
use constants,only: one
use fk_module,only : kappa_ni
use magnetic_field, only : minor_r_radcor !function
real(p_),intent(in) :: radcor
real(p_) :: r, z
r=minor_r_radcor(radcor)
z=kappa_ni*(one-tanh((r-r0)/(a*ni_scale))**2)
end function kappa_ni_func
end module density_temperature_profile_mod