AdaptiveOpticsControl
AtmosphereModel.h
Go to the documentation of this file.
1 #ifndef _AtmosphereModel_H
2 #define _AtmosphereModel_H
3 
4 
5 double AirMixture_N(double lambda, double dens_N2, double dens_O2, double dens_Ar, double dens_H2O, double dens_CO2, double dens_Ne, double dens_He, double dens_CH4, double dens_Kr, double dens_H2, double dens_O3, double dens_N, double dens_O, double dens_H);
6 float AtmosphereModel_stdAtmModel_N(float alt, float lambdaum, int mode);
7 double AtmosphereModel_H2O_Saturation(double T);
8 
9 int AtmosphereModel_save_stdAtmModel(const char *fname);
10 int AtmosphereModel_build_stdAtmModel(const char *fname);
11 int AtmosphereModel_load_stdAtmModel(const char *fname);
12 
13 
14 int AtmosphereModel_Create_from_CONF(const char *CONFFILE, float slambda);
15 
16 
17 double AtmosphereModel_RefractionPath(double lambda, double Zangle, int WritePath);
18 
19 
20 
21 
22 /* -------------------------------------------------------------------- */
23 /* --------- N R L M S I S E - 0 0 M O D E L 2 0 0 1 ---------- */
24 /* -------------------------------------------------------------------- */
25 
26 /* This file is part of the NRLMSISE-00 C source code package - release
27  * 20041227
28  *
29  * The NRLMSISE-00 model was developed by Mike Picone, Alan Hedin, and
30  * Doug Drob. They also wrote a NRLMSISE-00 distribution package in
31  * FORTRAN which is available at
32  * http://uap-www.nrl.navy.mil/models_web/msis/msis_home.htm
33  *
34  * Dominik Brodowski implemented and maintains this C version. You can
35  * reach him at mail@brodo.de. See the file "DOCUMENTATION" for details,
36  * and check http://www.brodo.de/english/pub/nrlmsise/index.html for
37  * updated releases of this package.
38  */
39 
40 
41 
42 /* ------------------------------------------------------------------- */
43 /* ------------------------------- INPUT ----------------------------- */
44 /* ------------------------------------------------------------------- */
45 
47  int switches[24];
48  double sw[24];
49  double swc[24];
50 };
51 /*
52  * Switches: to turn on and off particular variations use these switches.
53  * 0 is off, 1 is on, and 2 is main effects off but cross terms on.
54  *
55  * Standard values are 0 for switch 0 and 1 for switches 1 to 23. The
56  * array "switches" needs to be set accordingly by the calling program.
57  * The arrays sw and swc are set internally.
58  *
59  * switches[i]:
60  * i - explanation
61  * -----------------
62  * 0 - output in meters and kilograms instead of centimeters and grams
63  * 1 - F10.7 effect on mean
64  * 2 - time independent
65  * 3 - symmetrical annual
66  * 4 - symmetrical semiannual
67  * 5 - asymmetrical annual
68  * 6 - asymmetrical semiannual
69  * 7 - diurnal
70  * 8 - semidiurnal
71  * 9 - daily ap [when this is set to -1 (!) the pointer
72  * ap_a in struct nrlmsise_input must
73  * point to a struct ap_array]
74  * 10 - all UT/long effects
75  * 11 - longitudinal
76  * 12 - UT and mixed UT/long
77  * 13 - mixed AP/UT/LONG
78  * 14 - terdiurnal
79  * 15 - departures from diffusive equilibrium
80  * 16 - all TINF var
81  * 17 - all TLB var
82  * 18 - all TN1 var
83  * 19 - all S var
84  * 20 - all TN2 var
85  * 21 - all NLB var
86  * 22 - all TN3 var
87  * 23 - turbo scale height var
88  */
89 
90 struct ap_array {
91  double a[7];
92 };
93 /* Array containing the following magnetic values:
94  * 0 : daily AP
95  * 1 : 3 hr AP index for current time
96  * 2 : 3 hr AP index for 3 hrs before current time
97  * 3 : 3 hr AP index for 6 hrs before current time
98  * 4 : 3 hr AP index for 9 hrs before current time
99  * 5 : Average of eight 3 hr AP indicies from 12 to 33 hrs
100  * prior to current time
101  * 6 : Average of eight 3 hr AP indicies from 36 to 57 hrs
102  * prior to current time
103  */
104 
105 
107  int year; /* year, currently ignored */
108  int doy; /* day of year */
109  double sec; /* seconds in day (UT) */
110  double alt; /* altitude in kilometers */
111  double g_lat; /* geodetic latitude */
112  double g_long; /* geodetic longitude */
113  double lst; /* local apparent solar time (hours), see note below */
114  double f107A; /* 81 day average of F10.7 flux (centered on doy) */
115  double f107; /* daily F10.7 flux for previous day */
116  double ap; /* magnetic index(daily) */
117  struct ap_array *ap_a; /* see above */
118 };
119 /*
120  * NOTES ON INPUT VARIABLES:
121  * UT, Local Time, and Longitude are used independently in the
122  * model and are not of equal importance for every situation.
123  * For the most physically realistic calculation these three
124  * variables should be consistent (lst=sec/3600 + g_long/15).
125  * The Equation of Time departures from the above formula
126  * for apparent local time can be included if available but
127  * are of minor importance.
128  *
129  * f107 and f107A values used to generate the model correspond
130  * to the 10.7 cm radio flux at the actual distance of the Earth
131  * from the Sun rather than the radio flux at 1 AU. The following
132  * site provides both classes of values:
133  * ftp://ftp.ngdc.noaa.gov/STP/SOLAR_DATA/SOLAR_RADIO/FLUX/
134  *
135  * f107, f107A, and ap effects are neither large nor well
136  * established below 80 km and these parameters should be set to
137  * 150., 150., and 4. respectively.
138  */
139 
140 
141 
142 /* ------------------------------------------------------------------- */
143 /* ------------------------------ OUTPUT ----------------------------- */
144 /* ------------------------------------------------------------------- */
145 
147  double d[9]; /* densities */
148  double t[2]; /* temperatures */
149 };
150 /*
151  * OUTPUT VARIABLES:
152  * d[0] - HE NUMBER DENSITY(CM-3)
153  * d[1] - O NUMBER DENSITY(CM-3)
154  * d[2] - N2 NUMBER DENSITY(CM-3)
155  * d[3] - O2 NUMBER DENSITY(CM-3)
156  * d[4] - AR NUMBER DENSITY(CM-3)
157  * d[5] - TOTAL MASS DENSITY(GM/CM3) [includes d[8] in td7d]
158  * d[6] - H NUMBER DENSITY(CM-3)
159  * d[7] - N NUMBER DENSITY(CM-3)
160  * d[8] - Anomalous oxygen NUMBER DENSITY(CM-3)
161  * t[0] - EXOSPHERIC TEMPERATURE
162  * t[1] - TEMPERATURE AT ALT
163  *
164  *
165  * O, H, and N are set to zero below 72.5 km
166  *
167  * t[0], Exospheric temperature, is set to global average for
168  * altitudes below 120 km. The 120 km gradient is left at global
169  * average value for altitudes below 72 km.
170  *
171  * d[5], TOTAL MASS DENSITY, is NOT the same for subroutines GTD7
172  * and GTD7D
173  *
174  * SUBROUTINE GTD7 -- d[5] is the sum of the mass densities of the
175  * species labeled by indices 0-4 and 6-7 in output variable d.
176  * This includes He, O, N2, O2, Ar, H, and N but does NOT include
177  * anomalous oxygen (species index 8).
178  *
179  * SUBROUTINE GTD7D -- d[5] is the "effective total mass density
180  * for drag" and is the sum of the mass densities of all species
181  * in this model, INCLUDING anomalous oxygen.
182  */
183 
184 
185 
186 /* ------------------------------------------------------------------- */
187 /* --------------------------- PROTOTYPES ---------------------------- */
188 /* ------------------------------------------------------------------- */
189 
190 /* GTD7 */
191 /* Neutral Atmosphere Empircial Model from the surface to lower
192  * exosphere.
193  */
194 void gtd7 (struct nrlmsise_input *input, \
195  struct nrlmsise_flags *flags, \
196  struct nrlmsise_output *output);
197 
198 
199 /* GTD7D */
200 /* This subroutine provides Effective Total Mass Density for output
201  * d[5] which includes contributions from "anomalous oxygen" which can
202  * affect satellite drag above 500 km. See the section "output" for
203  * additional details.
204  */
205 void gtd7d(struct nrlmsise_input *input, \
206  struct nrlmsise_flags *flags, \
207  struct nrlmsise_output *output);
208 
209 
210 /* GTS7 */
211 /* Thermospheric portion of NRLMSISE-00
212  */
213 void gts7 (struct nrlmsise_input *input, \
214  struct nrlmsise_flags *flags, \
215  struct nrlmsise_output *output);
216 
217 
218 /* GHP7 */
219 /* To specify outputs at a pressure level (press) rather than at
220  * an altitude.
221  */
222 void ghp7 (struct nrlmsise_input *input, \
223  struct nrlmsise_flags *flags, \
224  struct nrlmsise_output *output, \
225  double press);
226 
227 
228 
229 /* ------------------------------------------------------------------- */
230 /* ----------------------- COMPILATION TWEAKS ------------------------ */
231 /* ------------------------------------------------------------------- */
232 
233 /* "inlining" of functions */
234 /* Some compilers (e.g. gcc) allow the inlining of functions into the
235  * calling routine. This means a lot of overhead can be removed, and
236  * the execution of the program runs much faster. However, the filesize
237  * and thus the loading time is increased.
238  */
239 #ifdef INLINE
240 #define __inline_double inline double
241 #else
242 #define __inline_double double
243 #endif
244 
245 
246 int_fast8_t init_AtmosphereModel();
247 
248 
249 
250 #endif
double a[7]
Definition: AtmosphereModel.h:91
int year
Definition: AtmosphereModel.h:107
void gtd7d(struct nrlmsise_input *input,\struct nrlmsise_flags *flags,\struct nrlmsise_output *output)
int doy
Definition: AtmosphereModel.h:108
double ap
Definition: AtmosphereModel.h:116
double f107A
Definition: AtmosphereModel.h:114
int AtmosphereModel_Create_from_CONF(const char *CONFFILE, float slambda)
read configuration file and create atmosphere model
Definition: AtmosphereModel.c:3872
double g_long
Definition: AtmosphereModel.h:112
double AtmosphereModel_H2O_Saturation(double T)
Definition: AtmosphereModel.c:3332
int AtmosphereModel_load_stdAtmModel(const char *fname)
Definition: AtmosphereModel.c:3816
void ghp7(struct nrlmsise_input *input,\struct nrlmsise_flags *flags,\struct nrlmsise_output *output,\double press)
void gtd7(struct nrlmsise_input *input,\struct nrlmsise_flags *flags,\struct nrlmsise_output *output)
Definition: AtmosphereModel.h:90
double lst
Definition: AtmosphereModel.h:113
struct ap_array * ap_a
Definition: AtmosphereModel.h:117
Definition: AtmosphereModel.h:146
int AtmosphereModel_build_stdAtmModel(const char *fname)
Definition: AtmosphereModel.c:3401
int AtmosphereModel_save_stdAtmModel(const char *fname)
Definition: AtmosphereModel.c:3380
double t[2]
Definition: AtmosphereModel.h:148
double AtmosphereModel_RefractionPath(double lambda, double Zangle, int WritePath)
Definition: AtmosphereModel.c:4224
int switches[24]
Definition: AtmosphereModel.h:47
double g_lat
Definition: AtmosphereModel.h:111
static int input(void)
double sec
Definition: AtmosphereModel.h:109
double sw[24]
Definition: AtmosphereModel.h:48
char CONFFILE[200]
Definition: AtmosphericTurbulence.c:85
float AtmosphereModel_stdAtmModel_N(float alt, float lambdaum, int mode)
Definition: AtmosphereModel.c:3213
void gts7(struct nrlmsise_input *input,\struct nrlmsise_flags *flags,\struct nrlmsise_output *output)
double alt
Definition: AtmosphereModel.h:110
double AirMixture_N(double lambda, double dens_N2, double dens_O2, double dens_Ar, double dens_H2O, double dens_CO2, double dens_Ne, double dens_He, double dens_CH4, double dens_Kr, double dens_H2, double dens_O3, double dens_N, double dens_O, double dens_H)
Definition: AtmosphereModel.c:2600
double d[9]
Definition: AtmosphereModel.h:147
double swc[24]
Definition: AtmosphereModel.h:49
double f107
Definition: AtmosphereModel.h:115
Definition: AtmosphereModel.h:106
int_fast8_t init_AtmosphereModel()
Definition: AtmosphereModel.c:243
Definition: AtmosphereModel.h:46