diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2019-07-09 18:26:01 +0200 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2019-07-09 18:26:01 +0200 |
commit | bc9a2feba4344e74201281e563332688a4d09cc3 (patch) | |
tree | 41df72ce67c6c07e3bff10bcb01a3f010caea8dc | |
parent | 4693ab643732f4ee7bf9deda1412452ea805f449 (diff) | |
download | nrlmsise-00-bc9a2feba4344e74201281e563332688a4d09cc3.tar.gz |
The original FORTRAN version, in line 221,
IF(ALT.GE.ZN3(1)) GOTO 6
and the previous C releases contain a bug for calculations at
32.5 km as the upper boundary for what the model calls lower
stratosphere and troposphere; for this exact altitude,
invalid outputs ("-NAN") may be generated. Fix this issue by
not skipping calculations right at this boundary.
Reported-by: Yoshiaki Ando <y-ando@uec.ac.jp>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
-rw-r--r-- | DOCUMENTATION | 3 | ||||
-rw-r--r-- | nrlmsise-00.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/DOCUMENTATION b/DOCUMENTATION index a931e5b..dfdf5dd 100644 --- a/DOCUMENTATION +++ b/DOCUMENTATION @@ -145,6 +145,9 @@ the in- and output, and the differences between the various functions. 20170830 - fix some compiler warninges (noted by Steven Queen) +20190709 fix output at 32.5 km + (Yoshiaki Ando) + 7. TESTING OUTPUT ================= diff --git a/nrlmsise-00.c b/nrlmsise-00.c index 1abad3b..6b63d29 100644 --- a/nrlmsise-00.c +++ b/nrlmsise-00.c @@ -976,7 +976,7 @@ void gtd7(struct nrlmsise_input *input, struct nrlmsise_flags *flags, struct nrl meso_tgn2[1]=pavgm[8]*pma[9][0]*(1.0+flags->sw[20]*flags->sw[22]*glob7s(pma[9], input, flags))*meso_tn2[3]*meso_tn2[3]/(pow((pma[2][0]*pavgm[2]),2.0)); meso_tn3[0]=meso_tn2[3]; - if (input->alt<zn3[0]) { + if (input->alt<=zn3[0]) { /* LOWER STRATOSPHERE AND TROPOSPHERE (below zn3[0]) * Temperature at nodes and gradients at end nodes * Inverse temperature a linear function of spherical harmonics |