Line data Source code
1 : ! ***********************************************************************
2 : !
3 : ! Copyright (C) 2010-2019 The MESA Team
4 : !
5 : ! This program is free software: you can redistribute it and/or modify
6 : ! it under the terms of the GNU Lesser General Public License
7 : ! as published by the Free Software Foundation,
8 : ! either version 3 of the License, or (at your option) any later version.
9 : !
10 : ! This program is distributed in the hope that it will be useful,
11 : ! but WITHOUT ANY WARRANTY; without even the implied warranty of
12 : ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 : ! See the GNU Lesser General Public License for more details.
14 : !
15 : ! You should have received a copy of the GNU Lesser General Public License
16 : ! along with this program. If not, see <https://www.gnu.org/licenses/>.
17 : !
18 : ! ***********************************************************************
19 :
20 : module atm_lib
21 :
22 : use const_def, only: dp
23 :
24 : use atm_utils, only: &
25 : atm_init => init, &
26 : atm_shutdown => shutdown
27 :
28 : use atm_T_tau_uniform, only: &
29 : atm_eval_T_tau_uniform => eval_T_tau_uniform, &
30 : atm_build_T_tau_uniform => build_T_tau_uniform
31 : use atm_T_tau_varying, only: &
32 : atm_eval_T_tau_varying => eval_T_tau_varying, &
33 : atm_build_T_tau_varying => build_T_tau_varying
34 : use atm_T_tau_relations, only: &
35 : atm_get_T_tau_base => get_T_tau_base, &
36 : atm_eval_T_tau_dq_dtau => eval_T_tau_dq_dtau
37 :
38 : use atm_table, only: &
39 : atm_eval_table => eval_table, &
40 : atm_get_table_alfa_beta => get_table_alfa_beta, &
41 : atm_get_table_base => get_table_base
42 :
43 : use atm_irradiated, only: &
44 : atm_eval_irradiated => eval_irradiated
45 :
46 : implicit none
47 :
48 : private
49 :
50 : public :: atm_init
51 : public :: atm_shutdown
52 :
53 : public :: atm_eval_T_tau_uniform
54 : public :: atm_build_T_tau_uniform
55 : public :: atm_eval_T_tau_varying
56 : public :: atm_build_T_tau_varying
57 : public :: atm_get_T_tau_base
58 : public :: atm_eval_T_tau_dq_dtau
59 :
60 : public :: atm_eval_table
61 : public :: atm_get_table_alfa_beta
62 : public :: atm_get_table_base
63 :
64 : public :: atm_eval_irradiated
65 :
66 : public :: atm_Teff
67 : public :: atm_L
68 : public :: atm_black_body_T
69 :
70 : contains
71 :
72 : ! utility routines
73 :
74 156 : real(dp) function atm_Teff(L, R)
75 : use const_def, only: pi, boltz_sigma
76 : real(dp), intent(in) :: L, R
77 12 : atm_Teff = atm_black_body_T(L, R)
78 12 : end function atm_Teff
79 :
80 0 : real(dp) function atm_L(Teff, R)
81 : use const_def, only: pi, boltz_sigma
82 : real(dp), intent(in) :: Teff, R
83 0 : atm_L = 4d0*pi*R*R*boltz_sigma*Teff*Teff*Teff*Teff
84 0 : end function atm_L
85 :
86 144 : real(dp) function atm_black_body_T(L, R)
87 : use math_lib, only: pow
88 : use const_def, only: pi, boltz_sigma
89 : real(dp), intent(in) :: L, R
90 144 : atm_black_body_T = pow(L / (4d0*pi*R*R*boltz_sigma), 0.25d0)
91 144 : end function atm_black_body_T
92 :
93 : end module atm_lib
|