Line data Source code
1 : ! ***********************************************************************
2 : !
3 : ! Copyright (C) 2010 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 colors_def
21 : use const_def, only : strlen, dp
22 : implicit none
23 :
24 : !Public constants for use by clients
25 : !Have we called colors_init yet?
26 : logical :: color_is_initialized=.false.
27 :
28 : integer, parameter :: max_num_color_files=10
29 : integer, parameter :: max_num_bcs_per_file=20
30 : integer :: bc_total_num_colors
31 :
32 : ! color indices are differences in magnitudes in different wavelength bands
33 : ! as a reminder for non-experts like myself, here's how it goes
34 : !
35 : ! msun := apparent magnitude of sun is -26.81
36 : ! Fsun := solar flux at 1AU is 1.36e6 erg/s/cm^2
37 : !
38 : ! "apparent magnitude" m of star with flux F is m = msun - 2.5 log10(F/Fsun)
39 : ! "absolute magnitude" M for star of apparent magnitude m at distance d is M = m - 5 log(d/d0)
40 : ! where the standard distance d0 is 10pc.
41 : ! i.e., absolute magnitude is what the apparent magnitude would be if star were at 10 parsecs.
42 : !
43 : ! thus absolute magnitude of sun is about 4.75
44 : !
45 : ! "bolometric magnitude" = absolute magnitude using flux integrated over all wavelengths
46 : ! can be derived from the current stellar luminosity using the equation
47 : ! log(Lstar/Lsun) = (Mbol_sun - Mbol_star)/2.5 using Mbol_sun = 4.75 (LCB)
48 : !
49 : ! "visual magnitude" = absolute magnitude only using flux in visible wavelengths
50 : ! more precisely, this is magnitude as measured with filter centered at 5500A, 890A width.
51 : !
52 : ! "bolometric correction" = bolometric magnitude minus visual magnitude
53 : ! for the sun, the bolometric correction is about -0.11
54 : ! thus visual magnitude of sun is about 4.86 = Mbol_sun - BC_sun = 4.75 - (-0.11)
55 : !
56 : ! in order of increasing wavelength, the "color" magnitudes are as follows:
57 : !
58 : ! "U" is the ultraviolet magnitude, center at 365nm.
59 : ! "B" is the blue magnitude, center at 440nm.
60 : ! "V" is the visual magnitude, center at 550nm.
61 : ! "R" is the red magnitude, center at 600nm.
62 : ! "I" is the infra-red magnitude, center at 800nm.
63 :
64 : ! in addition, longer wavelength "colors" have been defined as well
65 : ! by order of increasing wavelength, these are J, H, K, L, and M.
66 :
67 : ! "color index" is the difference between 2 color magnitudes
68 : ! for example, B-V is colors_B - colors_V
69 : ! smaller B-V means larger brightness in blue band compared to visual band, means bluer star.
70 :
71 :
72 : ! color magnitude data from Lejeune, Cuisinier, Buser (1998) A&AS 130, 65-75. [LCB]
73 : ! the coverage is approximately Teff from 50,000K to 2000K, log g 5.5 to -1.02, [Fe/H} 1.0 to -5.0
74 : !
75 : ! but not all combination of these are actually represented in the tables.
76 : ! the current implementation limits the given arguments to the actual range in the tables.
77 : ! and it does a simple linear interpolation between tabulated values.
78 :
79 : ! BTW: they use [Fe/H] as a parameter;
80 : ! the evolution code uses log10(Z/Zsun) as an approximation for this.
81 :
82 : ! THE FOLLOWING ARE PRIVATE DEFS -- NOT FOR USE BY CLIENTS
83 :
84 : type :: lgz_list ! sorted in decreasing order of lgz ([M/H])
85 : real(dp) :: lgz ! [Fe_H]
86 : type (lgz_list), pointer :: nxt => null()
87 : real(dp),dimension(max_num_bcs_per_file) :: colors = -1d99
88 : end type lgz_list
89 :
90 : type :: lgt_list ! sorted in decreasing order of lgt
91 : real(dp) :: lgt ! logTeff
92 : integer :: n_colors
93 : type (lgt_list), pointer :: nxt => null()
94 : type (lgg_list), pointer :: glist => null()
95 : end type lgt_list
96 :
97 : type :: lgg_list ! sorted in decreasing order of lgg
98 : real(dp) :: lgg ! log g
99 : type (lgg_list), pointer :: nxt => null()
100 : type (lgz_list), pointer :: zlist => null()
101 : end type lgg_list
102 :
103 : type :: col_list
104 : !Main data store
105 : type(lgt_list), pointer :: thead => null()
106 : CHARACTER(len=strlen),dimension(max_num_bcs_per_file) :: color_names
107 : integer :: n_colors
108 : end type col_list
109 :
110 : integer :: num_thead
111 : type (col_list),dimension(:),pointer :: thead_all => null()
112 :
113 :
114 0 : end module colors_def
115 :
|