COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
nrlmsise-00.h
Go to the documentation of this file.
1 /********************************************************************
2 * Copyright (C) 2015 by Interstel Technologies, Inc.
3 * and Hawaii Space Flight Laboratory.
4 *
5 * This file is part of the COSMOS/core that is the central
6 * module for COSMOS. For more information on COSMOS go to
7 * <http://cosmos-project.com>
8 *
9 * The COSMOS/core software is licenced under the
10 * GNU Lesser General Public License (LGPL) version 3 licence.
11 *
12 * You should have received a copy of the
13 * GNU Lesser General Public License
14 * If not, go to <http://www.gnu.org/licenses/>
15 *
16 * COSMOS/core is free software: you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public License
18 * as published by the Free Software Foundation, either version 3 of
19 * the License, or (at your option) any later version.
20 *
21 * COSMOS/core is distributed in the hope that it will be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
25 *
26 * Refer to the "licences" folder for further information on the
27 * condititons and terms to use this software.
28 ********************************************************************/
29 
33 #ifndef _NRLMSISE_H
34 #define _NRLMSISE_H 1
35 
36 
37 #include "support/configCosmos.h"
38 
45 
46 /* -------------------------------------------------------------------- */
47 /* --------- N R L M S I S E - 0 0 M O D E L 2 0 0 1 ---------- */
48 /* -------------------------------------------------------------------- */
49 
50 /* This file is part of the NRLMSISE-00 C source code package - release
51  * 20041227
52  *
53  * The NRLMSISE-00 model was developed by Mike Picone, Alan Hedin, and
54  * Doug Drob. They also wrote a NRLMSISE-00 distribution package in
55  * FORTRAN which is available at
56  * http://uap-www.nrl.navy.mil/models_web/msis/msis_home.htm
57  *
58  * Dominik Brodowski implemented and maintains this C version. You can
59  * reach him at mail@brodo.de. See the file "DOCUMENTATION" for details,
60  * and check http://www.brodo.de/english/pub/nrlmsise/index.html for
61  * updated releases of this package.
62  */
63 
64 
67 
68 /* ------------------------------------------------------------------- */
69 /* ------------------------------- INPUT ----------------------------- */
70 /* ------------------------------------------------------------------- */
71 
73  int switches[24];
74  double sw[24];
75  double swc[24];
76 };
77 /*
78  * Switches: to turn on and off particular variations use these switches.
79  * 0 is off, 1 is on, and 2 is main effects off but cross terms on.
80  *
81  * Standard values are 0 for switch 0 and 1 for switches 1 to 23. The
82  * array "switches" needs to be set accordingly by the calling program.
83  * The arrays sw and swc are set internally.
84  *
85  * switches[i]:
86  * i - explanation
87  * -----------------
88  * 0 - output in centimeters instead of meters
89  * 1 - F10.7 effect on mean
90  * 2 - time independent
91  * 3 - symmetrical annual
92  * 4 - symmetrical semiannual
93  * 5 - asymmetrical annual
94  * 6 - asymmetrical semiannual
95  * 7 - diurnal
96  * 8 - semidiurnal
97  * 9 - daily ap [when this is set to -1 (!) the pointer
98  * ap_a in struct nrlmsise_input must
99  * point to a struct ap_array]
100  * 10 - all UT/long effects
101  * 11 - longitudinal
102  * 12 - UT and mixed UT/long
103  * 13 - mixed AP/UT/LONG
104  * 14 - terdiurnal
105  * 15 - departures from diffusive equilibrium
106  * 16 - all TINF var
107  * 17 - all TLB var
108  * 18 - all TN1 var
109  * 19 - all S var
110  * 20 - all TN2 var
111  * 21 - all NLB var
112  * 22 - all TN3 var
113  * 23 - turbo scale height var
114  */
115 
116 struct ap_array {
117  double a[7];
118 };
119 /* Array containing the following magnetic values:
120  * 0 : daily AP
121  * 1 : 3 hr AP index for current time
122  * 2 : 3 hr AP index for 3 hrs before current time
123  * 3 : 3 hr AP index for 6 hrs before current time
124  * 4 : 3 hr AP index for 9 hrs before current time
125  * 5 : Average of eight 3 hr AP indicies from 12 to 33 hrs
126  * prior to current time
127  * 6 : Average of eight 3 hr AP indicies from 36 to 57 hrs
128  * prior to current time
129  */
130 
131 
133  int32_t year; /* year, currently ignored */
134  int32_t doy; /* day of year */
135  double sec; /* seconds in day (UT) */
136  double alt; /* altitude in kilometes */
137  double g_lat; /* geodetic latitude */
138  double g_long; /* geodetic longitude */
139  double lst; /* local apparent solar time (hours), see note below */
140  double f107A; /* 81 day average of F10.7 flux (centered on doy) */
141  double f107; /* daily F10.7 flux for previous day */
142  double ap; /* magnetic index(daily) */
143  struct ap_array *ap_a; /* see above */
144 };
145 /*
146  * NOTES ON INPUT VARIABLES:
147  * UT, Local Time, and Longitude are used independently in the
148  * model and are not of equal importance for every situation.
149  * For the most physically realistic calculation these three
150  * variables should be consistent (lst=sec/3600 + g_long/15).
151  * The Equation of Time departures from the above formula
152  * for apparent local time can be included if available but
153  * are of minor importance.
154  *
155  * f107 and f107A values used to generate the model correspond
156  * to the 10.7 cm radio flux at the actual distance of the Earth
157  * from the Sun rather than the radio flux at 1 AU. The following
158  * site provides both classes of values:
159  * ftp://ftp.ngdc.noaa.gov/STP/SOLAR_DATA/SOLAR_RADIO/FLUX/
160  *
161  * f107, f107A, and ap effects are neither large nor well
162  * established below 80 km and these parameters should be set to
163  * 150., 150., and 4. respectively.
164  */
165 
166 
167 
168 /* ------------------------------------------------------------------- */
169 /* ------------------------------ OUTPUT ----------------------------- */
170 /* ------------------------------------------------------------------- */
171 
173  double d[9]; /* densities */
174  double t[2]; /* temperatures */
175 };
176 /*
177  * OUTPUT VARIABLES:
178  * d[0] - HE NUMBER DENSITY(CM-3)
179  * d[1] - O NUMBER DENSITY(CM-3)
180  * d[2] - N2 NUMBER DENSITY(CM-3)
181  * d[3] - O2 NUMBER DENSITY(CM-3)
182  * d[4] - AR NUMBER DENSITY(CM-3)
183  * d[5] - TOTAL MASS DENSITY(GM/CM3) [includes d[8] in td7d]
184  * d[6] - H NUMBER DENSITY(CM-3)
185  * d[7] - N NUMBER DENSITY(CM-3)
186  * d[8] - Anomalous oxygen NUMBER DENSITY(CM-3)
187  * t[0] - EXOSPHERIC TEMPERATURE
188  * t[1] - TEMPERATURE AT ALT
189  *
190  *
191  * O, H, and N are set to zero below 72.5 km
192  *
193  * t[0], Exospheric temperature, is set to global average for
194  * altitudes below 120 km. The 120 km gradient is left at global
195  * average value for altitudes below 72 km.
196  *
197  * d[5], TOTAL MASS DENSITY, is NOT the same for subroutines GTD7
198  * and GTD7D
199  *
200  * SUBROUTINE GTD7 -- d[5] is the sum of the mass densities of the
201  * species labeled by indices 0-4 and 6-7 in output variable d.
202  * This includes He, O, N2, O2, Ar, H, and N but does NOT include
203  * anomalous oxygen (species index 8).
204  *
205  * SUBROUTINE GTD7D -- d[5] is the "effective total mass density
206  * for drag" and is the sum of the mass densities of all species
207  * in this model, INCLUDING anomalous oxygen.
208  */
209 
211 
214 
215 /* ------------------------------------------------------------------- */
216 /* --------------------------- PROTOTYPES ---------------------------- */
217 /* ------------------------------------------------------------------- */
218 
219 /* GTD7 */
220 /* Neutral Atmosphere Empircial Model from the surface to lower
221  * exosphere.
222  */
223 void gtd7 (struct nrlmsise_input *input, \
224 struct nrlmsise_flags *flags, \
225 struct nrlmsise_output *output);
226 
227 
228 /* GTD7D */
229 /* This subroutine provides Effective Total Mass Density for output
230  * d[5] which includes contributions from "anomalous oxygen" which can
231  * affect satellite drag above 500 km. See the section "output" for
232  * additional details.
233  */
234 void gtd7d(struct nrlmsise_input *input, \
235 struct nrlmsise_flags *flags, \
236 struct nrlmsise_output *output);
237 
238 
239 /* GTS7 */
240 /* Thermospheric portion of NRLMSISE-00
241  */
242 void gts7 (struct nrlmsise_input *input, \
243 struct nrlmsise_flags *flags, \
244 struct nrlmsise_output *output);
245 
246 
247 /* GHP7 */
248 /* To specify outputs at a pressure level (press) rather than at
249  * an altitude.
250  */
251 void ghp7 (struct nrlmsise_input *input, \
252 struct nrlmsise_flags *flags, \
253 struct nrlmsise_output *output, \
254 double press);
255 
257 
258 /* ------------------------------------------------------------------- */
259 /* ----------------------- COMPILATION TWEAKS ------------------------ */
260 /* ------------------------------------------------------------------- */
261 
262 /* "inlining" of functions */
263 /* Some compilers (e.g. gcc) allow the inlining of functions into the
264  * calling routine. This means a lot of overhead can be removed, and
265  * the execution of the program runs much faster. However, the filesize
266  * and thus the loading time is increased.
267  */
268 #ifdef INLINE
269 #define __inline_double inline double
270 #else
271 #define __inline_double double
272 #endif
273 
274 #endif // NRLMSISE
275 
void gtd7d(struct nrlmsise_input *input, struct nrlmsise_flags *flags, struct nrlmsise_output *output)
Definition: nrlmsise-00.cpp:1097
double ap
Definition: nrlmsise-00.h:142
void gts7(struct nrlmsise_input *input, struct nrlmsise_flags *flags, struct nrlmsise_output *output)
Definition: nrlmsise-00.cpp:1192
double f107A
Definition: nrlmsise-00.h:140
int switches[24]
Definition: nrlmsise-00.h:73
double g_long
Definition: nrlmsise-00.h:138
string output
Definition: agent-2-0.cpp:56
void ghp7(struct nrlmsise_input *input, struct nrlmsise_flags *flags, struct nrlmsise_output *output, double press)
Definition: nrlmsise-00.cpp:1110
int32_t doy
Definition: nrlmsise-00.h:134
Definition: nrlmsise-00.h:116
double lst
Definition: nrlmsise-00.h:139
Definition: nrlmsise-00.h:172
Headers and definitions common to all COSMOS.
Definition: eci2kep_test.cpp:33
struct ap_array * ap_a
Definition: nrlmsise-00.h:143
double g_lat
Definition: nrlmsise-00.h:137
double sec
Definition: nrlmsise-00.h:135
double sw[24]
Definition: nrlmsise-00.h:74
double swc[24]
Definition: nrlmsise-00.h:75
void gtd7(struct nrlmsise_input *input, struct nrlmsise_flags *flags, struct nrlmsise_output *output)
Definition: nrlmsise-00.cpp:969
double alt
Definition: nrlmsise-00.h:136
int32_t year
Definition: nrlmsise-00.h:133
double f107
Definition: nrlmsise-00.h:141
Definition: nrlmsise-00.h:132
Definition: nrlmsise-00.h:72