From bc9a2feba4344e74201281e563332688a4d09cc3 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Tue, 9 Jul 2019 18:26:01 +0200 Subject: gtd7: fix output at 32.5 km 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 Signed-off-by: Dominik Brodowski --- DOCUMENTATION | 3 +++ nrlmsise-00.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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->altalt<=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 -- cgit v1.2.3