🛰️航天仿真算法库 SpaceAST
0.0.1
载入中...
搜索中...
未找到
nrlmsise-00.hpp
1
/* -------------------------------------------------------------------- */
2
/* --------- N R L M S I S E - 0 0 M O D E L 2 0 0 1 ---------- */
3
/* -------------------------------------------------------------------- */
4
5
/* This file is part of the NRLMSISE-00 C source code package - release
6
* 20041227
7
*
8
* The NRLMSISE-00 model was developed by Mike Picone, Alan Hedin, and
9
* Doug Drob. They also wrote a NRLMSISE-00 distribution package in
10
* FORTRAN which is available at
11
* http://uap-www.nrl.navy.mil/models_web/msis/msis_home.htm
12
*
13
* Dominik Brodowski implemented and maintains this C version. You can
14
* reach him at mail@brodo.de. See the file "DOCUMENTATION" for details,
15
* and check http://www.brodo.de/english/pub/nrlmsise/index.html for
16
* updated releases of this package.
17
*/
18
#pragma once
19
#include "nrlmsise-00.h"
20
21
/* ------------------------------------------------------------------- */
22
/* ------------------------------- INPUT ----------------------------- */
23
/* ------------------------------------------------------------------- */
24
25
// struct nrlmsise_flags {
26
// int switches[24];
27
// double sw[24];
28
// double swc[24];
29
// };
30
/*
31
* Switches: to turn on and off particular variations use these switches.
32
* 0 is off, 1 is on, and 2 is main effects off but cross terms on.
33
*
34
* Standard values are 0 for switch 0 and 1 for switches 1 to 23. The
35
* array "switches" needs to be set accordingly by the calling program.
36
* The arrays sw and swc are set internally.
37
*
38
* switches[i]:
39
* i - explanation
40
* -----------------
41
* 0 - output in meters and kilograms instead of centimeters and grams
42
* 1 - F10.7 effect on mean
43
* 2 - time independent
44
* 3 - symmetrical annual
45
* 4 - symmetrical semiannual
46
* 5 - asymmetrical annual
47
* 6 - asymmetrical semiannual
48
* 7 - diurnal
49
* 8 - semidiurnal
50
* 9 - daily ap [when this is set to -1 (!) the pointer
51
* ap_a in struct nrlmsise_input must
52
* point to a struct ap_array]
53
* 10 - all UT/long effects
54
* 11 - longitudinal
55
* 12 - UT and mixed UT/long
56
* 13 - mixed AP/UT/LONG
57
* 14 - terdiurnal
58
* 15 - departures from diffusive equilibrium
59
* 16 - all TINF var
60
* 17 - all TLB var
61
* 18 - all TN1 var
62
* 19 - all S var
63
* 20 - all TN2 var
64
* 21 - all NLB var
65
* 22 - all TN3 var
66
* 23 - turbo scale height var
67
*/
68
69
// struct ap_array {
70
// double a[7];
71
// };
72
/* Array containing the following magnetic values:
73
* 0 : daily AP
74
* 1 : 3 hr AP index for current time
75
* 2 : 3 hr AP index for 3 hrs before current time
76
* 3 : 3 hr AP index for 6 hrs before current time
77
* 4 : 3 hr AP index for 9 hrs before current time
78
* 5 : Average of eight 3 hr AP indicies from 12 to 33 hrs
79
* prior to current time
80
* 6 : Average of eight 3 hr AP indicies from 36 to 57 hrs
81
* prior to current time
82
*/
83
84
85
// struct nrlmsise_input {
86
// int year; /* year, currently ignored */
87
// int doy; /* day of year */
88
// double sec; /* seconds in day (UT) */
89
// double alt; /* altitude in kilometers */
90
// double g_lat; /* geodetic latitude */
91
// double g_long; /* geodetic longitude */
92
// double lst; /* local apparent solar time (hours), see note below */
93
// double f107A; /* 81 day average of F10.7 flux (centered on doy) */
94
// double f107; /* daily F10.7 flux for previous day */
95
// double ap; /* magnetic index(daily) */
96
// struct ap_array *ap_a; /* see above */
97
// };
98
/*
99
* NOTES ON INPUT VARIABLES:
100
* UT, Local Time, and Longitude are used independently in the
101
* model and are not of equal importance for every situation.
102
* For the most physically realistic calculation these three
103
* variables should be consistent (lst=sec/3600 + g_long/15).
104
* The Equation of Time departures from the above formula
105
* for apparent local time can be included if available but
106
* are of minor importance.
107
*
108
* f107 and f107A values used to generate the model correspond
109
* to the 10.7 cm radio flux at the actual distance of the Earth
110
* from the Sun rather than the radio flux at 1 AU. The following
111
* site provides both classes of values:
112
* ftp://ftp.ngdc.noaa.gov/STP/SOLAR_DATA/SOLAR_RADIO/FLUX/
113
*
114
* f107, f107A, and ap effects are neither large nor well
115
* established below 80 km and these parameters should be set to
116
* 150., 150., and 4. respectively.
117
*/
118
119
120
121
/* ------------------------------------------------------------------- */
122
/* ------------------------------ OUTPUT ----------------------------- */
123
/* ------------------------------------------------------------------- */
124
125
// struct nrlmsise_output {
126
// double d[9]; /* densities */
127
// double t[2]; /* temperatures */
128
// };
129
/*
130
* OUTPUT VARIABLES:
131
* d[0] - HE NUMBER DENSITY(CM-3)
132
* d[1] - O NUMBER DENSITY(CM-3)
133
* d[2] - N2 NUMBER DENSITY(CM-3)
134
* d[3] - O2 NUMBER DENSITY(CM-3)
135
* d[4] - AR NUMBER DENSITY(CM-3)
136
* d[5] - TOTAL MASS DENSITY(GM/CM3) [includes d[8] in td7d]
137
* d[6] - H NUMBER DENSITY(CM-3)
138
* d[7] - N NUMBER DENSITY(CM-3)
139
* d[8] - Anomalous oxygen NUMBER DENSITY(CM-3)
140
* t[0] - EXOSPHERIC TEMPERATURE
141
* t[1] - TEMPERATURE AT ALT
142
*
143
*
144
* O, H, and N are set to zero below 72.5 km
145
*
146
* t[0], Exospheric temperature, is set to global average for
147
* altitudes below 120 km. The 120 km gradient is left at global
148
* average value for altitudes below 72 km.
149
*
150
* d[5], TOTAL MASS DENSITY, is NOT the same for subroutines GTD7
151
* and GTD7D
152
*
153
* SUBROUTINE GTD7 -- d[5] is the sum of the mass densities of the
154
* species labeled by indices 0-4 and 6-7 in output variable d.
155
* This includes He, O, N2, O2, Ar, H, and N but does NOT include
156
* anomalous oxygen (species index 8).
157
*
158
* SUBROUTINE GTD7D -- d[5] is the "effective total mass density
159
* for drag" and is the sum of the mass densities of all species
160
* in this model, INCLUDING anomalous oxygen.
161
*/
162
163
164
165
/* ------------------------------------------------------------------- */
166
/* --------------------------- PROTOTYPES ---------------------------- */
167
/* ------------------------------------------------------------------- */
168
#define NRLMSISE00_CONST const
169
namespace
ast
170
{
171
class
CNRLMSISE00
172
{
173
174
public
:
175
176
/* GTD7 */
177
/* Neutral Atmosphere Empircial Model from the surface to lower
178
* exosphere.
179
*/
180
void
gtd7 (
struct
nrlmsise_input
* input, \
181
struct
nrlmsise_flags
* flags, \
182
struct
nrlmsise_output
* output);
183
184
185
/* GTD7D */
186
/* This subroutine provides Effective Total Mass Density for output
187
* d[5] which includes contributions from "anomalous oxygen" which can
188
* affect satellite drag above 500 km. See the section "output" for
189
* additional details.
190
*/
191
void
gtd7d(
struct
nrlmsise_input
* input, \
192
struct
nrlmsise_flags
* flags, \
193
struct
nrlmsise_output
* output);
194
195
196
/* GTS7 */
197
/* Thermospheric portion of NRLMSISE-00
198
*/
199
void
gts7 (
struct
nrlmsise_input
* input, \
200
struct
nrlmsise_flags
* flags, \
201
struct
nrlmsise_output
* output);
202
203
204
/* GHP7 */
205
/* To specify outputs at a pressure level (press) rather than at
206
* an altitude.
207
*/
208
void
ghp7 (
struct
nrlmsise_input
* input, \
209
struct
nrlmsise_flags
* flags, \
210
struct
nrlmsise_output
* output, \
211
double
press);
212
protected
:
213
/* ------------------------------------------------------------------- */
214
/* ------------------------------- SCALH ----------------------------- */
215
/* ------------------------------------------------------------------- */
216
inline
double
scalh(
double
alt,
double
xm,
double
temp)
217
{
218
double
g
;
219
double
rgas = 831.4;
220
g
= gsurf / (pow((1.0 + alt / re), 2.0));
221
g
= rgas * temp / (
g
* xm);
222
return
g
;
223
}
224
inline
double
zeta(
double
zz,
double
zl)
225
{
226
return
((zz - zl) * (re + zl) / (re + zz));
227
}
228
double
densm (
double
alt,
double
d0,
double
xm,
double
* tz,
int
mn3,
double
* zn3,
double
* tn3,
double
* tgn3,
int
mn2,
double
* zn2,
double
* tn2,
double
* tgn2);
229
double
densu (
double
alt,
double
dlb,
double
tinf,
double
tlb,
double
xm,
double
alpha,
double
* tz,
double
zlb,
double
s2,
int
mn1,
double
* zn1,
double
* tn1,
double
* tgn1)
230
;
231
double
globe7(NRLMSISE00_CONST
double
* p,
struct
nrlmsise_input
* input,
struct
nrlmsise_flags
* flags)
232
;
233
double
glob7s(NRLMSISE00_CONST
double
* p,
struct
nrlmsise_input
* input,
struct
nrlmsise_flags
* flags)
234
;
235
236
protected
:
237
/* PARMB */
238
double
gsurf;
239
double
re;
240
241
/* GTS3C */
242
double
dd;
243
244
/* DMIX */
245
double
dm04, dm16, dm28, dm32, dm40, dm01, dm14;
246
247
/* MESO7 */
248
double
meso_tn1[5];
249
double
meso_tn2[4];
250
double
meso_tn3[5];
251
double
meso_tgn1[2];
252
double
meso_tgn2[2];
253
double
meso_tgn3[2];
254
255
/* LPOLY */
256
double
dfa;
257
double
plg[4][9];
258
double
ctloc, stloc;
259
double
c2tloc, s2tloc;
260
double
s3tloc, c3tloc;
261
double
apdf, apt[4];
262
};
263
264
}
265
266
/* ------------------------------------------------------------------- */
267
/* ----------------------- COMPILATION TWEAKS ------------------------ */
268
/* ------------------------------------------------------------------- */
269
270
/* "inlining" of functions */
271
/* Some compilers (e.g. gcc) allow the inlining of functions into the
272
* calling routine. This means a lot of overhead can be removed, and
273
* the execution of the program runs much faster. However, the filesize
274
* and thus the loading time is increased.
275
*/
276
277
#define INLINE
278
279
#ifdef INLINE
280
#define __inline_double static inline double
281
#else
282
#define __inline_double double
283
#endif
ast::units::g
Unit g
克
定义
Unit.cpp:433
ast::CNRLMSISE00
定义
nrlmsise-00.hpp:172
ast
@fixme 头文件依赖倒置
定义
AngularSeparation.cpp:23
nrlmsise_flags
定义
nrlmsise-00.h:26
nrlmsise_input
定义
nrlmsise-00.h:86
nrlmsise_output
定义
nrlmsise-00.h:126
src
AstWeather
Atmosphere
nrlmsise-00
nrlmsise-00.hpp
制作者
1.12.0