Msise00Drag.cpp

Go to the documentation of this file.
00001 #pragma ident "$Id: Msise00Drag.cpp 3140 2012-06-18 15:03:02Z susancummins $"
00002 
00009 //============================================================================
00010 //
00011 //  This file is part of GPSTk, the GPS Toolkit.
00012 //
00013 //  The GPSTk is free software; you can redistribute it and/or modify
00014 //  it under the terms of the GNU Lesser General Public License as published
00015 //  by the Free Software Foundation; either version 2.1 of the License, or
00016 //  any later version.
00017 //
00018 //  The GPSTk is distributed in the hope that it will be useful,
00019 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00020 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021 //  GNU Lesser General Public License for more details.
00022 //
00023 //  You should have received a copy of the GNU Lesser General Public
00024 //  License along with GPSTk; if not, write to the Free Software Foundation,
00025 //  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
00026 //
00027 //  Wei Yan - Chinese Academy of Sciences . 2009, 2010
00028 //
00029 //============================================================================
00030 
00031 
00032 #include "Msise00Drag.hpp"
00033 #include <string>
00034 #include <cmath>
00035 #include <stdio.h>
00036 #include <stdlib.h>
00037 #include "ReferenceFrames.hpp"
00038 #include "IERS.hpp"
00039 #include "ASConstant.hpp"
00040 #include "YDSTime.hpp"
00041 
00042 namespace gpstk
00043 {
00044 
00045    // test the model
00046    void Msise00Drag::test()
00047    {
00048       struct nrlmsise_output output[17];
00049       struct nrlmsise_input input[17];
00050       struct nrlmsise_flags flags;
00051       struct ap_array aph;
00052 
00053       int i;
00054       int j;
00055       
00056       /* input values */
00057       for (i=0;i<7;i++)
00058          aph.a[i]=100;
00059 
00060       flags.switches[0]=0;
00061       for (i=1;i<24;i++)
00062          flags.switches[i]=1;
00063       for (i=0;i<17;i++) {
00064          input[i].doy=172;
00065          input[i].year=0; /* without effect */
00066          input[i].sec=29000;
00067          input[i].alt=400;
00068          input[i].g_lat=60;
00069          input[i].g_long=-70;
00070          input[i].lst=16;
00071          input[i].f107A=150;
00072          input[i].f107=150;
00073          input[i].ap=4;
00074       }
00075       input[1].doy=81;
00076       input[2].sec=75000;
00077       input[2].alt=1000;
00078       input[3].alt=100;
00079       input[10].alt=0;
00080       input[11].alt=10;
00081       input[12].alt=30;
00082       input[13].alt=50;
00083       input[14].alt=70;
00084       input[16].alt=100;
00085       input[4].g_lat=0;
00086       input[5].g_long=0;
00087       input[6].lst=4;
00088       input[7].f107A=70;
00089       input[8].f107=180;
00090       input[9].ap=40;
00091       input[15].ap_a=&aph;
00092       input[16].ap_a=&aph;
00093       /* evaluate 0 to 14 */
00094       for (i=0;i<15;i++)
00095          gtd7(&input[i], &flags, &output[i]);
00096       /* evaluate 15 and 16 */
00097       flags.switches[9]=-1;
00098       for (i=15;i<17;i++)
00099          gtd7(&input[i], &flags, &output[i]);
00100       /* output type 1 */
00101       for (i=0;i<17;i++) {
00102          printf("\n");
00103          for (j=0;j<9;j++)
00104             printf("%E ",output[i].d[j]);
00105          printf("%E ",output[i].t[0]);
00106          printf("%E \n",output[i].t[1]);
00107          /* DL omitted */
00108       }
00109 
00110       /* output type 2 */
00111       for (i=0;i<3;i++) 
00112       {
00113          printf("\n");
00114          printf("\nDAY   ");
00115          for (j=0;j<5;j++)
00116             printf("         %3i",input[i*5+j].doy);
00117          printf("\nUT    ");
00118          for (j=0;j<5;j++)
00119             printf("       %5.0f",input[i*5+j].sec);
00120          printf("\nALT   ");
00121          for (j=0;j<5;j++)
00122             printf("        %4.0f",input[i*5+j].alt);
00123          printf("\nLAT   ");
00124          for (j=0;j<5;j++)
00125             printf("         %3.0f",input[i*5+j].g_lat);
00126          printf("\nLONG  ");
00127          for (j=0;j<5;j++)
00128             printf("         %3.0f",input[i*5+j].g_long);
00129          printf("\nLST   ");
00130          for (j=0;j<5;j++)
00131             printf("       %5.0f",input[i*5+j].lst);
00132          printf("\nF107A ");
00133          for (j=0;j<5;j++)
00134             printf("         %3.0f",input[i*5+j].f107A);
00135          printf("\nF107  ");
00136          for (j=0;j<5;j++)
00137             printf("         %3.0f",input[i*5+j].f107);
00138          printf("\n\n");
00139          printf("\nTINF  ");
00140          for (j=0;j<5;j++)
00141             printf("     %7.2f",output[i*5+j].t[0]);
00142          printf("\nTG    ");
00143          for (j=0;j<5;j++)
00144             printf("     %7.2f",output[i*5+j].t[1]);
00145          printf("\nHE    ");
00146          for (j=0;j<5;j++)
00147             printf("   %1.3e",output[i*5+j].d[0]);
00148          printf("\nO     ");
00149          for (j=0;j<5;j++)
00150             printf("   %1.3e",output[i*5+j].d[1]);
00151          printf("\nN2    ");
00152          for (j=0;j<5;j++)
00153             printf("   %1.3e",output[i*5+j].d[2]);
00154          printf("\nO2    ");
00155          for (j=0;j<5;j++)
00156             printf("   %1.3e",output[i*5+j].d[3]);
00157          printf("\nAR    ");
00158          for (j=0;j<5;j++)
00159             printf("   %1.3e",output[i*5+j].d[4]);
00160          printf("\nH     ");
00161          for (j=0;j<5;j++)
00162             printf("   %1.3e",output[i*5+j].d[6]);
00163          printf("\nN     ");
00164          for (j=0;j<5;j++)
00165             printf("   %1.3e",output[i*5+j].d[7]);
00166          printf("\nANM 0 ");
00167          for (j=0;j<5;j++)
00168             printf("   %1.3e",output[i*5+j].d[8]);
00169          printf("\nRHO   ");
00170          for (j=0;j<5;j++)
00171             printf("   %1.3e",output[i*5+j].d[5]);
00172          printf("\n");
00173       }
00174       printf("\n");
00175       
00176       /*
00177       nrlmsise-test should generate the following output:
00178 
00179       6.665177E+05 1.138806E+08 1.998211E+07 4.022764E+05 3.557465E+03 4.074714E-15 3.475312E+04 4.095913E+06 2.667273E+04 1.250540E+03 1.241416E+03 
00180 
00181       3.407293E+06 1.586333E+08 1.391117E+07 3.262560E+05 1.559618E+03 5.001846E-15 4.854208E+04 4.380967E+06 6.956682E+03 1.166754E+03 1.161710E+03 
00182 
00183       1.123767E+05 6.934130E+04 4.247105E+01 1.322750E-01 2.618848E-05 2.756772E-18 2.016750E+04 5.741256E+03 2.374394E+04 1.239892E+03 1.239891E+03 
00184 
00185       5.411554E+07 1.918893E+11 6.115826E+12 1.225201E+12 6.023212E+10 3.584426E-10 1.059880E+07 2.615737E+05 2.819879E-42 1.027318E+03 2.068878E+02 
00186 
00187       1.851122E+06 1.476555E+08 1.579356E+07 2.633795E+05 1.588781E+03 4.809630E-15 5.816167E+04 5.478984E+06 1.264446E+03 1.212396E+03 1.208135E+03 
00188 
00189       8.673095E+05 1.278862E+08 1.822577E+07 2.922214E+05 2.402962E+03 4.355866E-15 3.686389E+04 3.897276E+06 2.667273E+04 1.220146E+03 1.212712E+03 
00190 
00191       5.776251E+05 6.979139E+07 1.236814E+07 2.492868E+05 1.405739E+03 2.470651E-15 5.291986E+04 1.069814E+06 2.667273E+04 1.116385E+03 1.112999E+03 
00192 
00193       3.740304E+05 4.782720E+07 5.240380E+06 1.759875E+05 5.501649E+02 1.571889E-15 8.896776E+04 1.979741E+06 9.121815E+03 1.031247E+03 1.024848E+03 
00194 
00195       6.748339E+05 1.245315E+08 2.369010E+07 4.911583E+05 4.578781E+03 4.564420E-15 3.244595E+04 5.370833E+06 2.667273E+04 1.306052E+03 1.293374E+03 
00196 
00197       5.528601E+05 1.198041E+08 3.495798E+07 9.339618E+05 1.096255E+04 4.974543E-15 2.686428E+04 4.889974E+06 2.805445E+04 1.361868E+03 1.347389E+03 
00198 
00199       1.375488E+14 0.000000E+00 2.049687E+19 5.498695E+18 2.451733E+17 1.261066E-03 0.000000E+00 0.000000E+00 0.000000E+00 1.027318E+03 2.814648E+02 
00200 
00201       4.427443E+13 0.000000E+00 6.597567E+18 1.769929E+18 7.891680E+16 4.059139E-04 0.000000E+00 0.000000E+00 0.000000E+00 1.027318E+03 2.274180E+02 
00202 
00203       2.127829E+12 0.000000E+00 3.170791E+17 8.506280E+16 3.792741E+15 1.950822E-05 0.000000E+00 0.000000E+00 0.000000E+00 1.027318E+03 2.374389E+02 
00204 
00205       1.412184E+11 0.000000E+00 2.104370E+16 5.645392E+15 2.517142E+14 1.294709E-06 0.000000E+00 0.000000E+00 0.000000E+00 1.027318E+03 2.795551E+02 
00206 
00207       1.254884E+10 0.000000E+00 1.874533E+15 4.923051E+14 2.239685E+13 1.147668E-07 0.000000E+00 0.000000E+00 0.000000E+00 1.027318E+03 2.190732E+02 
00208 
00209       5.196477E+05 1.274494E+08 4.850450E+07 1.720838E+06 2.354487E+04 5.881940E-15 2.500078E+04 6.279210E+06 2.667273E+04 1.426412E+03 1.408608E+03 
00210 
00211       4.260860E+07 1.241342E+11 4.929562E+12 1.048407E+12 4.993465E+10 2.914304E-10 8.831229E+06 2.252516E+05 2.415246E-42 1.027318E+03 1.934071E+02 
00212 
00213 
00214       DAY            172          81         172         172         172
00215       UT           29000       29000       75000       29000       29000
00216       ALT            400         400        1000         100         400
00217       LAT             60          60          60          60           0
00218       LONG           -70         -70         -70         -70         -70
00219       LST             16          16          16          16          16
00220       F107A          150         150         150         150         150
00221       F107           150         150         150         150         150
00222 
00223 
00224       TINF       1250.54     1166.75     1239.89     1027.32     1212.40
00225       TG         1241.42     1161.71     1239.89      206.89     1208.14
00226       HE       6.665e+05   3.407e+06   1.124e+05   5.412e+07   1.851e+06
00227       O        1.139e+08   1.586e+08   6.934e+04   1.919e+11   1.477e+08
00228       N2       1.998e+07   1.391e+07   4.247e+01   6.116e+12   1.579e+07
00229       O2       4.023e+05   3.263e+05   1.323e-01   1.225e+12   2.634e+05
00230       AR       3.557e+03   1.560e+03   2.619e-05   6.023e+10   1.589e+03
00231       H        3.475e+04   4.854e+04   2.017e+04   1.060e+07   5.816e+04
00232       N        4.096e+06   4.381e+06   5.741e+03   2.616e+05   5.479e+06
00233       ANM 0    2.667e+04   6.957e+03   2.374e+04   2.820e-42   1.264e+03
00234       RHO      4.075e-15   5.002e-15   2.757e-18   3.584e-10   4.810e-15
00235 
00236 
00237       DAY            172         172         172         172         172
00238       UT           29000       29000       29000       29000       29000
00239       ALT            400         400         400         400         400
00240       LAT             60          60          60          60          60
00241       LONG             0         -70         -70         -70         -70
00242       LST             16           4          16          16          16
00243       F107A          150         150          70         150         150
00244       F107           150         150         150         180         150
00245 
00246 
00247       TINF       1220.15     1116.39     1031.25     1306.05     1361.87
00248       TG         1212.71     1113.00     1024.85     1293.37     1347.39
00249       HE       8.673e+05   5.776e+05   3.740e+05   6.748e+05   5.529e+05
00250       O        1.279e+08   6.979e+07   4.783e+07   1.245e+08   1.198e+08
00251       N2       1.823e+07   1.237e+07   5.240e+06   2.369e+07   3.496e+07
00252       O2       2.922e+05   2.493e+05   1.760e+05   4.912e+05   9.340e+05
00253       AR       2.403e+03   1.406e+03   5.502e+02   4.579e+03   1.096e+04
00254       H        3.686e+04   5.292e+04   8.897e+04   3.245e+04   2.686e+04
00255       N        3.897e+06   1.070e+06   1.980e+06   5.371e+06   4.890e+06
00256       ANM 0    2.667e+04   2.667e+04   9.122e+03   2.667e+04   2.805e+04
00257       RHO      4.356e-15   2.471e-15   1.572e-15   4.564e-15   4.975e-15
00258 
00259 
00260       DAY            172         172         172         172         172
00261       UT           29000       29000       29000       29000       29000
00262       ALT              0          10          30          50          70
00263       LAT             60          60          60          60          60
00264       LONG           -70         -70         -70         -70         -70
00265       LST             16          16          16          16          16
00266       F107A          150         150         150         150         150
00267       F107           150         150         150         150         150
00268 
00269 
00270       TINF       1027.32     1027.32     1027.32     1027.32     1027.32
00271       TG          281.46      227.42      237.44      279.56      219.07
00272       HE       1.375e+14   4.427e+13   2.128e+12   1.412e+11   1.255e+10
00273       O        0.000e+00   0.000e+00   0.000e+00   0.000e+00   0.000e+00
00274       N2       2.050e+19   6.598e+18   3.171e+17   2.104e+16   1.875e+15
00275       O2       5.499e+18   1.770e+18   8.506e+16   5.645e+15   4.923e+14
00276       AR       2.452e+17   7.892e+16   3.793e+15   2.517e+14   2.240e+13
00277       H        0.000e+00   0.000e+00   0.000e+00   0.000e+00   0.000e+00
00278       N        0.000e+00   0.000e+00   0.000e+00   0.000e+00   0.000e+00
00279       ANM 0    0.000e+00   0.000e+00   0.000e+00   0.000e+00   0.000e+00
00280       RHO      1.261e-03   4.059e-04   1.951e-05   1.295e-06   1.148e-07
00281 
00282 
00283       Note: These values equal those of the official FORTRAN package with
00284       one notable exception: the FORTRAN version reports for "anomalous
00285       oxygen" in test-run 4 exactly 0.000E-00, while my C compiler
00286       generates code which calculates 2.820e-42. When only 16-bit wide
00287       double variables are used, this value reduces to 0.000E-00 as well.
00288 
00289       */
00290    }
00291 
00292    
00293       /* Abstract class requires the subclass to compute the atmospheric density.
00294        * @param utc epoch in UTC
00295        * @param rb  EarthRef object.
00296        * @param r   Position vector.
00297        * @param v   Velocity vector
00298        * @return Atmospheric density in kg/m^3
00299        */
00300    double Msise00Drag::computeDensity(UTCTime utc, 
00301                                       EarthBody& rb, 
00302                                       Vector<double> r, 
00303                                       Vector<double> v)
00304    {
00305       struct nrlmsise_output output;
00306       struct nrlmsise_input input; 
00307       struct nrlmsise_flags flags;
00308       struct ap_array aph;
00309 
00310       //* Get the J2000 to TOD transformation
00311       Matrix<double> N = ReferenceFrames::J2kToTODMatrix(utc);
00312 
00313       //* Transform r from J2000 to TOD
00314       Vector<double> r_tod = N * r;
00315 
00316 
00317       Matrix<double> eci2ecef = ReferenceFrames::J2kToECEFMatrix(utc);
00318 
00319       Vector<double> r_ecef = eci2ecef * r;
00320       
00321       Position geoidPos(r_ecef(0),r_ecef(1),r_ecef(3),Position::Cartesian);
00322       double alt = geoidPos.getAltitude() / 1000.0;    //* [km]
00323 
00324       if (alt > 1000.0) 
00325       {
00326          string msg("Msise00Drag only valid from 0 to 1000 km");
00327          Exception e(msg);
00328          //GPSTK_THROW(e);
00329       }
00330       
00331       //double dist2sun = norm(ReferenceFrames::getJ2kPosition(utc.asTDB(), SolarSystem::Sun))*1000.0;
00332       //double f107_in = this.f107_opt*Math.pow(dist2sun/Constants.AU,2);
00333       //double f107_in = this.f107_opt*Math.pow(Constants.AU/dist2sun,2);
00334       double f107_in = this->f107_opt;
00335             
00336       /* input values */
00337       //for (i=0;i<7;i++)
00338       //   aph.a[i]=13.853964381;//100;
00339 
00340       flags.switches[0]=0;
00341       for (int i=1; i<24; i++)
00342       {
00343          flags.switches[i] = 1;
00344       }
00345 
00346       input.doy = static_cast<YDSTime>(utc).doy;
00347       input.year = 2004;         // without effect 
00348       input.sec = static_cast<YDSTime>(utc).sod;
00349       input.alt= alt;
00350       input.g_lat = geoidPos.getGeodeticLatitude();
00351       input.g_long = geoidPos.getLongitude();
00352       input.lst = input.sec/3600.0 + input.g_long/15.0;
00353       input.f107A =f107_in;
00354       input.f107 = f107_in;
00355       input.ap = this->ap_opt;    //14.924291;//13.853964381; //???
00356 
00357       if(alt > 500.0)
00358       {
00359          gtd7d(&input, &flags, &output);
00360       }else
00361       {
00362          gtd7(&input, &flags, &output);
00363       }
00364 
00365       return output.d[5]*1000.0; //[kg/m^3]  
00366 
00367    }  // End of method 'Msise00Drag::computeDensity()'
00368 
00369 
00370    // LOCAL FUNCTIONS
00371    //-----------------------------------------------------------------------
00372 
00373    void Msise00Drag::tselec(struct nrlmsise_flags *flags) 
00374    {
00375       for (int i=0; i<24; i++) 
00376       {
00377          if (i!=9) 
00378          {
00379             if (flags->switches[i]==1)
00380                flags->sw[i]=1;
00381             else
00382                flags->sw[i]=0;
00383             if (flags->switches[i]>0)
00384                flags->swc[i]=1;
00385             else
00386                flags->swc[i]=0;
00387          } 
00388          else
00389          {
00390             flags->sw[i]=flags->switches[i];
00391             flags->swc[i]=flags->switches[i];
00392          }
00393       }
00394 
00395    }  // 'tselec()'
00396 
00397 
00398    void Msise00Drag::glatf(double lat, double *gv, double *reff) 
00399    {
00400       double dgtr = 1.74533E-2;
00401       double c2;
00402       c2 = std::cos(2.0*dgtr*lat);
00403       *gv = 980.616 * (1.0 - 0.0026373 * c2);
00404       *reff = 2.0 * (*gv) / (3.085462E-6 + 2.27E-9 * c2) * 1.0E-5;
00405 
00406    }  // 'glatf()'
00407 
00408 
00409    double Msise00Drag::ccor(double alt, double r, double h1, double zh) 
00410    {
00411       double e;
00412       double ex;
00413       e = (alt - zh) / h1;
00414       if (e>70)
00415          return std::exp(0.0);
00416       if (e<-70)
00417          return std::exp(r);
00418       ex = std::exp(e);
00419       e = r / (1.0 + ex);
00420       return std::exp(e);
00421 
00422    }  // 'ccor()'
00423 
00424 
00425    double Msise00Drag::ccor2(double alt, double r, double h1, double zh, double h2)
00426    {
00427       double e1, e2;
00428       double ex1, ex2;
00429       double ccor2v;
00430       e1 = (alt - zh) / h1;
00431       e2 = (alt - zh) / h2;
00432       if ((e1 > 70) || (e2 > 70))
00433          return std::exp(0.0);
00434       if ((e1 < -70) && (e2 < -70))
00435          return std::exp(r);
00436       ex1 = std::exp(e1);
00437       ex2 = std::exp(e2);
00438       ccor2v = r / (1.0 + 0.5 * (ex1 + ex2));
00439       return std::exp(ccor2v);
00440 
00441    }  // 'ccor2()'
00442 
00443 
00444    double Msise00Drag::scalh(double alt, double xm, double temp)
00445    {
00446       double g;
00447       double rgas=831.4;
00448       g = gsurf / (std::pow((1.0 + alt/re),2.0));
00449       g = rgas * temp / (g * xm);
00450       return g;
00451 
00452    }  // 'scalh()'
00453 
00454 
00455    double Msise00Drag::dnet (double dd, double dm, double zhm, double xmm, double xm)
00456    {
00457       double a;
00458       double ylog;
00459       a  = zhm / (xmm-xm);
00460       if (!((dm>0) && (dd>0))) 
00461       {
00462          printf("dnet log error %e %e %e\n",dm,dd,xm);
00463          if ((dd==0) && (dm==0))
00464             dd=1;
00465          if (dm==0)
00466             return dd;
00467          if (dd==0)
00468             return dm;
00469       } 
00470       ylog = a * std::log(dm/dd);
00471       if (ylog<-10)
00472          return dd;
00473       if (ylog>10)
00474          return dm;
00475       a = dd*std::pow((1.0 + std::exp(ylog)),(1.0/a));
00476       return a;
00477 
00478    }  // 'dnet()'
00479 
00480 
00481    void Msise00Drag::splini (double *xa, double *ya, double *y2a, int n, double x, double *y)
00482    {
00483       double yi=0;
00484       int klo=0;
00485       int khi=1;
00486       double xx, h, a, b, a2, b2;
00487       while ((x>xa[klo]) && (khi<n))
00488       {
00489          xx=x;
00490          if (khi<(n-1)) 
00491          {
00492             if (x<xa[khi])
00493                xx=x;
00494             else 
00495                xx=xa[khi];
00496          }
00497          h = xa[khi] - xa[klo];
00498          a = (xa[khi] - xx)/h;
00499          b = (xx - xa[klo])/h;
00500          a2 = a*a;
00501          b2 = b*b;
00502          yi += ((1.0 - a2) * ya[klo] / 2.0 + b2 * ya[khi] / 2.0 + ((-(1.0+a2*a2)/4.0 + a2/2.0) * y2a[klo] + (b2*b2/4.0 - b2/2.0) * y2a[khi]) * h * h / 6.0) * h;
00503          klo++;
00504          khi++;
00505       }
00506       *y = yi;
00507 
00508    }  // 'splini()'
00509 
00510 
00511    void Msise00Drag::splint (double *xa, double *ya, double *y2a, int n, double x, double *y)
00512    {
00513       /*      CALCULATE CUBIC SPLINE INTERP VALUE
00514       *       ADAPTED FROM NUMERICAL RECIPES BY PRESS ET AL.
00515       *       XA,YA: ARRAYS OF TABULATED FUNCTION IN ASCENDING ORDER BY X
00516       *       Y2A: ARRAY OF SECOND DERIVATIVES
00517       *       N: SIZE OF ARRAYS XA,YA,Y2A
00518       *       X: ABSCISSA FOR INTERPOLATION
00519       *       Y: OUTPUT VALUE
00520       */
00521       int klo=0;
00522       int khi=n-1;
00523       int k;
00524       double h;
00525       double a, b, yi;
00526       while ((khi-klo)>1) 
00527       {
00528          k=(khi+klo)/2;
00529          if (xa[k]>x)
00530             khi=k;
00531          else
00532             klo=k;
00533       }
00534       h = xa[khi] - xa[klo];
00535       if (h==0.0)
00536          printf("bad XA input to splint");
00537       a = (xa[khi] - x)/h;
00538       b = (x - xa[klo])/h;
00539       yi = a * ya[klo] + b * ya[khi] + ((a*a*a - a) * y2a[klo] + (b*b*b - b) * y2a[khi]) * h * h/6.0;
00540       *y = yi;
00541 
00542    }  // 'splint()'
00543 
00544 
00545    void Msise00Drag::spline (double *x, double *y, int n, double yp1, double ypn, double *y2) 
00546    {
00547       /*       CALCULATE 2ND DERIVATIVES OF CUBIC SPLINE INTERP FUNCTION
00548       *       ADAPTED FROM NUMERICAL RECIPES BY PRESS ET AL
00549       *       X,Y: ARRAYS OF TABULATED FUNCTION IN ASCENDING ORDER BY X
00550       *       N: SIZE OF ARRAYS X,Y
00551       *       YP1,YPN: SPECIFIED DERIVATIVES AT X[0] AND X[N-1]; VALUES
00552       *                >= 1E30 SIGNAL SIGNAL SECOND DERIVATIVE ZERO
00553       *       Y2: OUTPUT ARRAY OF SECOND DERIVATIVES
00554       */
00555       double *u;
00556       double sig, p, qn, un;
00557       int i, k;
00558       u=(double*)malloc(sizeof(double)*n);
00559       if (u==NULL) 
00560       {
00561          printf("Out Of Memory in spline - ERROR");
00562          return;
00563       }
00564       if (yp1>0.99E30) 
00565       {
00566          y2[0]=0;
00567          u[0]=0;
00568       } else 
00569       {
00570          y2[0]=-0.5;
00571          u[0]=(3.0/(x[1]-x[0]))*((y[1]-y[0])/(x[1]-x[0])-yp1);
00572       }
00573       for (i=1;i<(n-1);i++) 
00574       {
00575          sig = (x[i]-x[i-1])/(x[i+1] - x[i-1]);
00576          p = sig * y2[i-1] + 2.0;
00577          y2[i] = (sig - 1.0) / p;
00578          u[i] = (6.0 * ((y[i+1] - y[i])/(x[i+1] - x[i]) -(y[i] - y[i-1]) / (x[i] - x[i-1]))/(x[i+1] - x[i-1]) - sig * u[i-1])/p;
00579       }
00580       if (ypn>0.99E30) 
00581       {
00582          qn = 0;
00583          un = 0;
00584       } 
00585       else 
00586       {
00587          qn = 0.5;
00588          un = (3.0 / (x[n-1] - x[n-2])) * (ypn - (y[n-1] - y[n-2])/(x[n-1] - x[n-2]));
00589       }
00590       y2[n-1] = (un - qn * u[n-2]) / (qn * y2[n-2] + 1.0);
00591       for (k=n-2;k>=0;k--)
00592          y2[k] = y2[k] * y2[k+1] + u[k];
00593 
00594       free(u);
00595 
00596    }  // 'spline()'
00597 
00598 
00599    double Msise00Drag::zeta(double zz, double zl) 
00600    {
00601       return ((zz-zl)*(re+zl)/(re+zz));
00602    }
00603 
00604    double Msise00Drag::densm (double alt, double d0, double xm, double *tz, int mn3, 
00605       double *zn3, double *tn3, double *tgn3, int mn2, double *zn2, double *tn2, double *tgn2) 
00606    {
00607       /*      Calculate Temperature and Density Profiles for lower atmos.  */
00608       double xs[10], ys[10], y2out[10];
00609       double rgas = 831.4;
00610       double z, z1, z2, t1, t2, zg, zgdif;
00611       double yd1, yd2;
00612       double x, y, yi;
00613       double expl, gamm, glb;
00614       double densm_tmp;
00615       int mn;
00616       int k;
00617       densm_tmp=d0;
00618       if (alt>zn2[0]) 
00619       {
00620          if (xm==0.0)
00621             return *tz;
00622          else
00623             return d0;
00624       }
00625 
00626       /* STRATOSPHERE/MESOSPHERE TEMPERATURE */
00627       if (alt>zn2[mn2-1])
00628          z=alt;
00629       else
00630          z=zn2[mn2-1];
00631       mn=mn2;
00632       z1=zn2[0];
00633       z2=zn2[mn-1];
00634       t1=tn2[0];
00635       t2=tn2[mn-1];
00636       zg = zeta(z, z1);
00637       zgdif = zeta(z2, z1);
00638 
00639       /* set up spline nodes */
00640       for (k=0;k<mn;k++) 
00641       {
00642          xs[k]=zeta(zn2[k],z1)/zgdif;
00643          ys[k]=1.0 / tn2[k];
00644       }
00645       yd1=-tgn2[0] / (t1*t1) * zgdif;
00646       yd2=-tgn2[1] / (t2*t2) * zgdif * (std::pow(((re+z2)/(re+z1)),2.0));
00647 
00648       /* calculate spline coefficients */
00649       spline (xs, ys, mn, yd1, yd2, y2out);
00650       x = zg/zgdif;
00651       splint (xs, ys, y2out, mn, x, &y);
00652 
00653       /* temperature at altitude */
00654       *tz = 1.0 / y;
00655       if (xm!=0.0) 
00656       {
00657          /* calaculate stratosphere / mesospehere density */
00658          glb = gsurf / (std::pow((1.0 + z1/re),2.0));
00659          gamm = xm * glb * zgdif / rgas;
00660 
00661          /* Integrate temperature profile */
00662          splini(xs, ys, y2out, mn, x, &yi);
00663          expl=gamm*yi;
00664          if (expl>50.0)
00665             expl=50.0;
00666 
00667          /* Density at altitude */
00668          densm_tmp = densm_tmp * (t1 / *tz) * std::exp(-expl);
00669       }
00670 
00671       if (alt>zn3[0]) 
00672       {
00673          if (xm==0.0)
00674             return *tz;
00675          else
00676             return densm_tmp;
00677       }
00678 
00679       /* troposhere / stratosphere temperature */
00680       z = alt;
00681       mn = mn3;
00682       z1=zn3[0];
00683       z2=zn3[mn-1];
00684       t1=tn3[0];
00685       t2=tn3[mn-1];
00686       zg=zeta(z,z1);
00687       zgdif=zeta(z2,z1);
00688 
00689       /* set up spline nodes */
00690       for (k=0;k<mn;k++) 
00691       {
00692          xs[k] = zeta(zn3[k],z1) / zgdif;
00693          ys[k] = 1.0 / tn3[k];
00694       }
00695       yd1=-tgn3[0] / (t1*t1) * zgdif;
00696       yd2=-tgn3[1] / (t2*t2) * zgdif * (std::pow(((re+z2)/(re+z1)),2.0));
00697 
00698       /* calculate spline coefficients */
00699       spline (xs, ys, mn, yd1, yd2, y2out);
00700       x = zg/zgdif;
00701       splint (xs, ys, y2out, mn, x, &y);
00702 
00703       /* temperature at altitude */
00704       *tz = 1.0 / y;
00705       if (xm!=0.0) 
00706       {
00707          /* calaculate tropospheric / stratosphere density */
00708          glb = gsurf / (std::pow((1.0 + z1/re),2.0));
00709          gamm = xm * glb * zgdif / rgas;
00710 
00711          /* Integrate temperature profile */
00712          splini(xs, ys, y2out, mn, x, &yi);
00713          expl=gamm*yi;
00714          if (expl>50.0)
00715             expl=50.0;
00716 
00717          /* Density at altitude */
00718          densm_tmp = densm_tmp * (t1 / *tz) * std::exp(-expl);
00719       }
00720       if (xm==0.0)
00721          return *tz;
00722       else
00723          return densm_tmp;
00724 
00725    }  // 'densm'
00726 
00727 
00728    double Msise00Drag::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)
00729    {
00730       /*      Calculate Temperature and Density Profiles for MSIS models
00731       *      New lower thermo polynomial
00732       */
00733       double yd2, yd1, x, y;
00734       double rgas=831.4;
00735       double densu_temp=1.0;
00736       double za, z, zg2, tt, ta;
00737       double dta, z1, z2, t1, t2, zg, zgdif;
00738       int mn;
00739       int k;
00740       double glb;
00741       double expl;
00742       double yi;
00743       double densa;
00744       double gamma, gamm;
00745       double xs[5], ys[5], y2out[5];
00746       /* joining altitudes of Bates and spline */
00747       za=zn1[0];
00748       if (alt>za)
00749          z=alt;
00750       else
00751          z=za;
00752 
00753       /* geopotential altitude difference from ZLB */
00754       zg2 = zeta(z, zlb);
00755 
00756       /* Bates temperature */
00757       tt = tinf - (tinf - tlb) * std::exp(-s2*zg2);
00758       ta = tt;
00759       *tz = tt;
00760       densu_temp = *tz;
00761 
00762       if (alt<za) 
00763       {
00764          /* calculate temperature below ZA
00765          * temperature gradient at ZA from Bates profile */
00766          dta = (tinf - ta) * s2 * std::pow(((re+zlb)/(re+za)),2.0);
00767          tgn1[0]=dta;
00768          tn1[0]=ta;
00769          if (alt>zn1[mn1-1])
00770             z=alt;
00771          else
00772             z=zn1[mn1-1];
00773          mn=mn1;
00774          z1=zn1[0];
00775          z2=zn1[mn-1];
00776          t1=tn1[0];
00777          t2=tn1[mn-1];
00778          /* geopotental difference from z1 */
00779          zg = zeta (z, z1);
00780          zgdif = zeta(z2, z1);
00781          /* set up spline nodes */
00782          for (k=0;k<mn;k++) 
00783          {
00784             xs[k] = zeta(zn1[k], z1) / zgdif;
00785             ys[k] = 1.0 / tn1[k];
00786          }
00787          /* end node derivatives */
00788          yd1 = -tgn1[0] / (t1*t1) * zgdif;
00789          yd2 = -tgn1[1] / (t2*t2) * zgdif * std::pow(((re+z2)/(re+z1)),2.0);
00790          /* calculate spline coefficients */
00791          spline (xs, ys, mn, yd1, yd2, y2out);
00792          x = zg / zgdif;
00793          splint (xs, ys, y2out, mn, x, &y);
00794          /* temperature at altitude */
00795          *tz = 1.0 / y;
00796          densu_temp = *tz;
00797       }
00798       if (xm==0)
00799          return densu_temp;
00800 
00801       /* calculate density above za */
00802       glb = gsurf / std::pow((1.0 + zlb/re),2.0);
00803       gamma = xm * glb / (s2 * rgas * tinf);
00804       expl = std::exp(-s2 * gamma * zg2);
00805       if (expl>50.0)
00806          expl=50.0;
00807       if (tt<=0)
00808          expl=50.0;
00809 
00810       /* density at altitude */
00811       densa = dlb * std::pow((tlb/tt),((1.0+alpha+gamma))) * expl;
00812       densu_temp=densa;
00813       if (alt>=za)
00814          return densu_temp;
00815 
00816       /* calculate density below za */
00817       glb = gsurf / std::pow((1.0 + z1/re),2.0);
00818       gamm = xm * glb * zgdif / rgas;
00819 
00820       /* integrate spline temperatures */
00821       splini (xs, ys, y2out, mn, x, &yi);
00822       expl = gamm * yi;
00823       if (expl>50.0)
00824          expl=50.0;
00825       if (*tz<=0)
00826          expl=50.0;
00827 
00828       /* density at altitude */
00829       densu_temp = densu_temp * std::pow ((t1 / *tz),(1.0 + alpha)) * std::exp(-expl);
00830       return densu_temp;
00831 
00832 
00833    }  // 'densu()'
00834 
00835 
00836    double Msise00Drag::g0(double a, double *p) 
00837    {
00838       return (a - 4.0 + (p[25] - 1.0) * (a - 4.0 + (std::exp(-std::sqrt(p[24]*p[24]) * (a - 4.0)) - 1.0) / std::sqrt(p[24]*p[24])));
00839    }
00840 
00841    double Msise00Drag::sumex(double ex) 
00842    {
00843       return (1.0 + (1.0 - std::pow(ex,19.0)) / (1.0 - ex) * std::pow(ex,0.5));
00844    }
00845 
00846    double Msise00Drag::sg0(double ex, double *p, double *ap) 
00847    {
00848       return (g0(ap[1],p) + (g0(ap[2],p)*ex + g0(ap[3],p)*ex*ex + \
00849          g0(ap[4],p)*std::pow(ex,3.0)   + (g0(ap[5],p)*std::pow(ex,4.0) + \
00850          g0(ap[6],p)*std::pow(ex,12.0))*(1.0-std::pow(ex,8.0))/(1.0-ex)))/sumex(ex);
00851    }
00852 
00853    double Msise00Drag::globe7(double *p, struct nrlmsise_input *input, struct nrlmsise_flags *flags) 
00854    {
00855       /*       CALCULATE G(L) FUNCTION 
00856       *       Upper Thermosphere Parameters */
00857       double t[15];
00858       int i,j;
00859       int sw9=1;
00860       double apd;
00861       double xlong;
00862       double tloc;
00863       double c, s, c2, c4, s2;
00864       double sr = 7.2722E-5;
00865       double dgtr = 1.74533E-2;
00866       double dr = 1.72142E-2;
00867       double hr = 0.2618;
00868       double cd32, cd18, cd14, cd39;
00869       double p32, p18, p14, p39;
00870       double df;
00871       double f1, f2;
00872       double tinf;
00873       struct ap_array *ap;
00874 
00875       tloc=input->lst;
00876       for (j=0;j<14;j++)
00877          t[j]=0;
00878       if (flags->sw[9]>0)
00879          sw9=1;
00880       else if (flags->sw[9]<0)
00881          sw9=-1;
00882       xlong = input->g_long;
00883 
00884       /* calculate legendre polynomials */
00885       c = std::sin(input->g_lat * dgtr);
00886       s = std::cos(input->g_lat * dgtr);
00887       c2 = c*c;
00888       c4 = c2*c2;
00889       s2 = s*s;
00890 
00891       plg[0][1] = c;
00892       plg[0][2] = 0.5*(3.0*c2 -1.0);
00893       plg[0][3] = 0.5*(5.0*c*c2-3.0*c);
00894       plg[0][4] = (35.0*c4 - 30.0*c2 + 3.0)/8.0;
00895       plg[0][5] = (63.0*c2*c2*c - 70.0*c2*c + 15.0*c)/8.0;
00896       plg[0][6] = (11.0*c*plg[0][5] - 5.0*plg[0][4])/6.0;
00897       /*      plg[0][7] = (13.0*c*plg[0][6] - 6.0*plg[0][5])/7.0; */
00898       plg[1][1] = s;
00899       plg[1][2] = 3.0*c*s;
00900       plg[1][3] = 1.5*(5.0*c2-1.0)*s;
00901       plg[1][4] = 2.5*(7.0*c2*c-3.0*c)*s;
00902       plg[1][5] = 1.875*(21.0*c4 - 14.0*c2 +1.0)*s;
00903       plg[1][6] = (11.0*c*plg[1][5]-6.0*plg[1][4])/5.0;
00904       /*      plg[1][7] = (13.0*c*plg[1][6]-7.0*plg[1][5])/6.0; */
00905       /*      plg[1][8] = (15.0*c*plg[1][7]-8.0*plg[1][6])/7.0; */
00906       plg[2][2] = 3.0*s2;
00907       plg[2][3] = 15.0*s2*c;
00908       plg[2][4] = 7.5*(7.0*c2 -1.0)*s2;
00909       plg[2][5] = 3.0*c*plg[2][4]-2.0*plg[2][3];
00910       plg[2][6] =(11.0*c*plg[2][5]-7.0*plg[2][4])/4.0;
00911       plg[2][7] =(13.0*c*plg[2][6]-8.0*plg[2][5])/5.0;
00912       plg[3][3] = 15.0*s2*s;
00913       plg[3][4] = 105.0*s2*s*c; 
00914       plg[3][5] =(9.0*c*plg[3][4]-7.*plg[3][3])/2.0;
00915       plg[3][6] =(11.0*c*plg[3][5]-8.*plg[3][4])/3.0;
00916 
00917       if (!(((flags->sw[7]==0)&&(flags->sw[8]==0))&&(flags->sw[14]==0))) 
00918       {
00919          stloc = std::sin(hr*tloc);
00920          ctloc = std::cos(hr*tloc);
00921          s2tloc = std::sin(2.0*hr*tloc);
00922          c2tloc = std::cos(2.0*hr*tloc);
00923          s3tloc = std::sin(3.0*hr*tloc);
00924          c3tloc = std::cos(3.0*hr*tloc);
00925       }
00926 
00927       cd32 = std::cos(dr*(input->doy-p[31]));
00928       cd18 = std::cos(2.0*dr*(input->doy-p[17]));
00929       cd14 = std::cos(dr*(input->doy-p[13]));
00930       cd39 = std::cos(2.0*dr*(input->doy-p[38]));
00931       p32=p[31];
00932       p18=p[17];
00933       p14=p[13];
00934       p39=p[38];
00935 
00936       /* F10.7 EFFECT */
00937       df = input->f107 - input->f107A;
00938       dfa = input->f107A - 150.0;
00939       t[0] =  p[19]*df*(1.0+p[59]*dfa) + p[20]*df*df + p[21]*dfa + p[29]*std::pow(dfa,2.0);
00940       f1 = 1.0 + (p[47]*dfa +p[19]*df+p[20]*df*df)*flags->swc[1];
00941       f2 = 1.0 + (p[49]*dfa+p[19]*df+p[20]*df*df)*flags->swc[1];
00942 
00943       /*  TIME INDEPENDENT */
00944       t[1] = (p[1]*plg[0][2]+ p[2]*plg[0][4]+p[22]*plg[0][6]) + \
00945          (p[14]*plg[0][2])*dfa*flags->swc[1] +p[26]*plg[0][1];
00946 
00947       /*  SYMMETRICAL ANNUAL */
00948       t[2] = p[18]*cd32;
00949 
00950       /*  SYMMETRICAL SEMIANNUAL */
00951       t[3] = (p[15]+p[16]*plg[0][2])*cd18;
00952 
00953       /*  ASYMMETRICAL ANNUAL */
00954       t[4] =  f1*(p[9]*plg[0][1]+p[10]*plg[0][3])*cd14;
00955 
00956       /*  ASYMMETRICAL SEMIANNUAL */
00957       t[5] =    p[37]*plg[0][1]*cd39;
00958 
00959       /* DIURNAL */
00960       if (flags->sw[7]) 
00961       {
00962          double t71, t72;
00963          t71 = (p[11]*plg[1][2])*cd14*flags->swc[5];
00964          t72 = (p[12]*plg[1][2])*cd14*flags->swc[5];
00965          t[6] = f2*((p[3]*plg[1][1] + p[4]*plg[1][3] + p[27]*plg[1][5] + t71) * \
00966             ctloc + (p[6]*plg[1][1] + p[7]*plg[1][3] + p[28]*plg[1][5] \
00967             + t72)*stloc);
00968       }
00969 
00970       /* SEMIDIURNAL */
00971       if (flags->sw[8]) 
00972       {
00973          double t81, t82;
00974          t81 = (p[23]*plg[2][3]+p[35]*plg[2][5])*cd14*flags->swc[5];
00975          t82 = (p[33]*plg[2][3]+p[36]*plg[2][5])*cd14*flags->swc[5];
00976          t[7] = f2*((p[5]*plg[2][2]+ p[41]*plg[2][4] + t81)*c2tloc +(p[8]*plg[2][2] + p[42]*plg[2][4] + t82)*s2tloc);
00977       }
00978 
00979       /* TERDIURNAL */
00980       if (flags->sw[14]) 
00981       {
00982          t[13] = f2 * ((p[39]*plg[3][3]+(p[93]*plg[3][4]+p[46]*plg[3][6])*cd14*flags->swc[5])* s3tloc +(p[40]*plg[3][3]+(p[94]*plg[3][4]+p[48]*plg[3][6])*cd14*flags->swc[5])* c3tloc);
00983       }
00984 
00985       /* magnetic activity based on daily ap */
00986       if (flags->sw[9]==-1) 
00987       {
00988          ap = input->ap_a;
00989          if (p[51]!=0) 
00990          {
00991             double exp1;
00992             exp1 = std::exp(-10800.0*std::sqrt(p[51]*p[51])/(1.0+p[138]*(45.0-std::sqrt(input->g_lat*input->g_lat))));
00993             if (exp1>0.99999)
00994                exp1=0.99999;
00995             if (p[24]<1.0E-4)
00996                p[24]=1.0E-4;
00997             apt[0]=sg0(exp1,p,ap->a);
00998             /* apt[1]=sg2(exp1,p,ap->a);
00999             apt[2]=sg0(exp2,p,ap->a);
01000             apt[3]=sg2(exp2,p,ap->a);
01001             */
01002             if (flags->sw[9]) 
01003             {
01004                t[8] = apt[0]*(p[50]+p[96]*plg[0][2]+p[54]*plg[0][4]+ \
01005                   (p[125]*plg[0][1]+p[126]*plg[0][3]+p[127]*plg[0][5])*cd14*flags->swc[5]+ \
01006                   (p[128]*plg[1][1]+p[129]*plg[1][3]+p[130]*plg[1][5])*flags->swc[7]* \
01007                   std::cos(hr*(tloc-p[131])));
01008             }
01009          }
01010       } 
01011       else 
01012       {
01013          double p44, p45;
01014          apd=input->ap-4.0;
01015          p44=p[43];
01016          p45=p[44];
01017          if (p44<0)
01018             p44 = 1.0E-5;
01019          apdf = apd + (p45-1.0)*(apd + (std::exp(-p44 * apd) - 1.0)/p44);
01020          if (flags->sw[9]) 
01021          {
01022             t[8]=apdf*(p[32]+p[45]*plg[0][2]+p[34]*plg[0][4]+ \
01023                (p[100]*plg[0][1]+p[101]*plg[0][3]+p[102]*plg[0][5])*cd14*flags->swc[5]+
01024                (p[121]*plg[1][1]+p[122]*plg[1][3]+p[123]*plg[1][5])*flags->swc[7]*
01025                std::cos(hr*(tloc-p[124])));
01026          }
01027       }
01028 
01029       if ((flags->sw[10])&&(input->g_long>-1000.0))
01030       {
01031 
01032          /* longitudinal */
01033          if (flags->sw[11]) 
01034          {
01035             t[10] = (1.0 + p[80]*dfa*flags->swc[1])* \
01036                ((p[64]*plg[1][2]+p[65]*plg[1][4]+p[66]*plg[1][6]\
01037                +p[103]*plg[1][1]+p[104]*plg[1][3]+p[105]*plg[1][5]\
01038                +flags->swc[5]*(p[109]*plg[1][1]+p[110]*plg[1][3]+p[111]*plg[1][5])*cd14)* \
01039                std::cos(dgtr*input->g_long) \
01040                +(p[90]*plg[1][2]+p[91]*plg[1][4]+p[92]*plg[1][6]\
01041                +p[106]*plg[1][1]+p[107]*plg[1][3]+p[108]*plg[1][5]\
01042                +flags->swc[5]*(p[112]*plg[1][1]+p[113]*plg[1][3]+p[114]*plg[1][5])*cd14)* \
01043                std::sin(dgtr*input->g_long));
01044          }
01045 
01046          /* ut and mixed ut, longitude */
01047          if (flags->sw[12])
01048          {
01049             t[11]=(1.0+p[95]*plg[0][1])*(1.0+p[81]*dfa*flags->swc[1])*\
01050                (1.0+p[119]*plg[0][1]*flags->swc[5]*cd14)*\
01051                ((p[68]*plg[0][1]+p[69]*plg[0][3]+p[70]*plg[0][5])*\
01052                std::cos(sr*(input->sec-p[71])));
01053             t[11]+=flags->swc[11]*\
01054                (p[76]*plg[2][3]+p[77]*plg[2][5]+p[78]*plg[2][7])*\
01055                std::cos(sr*(input->sec-p[79])+2.0*dgtr*input->g_long)*(1.0+p[137]*dfa*flags->swc[1]);
01056          }
01057 
01058          /* ut, longitude magnetic activity */
01059          if (flags->sw[13])
01060          {
01061             if (flags->sw[9]==-1) 
01062             {
01063                if (p[51])
01064                {
01065                   t[12]=apt[0]*flags->swc[11]*(1.+p[132]*plg[0][1])*\
01066                      ((p[52]*plg[1][2]+p[98]*plg[1][4]+p[67]*plg[1][6])*\
01067                      std::cos(dgtr*(input->g_long-p[97])))\
01068                      +apt[0]*flags->swc[11]*flags->swc[5]*\
01069                      (p[133]*plg[1][1]+p[134]*plg[1][3]+p[135]*plg[1][5])*\
01070                      cd14*std::cos(dgtr*(input->g_long-p[136])) \
01071                      +apt[0]*flags->swc[12]* \
01072                      (p[55]*plg[0][1]+p[56]*plg[0][3]+p[57]*plg[0][5])*\
01073                      std::cos(sr*(input->sec-p[58]));
01074                }
01075             } 
01076             else 
01077             {
01078                t[12] = apdf*flags->swc[11]*(1.0+p[120]*plg[0][1])*\
01079                   ((p[60]*plg[1][2]+p[61]*plg[1][4]+p[62]*plg[1][6])*\
01080                   std::cos(dgtr*(input->g_long-p[63])))\
01081                   +apdf*flags->swc[11]*flags->swc[5]* \
01082                   (p[115]*plg[1][1]+p[116]*plg[1][3]+p[117]*plg[1][5])* \
01083                   cd14*std::cos(dgtr*(input->g_long-p[118])) \
01084                   + apdf*flags->swc[12]* \
01085                   (p[83]*plg[0][1]+p[84]*plg[0][3]+p[85]*plg[0][5])* \
01086                   std::cos(sr*(input->sec-p[75]));
01087             }         
01088          }
01089       }
01090 
01091       /* parms not used: 82, 89, 99, 139-149 */
01092       tinf = p[30];
01093       for (i=0;i<14;i++)
01094          tinf = tinf + std::abs(flags->sw[i+1])*t[i];
01095 
01096       return tinf;
01097 
01098    }  //'globe7()'
01099 
01100 
01101    double Msise00Drag::glob7s(double *p, struct nrlmsise_input *input, struct nrlmsise_flags *flags) 
01102    {
01103       /*    VERSION OF GLOBE FOR LOWER ATMOSPHERE 10/26/99 
01104       */
01105       double pset=2.0;
01106       double t[14];
01107       double tt;
01108       double cd32, cd18, cd14, cd39;
01109       double p32, p18, p14, p39;
01110       int i,j;
01111       double dr=1.72142E-2;
01112       double dgtr=1.74533E-2;
01113       /* confirm parameter set */
01114       if (p[99]==0)
01115          p[99]=pset;
01116       if (p[99]!=pset) 
01117       {
01118          printf("Wrong parameter set for glob7s\n");
01119          return -1;
01120       }
01121       for (j=0;j<14;j++)
01122          t[j]=0.0;
01123       cd32 = std::cos(dr*(input->doy-p[31]));
01124       cd18 = std::cos(2.0*dr*(input->doy-p[17]));
01125       cd14 = std::cos(dr*(input->doy-p[13]));
01126       cd39 = std::cos(2.0*dr*(input->doy-p[38]));
01127       p32=p[31];
01128       p18=p[17];
01129       p14=p[13];
01130       p39=p[38];
01131 
01132       /* F10.7 */
01133       t[0] = p[21]*dfa;
01134 
01135       /* time independent */
01136       t[1]=p[1]*plg[0][2] + p[2]*plg[0][4] + p[22]*plg[0][6] + p[26]*plg[0][1] + p[14]*plg[0][3] + p[59]*plg[0][5];
01137 
01138       /* SYMMETRICAL ANNUAL */
01139       t[2]=(p[18]+p[47]*plg[0][2]+p[29]*plg[0][4])*cd32;
01140 
01141       /* SYMMETRICAL SEMIANNUAL */
01142       t[3]=(p[15]+p[16]*plg[0][2]+p[30]*plg[0][4])*cd18;
01143 
01144       /* ASYMMETRICAL ANNUAL */
01145       t[4]=(p[9]*plg[0][1]+p[10]*plg[0][3]+p[20]*plg[0][5])*cd14;
01146 
01147       /* ASYMMETRICAL SEMIANNUAL */
01148       t[5]=(p[37]*plg[0][1])*cd39;
01149 
01150       /* DIURNAL */
01151       if (flags->sw[7])
01152       {
01153          double t71, t72;
01154          t71 = p[11]*plg[1][2]*cd14*flags->swc[5];
01155          t72 = p[12]*plg[1][2]*cd14*flags->swc[5];
01156          t[6] = ((p[3]*plg[1][1] + p[4]*plg[1][3] + t71) * ctloc + (p[6]*plg[1][1] + p[7]*plg[1][3] + t72) * stloc) ;
01157       }
01158 
01159       /* SEMIDIURNAL */
01160       if (flags->sw[8]) 
01161       {
01162          double t81, t82;
01163          t81 = (p[23]*plg[2][3]+p[35]*plg[2][5])*cd14*flags->swc[5];
01164          t82 = (p[33]*plg[2][3]+p[36]*plg[2][5])*cd14*flags->swc[5];
01165          t[7] = ((p[5]*plg[2][2] + p[41]*plg[2][4] + t81) * c2tloc + (p[8]*plg[2][2] + p[42]*plg[2][4] + t82) * s2tloc);
01166       }
01167 
01168       /* TERDIURNAL */
01169       if (flags->sw[14])
01170       {
01171          t[13] = p[39] * plg[3][3] * s3tloc + p[40] * plg[3][3] * c3tloc;
01172       }
01173 
01174       /* MAGNETIC ACTIVITY */
01175       if (flags->sw[9]) 
01176       {
01177          if (flags->sw[9]==1)
01178             t[8] = apdf * (p[32] + p[45] * plg[0][2] * flags->swc[2]);
01179          if (flags->sw[9]==-1)   
01180             t[8]=(p[50]*apt[0] + p[96]*plg[0][2] * apt[0]*flags->swc[2]);
01181       }
01182 
01183       /* LONGITUDINAL */
01184       if (!((flags->sw[10]==0) || (flags->sw[11]==0) || (input->g_long<=-1000.0)))
01185       {
01186          t[10] = (1.0 + plg[0][1]*(p[80]*flags->swc[5]*std::cos(dr*(input->doy-p[81]))\
01187             +p[85]*flags->swc[6]*std::cos(2.0*dr*(input->doy-p[86])))\
01188             +p[83]*flags->swc[3]*std::cos(dr*(input->doy-p[84]))\
01189             +p[87]*flags->swc[4]*std::cos(2.0*dr*(input->doy-p[88])))\
01190             *((p[64]*plg[1][2]+p[65]*plg[1][4]+p[66]*plg[1][6]\
01191             +p[74]*plg[1][1]+p[75]*plg[1][3]+p[76]*plg[1][5]\
01192             )*std::cos(dgtr*input->g_long)\
01193             +(p[90]*plg[1][2]+p[91]*plg[1][4]+p[92]*plg[1][6]\
01194             +p[77]*plg[1][1]+p[78]*plg[1][3]+p[79]*plg[1][5]\
01195             )*std::sin(dgtr*input->g_long));
01196       }
01197       tt=0;
01198       for (i=0;i<14;i++)
01199          tt+=std::abs(flags->sw[i+1])*t[i];
01200       return tt;
01201 
01202    }  // 'glob7s()'
01203 
01204 
01205    void Msise00Drag::gtd7(struct nrlmsise_input *input, struct nrlmsise_flags *flags, struct nrlmsise_output *output)
01206    {
01207       double xlat;
01208       double xmm;
01209       int mn3 = 5;
01210       double zn3[5]={32.5,20.0,15.0,10.0,0.0};
01211       int mn2 = 4;
01212       double zn2[4]={72.5,55.0,45.0,32.5};
01213       double altt;
01214       double zmix=62.5;
01215       double tmp;
01216       double dm28m;
01217       double tz;
01218       double dmc;
01219       double dmr;
01220       double dz28;
01221       struct nrlmsise_output soutput;
01222       int i;
01223 
01224       tselec(flags);
01225 
01226       /* Latitude variation of gravity (none for sw[2]=0) */
01227       xlat=input->g_lat;
01228       if (flags->sw[2]==0)
01229          xlat=45.0;
01230       glatf(xlat, &gsurf, &re);
01231 
01232       xmm = pdm[2][4];
01233 
01234       /* THERMOSPHERE / MESOSPHERE (above zn2[0]) */
01235       if (input->alt>zn2[0])
01236          altt=input->alt;
01237       else
01238          altt=zn2[0];
01239 
01240       tmp=input->alt;
01241       input->alt=altt;
01242       gts7(input, flags, &soutput);
01243       altt=input->alt;
01244       input->alt=tmp;
01245       if (flags->sw[0])   /* metric adjustment */
01246          dm28m=dm28*1.0E6;
01247       else
01248          dm28m=dm28;
01249       output->t[0]=soutput.t[0];
01250       output->t[1]=soutput.t[1];
01251       if (input->alt>=zn2[0]) 
01252       {
01253          for (i=0;i<9;i++)
01254             output->d[i]=soutput.d[i];
01255          return;
01256       }
01257 
01258       /*       LOWER MESOSPHERE/UPPER STRATOSPHERE (between zn3[0] and zn2[0])
01259       *         Temperature at nodes and gradients at end nodes
01260       *         Inverse temperature a linear function of spherical harmonics
01261       */
01262       meso_tgn2[0]=meso_tgn1[1];
01263       meso_tn2[0]=meso_tn1[4];
01264       meso_tn2[1]=pma[0][0]*pavgm[0]/(1.0-flags->sw[20]*glob7s(pma[0], input, flags));
01265       meso_tn2[2]=pma[1][0]*pavgm[1]/(1.0-flags->sw[20]*glob7s(pma[1], input, flags));
01266       meso_tn2[3]=pma[2][0]*pavgm[2]/(1.0-flags->sw[20]*flags->sw[22]*glob7s(pma[2], input, flags));
01267       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]/(std::pow((pma[2][0]*pavgm[2]),2.0));
01268       meso_tn3[0]=meso_tn2[3];
01269 
01270       if (input->alt<zn3[0])
01271       {
01272          /*       LOWER STRATOSPHERE AND TROPOSPHERE (below zn3[0])
01273          *         Temperature at nodes and gradients at end nodes
01274          *         Inverse temperature a linear function of spherical harmonics
01275          */
01276          meso_tgn3[0]=meso_tgn2[1];
01277          meso_tn3[1]=pma[3][0]*pavgm[3]/(1.0-flags->sw[22]*glob7s(pma[3], input, flags));
01278          meso_tn3[2]=pma[4][0]*pavgm[4]/(1.0-flags->sw[22]*glob7s(pma[4], input, flags));
01279          meso_tn3[3]=pma[5][0]*pavgm[5]/(1.0-flags->sw[22]*glob7s(pma[5], input, flags));
01280          meso_tn3[4]=pma[6][0]*pavgm[6]/(1.0-flags->sw[22]*glob7s(pma[6], input, flags));
01281          meso_tgn3[1]=pma[7][0]*pavgm[7]*(1.0+flags->sw[22]*glob7s(pma[7], input, flags)) *meso_tn3[4]*meso_tn3[4]/(std::pow((pma[6][0]*pavgm[6]),2.0));
01282       }
01283 
01284       /* LINEAR TRANSITION TO FULL MIXING BELOW zn2[0] */
01285 
01286       dmc=0;
01287       if (input->alt>zmix)
01288          dmc = 1.0 - (zn2[0]-input->alt)/(zn2[0] - zmix);
01289       dz28=soutput.d[2];
01290 
01291       /**** N2 density ****/
01292       dmr=soutput.d[2] / dm28m - 1.0;
01293       output->d[2]=densm(input->alt,dm28m,xmm, &tz, mn3, zn3, meso_tn3, meso_tgn3, mn2, zn2, meso_tn2, meso_tgn2);
01294       output->d[2]=output->d[2] * (1.0 + dmr*dmc);
01295 
01296       /**** HE density ****/
01297       dmr = soutput.d[0] / (dz28 * pdm[0][1]) - 1.0;
01298       output->d[0] = output->d[2] * pdm[0][1] * (1.0 + dmr*dmc);
01299 
01300       /**** O density ****/
01301       output->d[1] = 0;
01302       output->d[8] = 0;
01303 
01304       /**** O2 density ****/
01305       dmr = soutput.d[3] / (dz28 * pdm[3][1]) - 1.0;
01306       output->d[3] = output->d[2] * pdm[3][1] * (1.0 + dmr*dmc);
01307 
01308       /**** AR density ***/
01309       dmr = soutput.d[4] / (dz28 * pdm[4][1]) - 1.0;
01310       output->d[4] = output->d[2] * pdm[4][1] * (1.0 + dmr*dmc);
01311 
01312       /**** Hydrogen density ****/
01313       output->d[6] = 0;
01314 
01315       /**** Atomic nitrogen density ****/
01316       output->d[7] = 0;
01317 
01318       /**** Total mass density */
01319       output->d[5] = 1.66E-24 * (4.0 * output->d[0] + 16.0 * output->d[1] + 28.0 * output->d[2] + 32.0 * output->d[3] + 40.0 * output->d[4] + output->d[6] + 14.0 * output->d[7]);
01320 
01321       if (flags->sw[0])
01322          output->d[5]=output->d[5]/1000;
01323 
01324       /**** temperature at altitude ****/
01325       dd = densm(input->alt, 1.0, 0, &tz, mn3, zn3, meso_tn3, meso_tgn3, mn2, zn2, meso_tn2, meso_tgn2);
01326       output->t[1]=tz;
01327 
01328    }  // 'gtd7()'
01329 
01330 
01331    void Msise00Drag::gtd7d(struct nrlmsise_input *input, struct nrlmsise_flags *flags, struct nrlmsise_output *output) 
01332    {
01333       gtd7(input, flags, output);
01334       output->d[5] = 1.66E-24 * (4.0 * output->d[0] + 16.0 * output->d[1] + 28.0 * output->d[2] + 32.0 * output->d[3] + 40.0 * output->d[4] + output->d[6] + 14.0 * output->d[7] + 16.0 * output->d[8]);
01335       if (flags->sw[0])
01336          output->d[5]=output->d[5]/1000;
01337 
01338    }  // 'gtd7d()'
01339 
01340 
01341 
01342    void Msise00Drag::ghp7(struct nrlmsise_input *input, struct nrlmsise_flags *flags, struct nrlmsise_output *output, double press) 
01343    {
01344       double bm = 1.3806E-19;
01345       double rgas = 831.4;
01346       double test = 0.00043;
01347       double ltest = 12;
01348       double pl, p;
01349       double zi;
01350       double z;
01351       double cl, cl2;
01352       double ca, cd;
01353       double xn, xm, diff;
01354       double g, sh;
01355       int l;
01356       pl = std::log10(press);
01357       if (pl >= -5.0) 
01358       {
01359          if (pl>2.5)
01360             zi = 18.06 * (3.00 - pl);
01361          else if ((pl>0.075) && (pl<=2.5))
01362             zi = 14.98 * (3.08 - pl);
01363          else if ((pl>-1) && (pl<=0.075))
01364             zi = 17.80 * (2.72 - pl);
01365          else if ((pl>-2) && (pl<=-1))
01366             zi = 14.28 * (3.64 - pl);
01367          else if ((pl>-4) && (pl<=-2))
01368             zi = 12.72 * (4.32 -pl);
01369          else if (pl<=-4)
01370             zi = 25.3 * (0.11 - pl);
01371          cl = input->g_lat/90.0;
01372          cl2 = cl*cl;
01373          if (input->doy<182)
01374             cd = (1.0 - (double) input->doy) / 91.25;
01375          else 
01376             cd = ((double) input->doy) / 91.25 - 3.0;
01377          ca = 0;
01378          if ((pl > -1.11) && (pl<=-0.23))
01379             ca = 1.0;
01380          if (pl > -0.23)
01381             ca = (2.79 - pl) / (2.79 + 0.23);
01382          if ((pl <= -1.11) && (pl>-3))
01383             ca = (-2.93 - pl)/(-2.93 + 1.11);
01384          z = zi - 4.87 * cl * cd * ca - 1.64 * cl2 * ca + 0.31 * ca * cl;
01385       } else
01386          z = 22.0 * std::pow((pl + 4.0),2.0) + 110.0;
01387 
01388       /* iteration  loop */
01389       l = 0;
01390       do 
01391       {
01392          l++;
01393          input->alt = z;
01394          gtd7(input, flags, output);
01395          z = input->alt;
01396          xn = output->d[0] + output->d[1] + output->d[2] + output->d[3] + output->d[4] + output->d[6] + output->d[7];
01397          p = bm * xn * output->t[1];
01398          if (flags->sw[0])
01399             p = p*1.0E-6;
01400          diff = pl - std::log10(p);
01401          if (std::sqrt(diff*diff)<test)
01402             return;
01403          if (l==ltest) {
01404             printf("ERROR: ghp7 not converging for press %e, diff %e",press,diff);
01405             return;
01406          }
01407          xm = output->d[5] / xn / 1.66E-24;
01408          if (flags->sw[0])
01409             xm = xm * 1.0E3;
01410          g = gsurf / (std::pow((1.0 + z/re),2.0));
01411          sh = rgas * output->t[1] / (xm * g);
01412 
01413          /* new altitude estimate using scale height */
01414          if (l <  6)
01415             z = z - sh * diff * 2.302;
01416          else
01417             z = z - sh * diff;
01418       } while (1==1);
01419 
01420    }  // 'ghp7()'
01421 
01422 
01423    void Msise00Drag::gts7(struct nrlmsise_input *input, struct nrlmsise_flags *flags, struct nrlmsise_output *output) 
01424    {
01425       /*     Thermospheric portion of NRLMSISE-00
01426       *     See GTD7 for more extensive comments
01427       *     alt > 72.5 km! 
01428       */
01429       double za;
01430       int i, j;
01431       double ddum, z;
01432       double zn1[5] = {120.0, 110.0, 100.0, 90.0, 72.5};
01433       double tinf;
01434       int mn1 = 5;
01435       double g0;
01436       double tlb;
01437       double s, z0, t0, tr12;
01438       double db01, db04, db14, db16, db28, db32, db40, db48;
01439       double zh28, zh04, zh16, zh32, zh40, zh01, zh14;
01440       double zhm28, zhm04, zhm16, zhm32, zhm40, zhm01, zhm14;
01441       double xmd;
01442       double b28, b04, b16, b32, b40, b01, b14;
01443       double tz;
01444       double g28, g4, g16, g32, g40, g1, g14;
01445       double zhf, xmm;
01446       double zc04, zc16, zc32, zc40, zc01, zc14;
01447       double hc04, hc16, hc32, hc40, hc01, hc14;
01448       double hcc16, hcc32, hcc01, hcc14;
01449       double zcc16, zcc32, zcc01, zcc14;
01450       double rc16, rc32, rc01, rc14;
01451       double rl;
01452       double g16h, db16h, tho, zsht, zmho, zsho;
01453       double dgtr=1.74533E-2;
01454       double dr=1.72142E-2;
01455       double alpha[9]={-0.38, 0.0, 0.0, 0.0, 0.17, 0.0, -0.38, 0.0, 0.0};
01456       double altl[8]={200.0, 300.0, 160.0, 250.0, 240.0, 450.0, 320.0, 450.0};
01457       double dd;
01458       double hc216, hcc232;
01459       za = pdl[1][15];
01460       zn1[0] = za;
01461       for (j=0;j<9;j++) 
01462          output->d[j]=0;
01463 
01464       /* TINF VARIATIONS NOT IMPORTANT BELOW ZA OR ZN1(1) */
01465       if (input->alt>zn1[0])
01466          tinf = ptm[0]*pt[0] * \
01467          (1.0+flags->sw[16]*globe7(pt,input,flags));
01468       else
01469          tinf = ptm[0]*pt[0];
01470       output->t[0]=tinf;
01471 
01472       /*  GRADIENT VARIATIONS NOT IMPORTANT BELOW ZN1(5) */
01473       if (input->alt>zn1[4])
01474          g0 = ptm[3]*ps[0] * \
01475          (1.0+flags->sw[19]*globe7(ps,input,flags));
01476       else
01477          g0 = ptm[3]*ps[0];
01478       tlb = ptm[1] * (1.0 + flags->sw[17]*globe7(pd[3],input,flags))*pd[3][0];
01479       s = g0 / (tinf - tlb);
01480 
01481       /*      Lower thermosphere temp variations not significant for
01482       *       density above 300 km */
01483       if (input->alt<300.0) 
01484       {
01485          meso_tn1[1]=ptm[6]*ptl[0][0]/(1.0-flags->sw[18]*glob7s(ptl[0], input, flags));
01486          meso_tn1[2]=ptm[2]*ptl[1][0]/(1.0-flags->sw[18]*glob7s(ptl[1], input, flags));
01487          meso_tn1[3]=ptm[7]*ptl[2][0]/(1.0-flags->sw[18]*glob7s(ptl[2], input, flags));
01488          meso_tn1[4]=ptm[4]*ptl[3][0]/(1.0-flags->sw[18]*flags->sw[20]*glob7s(ptl[3], input, flags));
01489          meso_tgn1[1]=ptm[8]*pma[8][0]*(1.0+flags->sw[18]*flags->sw[20]*glob7s(pma[8], input, flags))*meso_tn1[4]*meso_tn1[4]/(std::pow((ptm[4]*ptl[3][0]),2.0));
01490       } else
01491       {
01492          meso_tn1[1]=ptm[6]*ptl[0][0];
01493          meso_tn1[2]=ptm[2]*ptl[1][0];
01494          meso_tn1[3]=ptm[7]*ptl[2][0];
01495          meso_tn1[4]=ptm[4]*ptl[3][0];
01496          meso_tgn1[1]=ptm[8]*pma[8][0]*meso_tn1[4]*meso_tn1[4]/(std::pow((ptm[4]*ptl[3][0]),2.0));
01497       }
01498 
01499       z0 = zn1[3];
01500       t0 = meso_tn1[3];
01501       tr12 = 1.0;
01502 
01503       /* N2 variation factor at Zlb */
01504       g28=flags->sw[21]*globe7(pd[2], input, flags);
01505 
01506       /* VARIATION OF TURBOPAUSE HEIGHT */
01507       zhf=pdl[1][24]*(1.0+flags->sw[5]*pdl[0][24]*std::sin(dgtr*input->g_lat)*std::cos(dr*(input->doy-pt[13])));
01508       output->t[0]=tinf;
01509       xmm = pdm[2][4];
01510       z = input->alt;
01511 
01512 
01513       /**** N2 DENSITY ****/
01514 
01515       /* Diffusive density at Zlb */
01516       db28 = pdm[2][0]*std::exp(g28)*pd[2][0];
01517       /* Diffusive density at Alt */
01518       output->d[2]=densu(z,db28,tinf,tlb,28.0,alpha[2],&output->t[1],ptm[5],s,mn1,zn1,meso_tn1,meso_tgn1);
01519       dd=output->d[2];
01520       /* Turbopause */
01521       zh28=pdm[2][2]*zhf;
01522       zhm28=pdm[2][3]*pdl[1][5]; 
01523       xmd=28.0-xmm;
01524       /* Mixed density at Zlb */
01525       b28=densu(zh28,db28,tinf,tlb,xmd,(alpha[2]-1.0),&tz,ptm[5],s,mn1, zn1,meso_tn1,meso_tgn1);
01526       if ((flags->sw[15])&&(z<=altl[2])) 
01527       {
01528          /*  Mixed density at Alt */
01529          dm28=densu(z,b28,tinf,tlb,xmm,alpha[2],&tz,ptm[5],s,mn1,zn1,meso_tn1,meso_tgn1);
01530          /*  Net density at Alt */
01531          output->d[2]=dnet(output->d[2],dm28,zhm28,xmm,28.0);
01532       }
01533 
01534 
01535       /**** HE DENSITY ****/
01536 
01537       /*   Density variation factor at Zlb */
01538       g4 = flags->sw[21]*globe7(pd[0], input, flags);
01539       /*  Diffusive density at Zlb */
01540       db04 = pdm[0][0]*std::exp(g4)*pd[0][0];
01541       /*  Diffusive density at Alt */
01542       output->d[0]=densu(z,db04,tinf,tlb, 4.,alpha[0],&output->t[1],ptm[5],s,mn1,zn1,meso_tn1,meso_tgn1);
01543       dd=output->d[0];
01544       if ((flags->sw[15]) && (z<altl[0]))
01545       {
01546          /*  Turbopause */
01547          zh04=pdm[0][2];
01548          /*  Mixed density at Zlb */
01549          b04=densu(zh04,db04,tinf,tlb,4.-xmm,alpha[0]-1.,&output->t[1],ptm[5],s,mn1,zn1,meso_tn1,meso_tgn1);
01550          /*  Mixed density at Alt */
01551          dm04=densu(z,b04,tinf,tlb,xmm,0.,&output->t[1],ptm[5],s,mn1,zn1,meso_tn1,meso_tgn1);
01552          zhm04=zhm28;
01553          /*  Net density at Alt */
01554          output->d[0]=dnet(output->d[0],dm04,zhm04,xmm,4.);
01555          /*  Correction to specified mixing ratio at ground */
01556          rl=std::log(b28*pdm[0][1]/b04);
01557          zc04=pdm[0][4]*pdl[1][0];
01558          hc04=pdm[0][5]*pdl[1][1];
01559          /*  Net density corrected at Alt */
01560          output->d[0]=output->d[0]*ccor(z,rl,hc04,zc04);
01561       }
01562 
01563 
01564       /**** O DENSITY ****/
01565 
01566       /*  Density variation factor at Zlb */
01567       g16= flags->sw[21]*globe7(pd[1],input,flags);
01568       /*  Diffusive density at Zlb */
01569       db16 =  pdm[1][0]*std::exp(g16)*pd[1][0];
01570       /*   Diffusive density at Alt */
01571       output->d[1]=densu(z,db16,tinf,tlb, 16.,alpha[1],&output->t[1],ptm[5],s,mn1, zn1,meso_tn1,meso_tgn1);
01572       dd=output->d[1];
01573       if ((flags->sw[15]) && (z<=altl[1])) 
01574       {
01575          /*   Turbopause */
01576          zh16=pdm[1][2];
01577          /*  Mixed density at Zlb */
01578          b16=densu(zh16,db16,tinf,tlb,16.0-xmm,(alpha[1]-1.0), &output->t[1],ptm[5],s,mn1,zn1,meso_tn1,meso_tgn1);
01579          /*  Mixed density at Alt */
01580          dm16=densu(z,b16,tinf,tlb,xmm,0.,&output->t[1],ptm[5],s,mn1,zn1,meso_tn1,meso_tgn1);
01581          zhm16=zhm28;
01582          /*  Net density at Alt */
01583          output->d[1]=dnet(output->d[1],dm16,zhm16,xmm,16.);
01584          rl=pdm[1][1]*pdl[1][16]*(1.0+flags->sw[1]*pdl[0][23]*(input->f107A-150.0));
01585          hc16=pdm[1][5]*pdl[1][3];
01586          zc16=pdm[1][4]*pdl[1][2];
01587          hc216=pdm[1][5]*pdl[1][4];
01588          output->d[1]=output->d[1]*ccor2(z,rl,hc16,zc16,hc216);
01589          /*   Chemistry correction */
01590          hcc16=pdm[1][7]*pdl[1][13];
01591          zcc16=pdm[1][6]*pdl[1][12];
01592          rc16=pdm[1][3]*pdl[1][14];
01593          /*  Net density corrected at Alt */
01594          output->d[1]=output->d[1]*ccor(z,rc16,hcc16,zcc16);
01595       }
01596 
01597 
01598       /**** O2 DENSITY ****/
01599 
01600       /*   Density variation factor at Zlb */
01601       g32= flags->sw[21]*globe7(pd[4], input, flags);
01602       /*  Diffusive density at Zlb */
01603       db32 = pdm[3][0]*std::exp(g32)*pd[4][0];
01604       /*   Diffusive density at Alt */
01605       output->d[3]=densu(z,db32,tinf,tlb, 32.,alpha[3],&output->t[1],ptm[5],s,mn1, zn1,meso_tn1,meso_tgn1);
01606       dd=output->d[3];
01607       if (flags->sw[15]) 
01608       {
01609          if (z<=altl[3]) 
01610          {
01611             /*   Turbopause */
01612             zh32=pdm[3][2];
01613             /*  Mixed density at Zlb */
01614             b32=densu(zh32,db32,tinf,tlb,32.-xmm,alpha[3]-1., &output->t[1],ptm[5],s,mn1,zn1,meso_tn1,meso_tgn1);
01615             /*  Mixed density at Alt */
01616             dm32=densu(z,b32,tinf,tlb,xmm,0.,&output->t[1],ptm[5],s,mn1,zn1,meso_tn1,meso_tgn1);
01617             zhm32=zhm28;
01618             /*  Net density at Alt */
01619             output->d[3]=dnet(output->d[3],dm32,zhm32,xmm,32.);
01620             /*   Correction to specified mixing ratio at ground */
01621             rl=std::log(b28*pdm[3][1]/b32);
01622             hc32=pdm[3][5]*pdl[1][7];
01623             zc32=pdm[3][4]*pdl[1][6];
01624             output->d[3]=output->d[3]*ccor(z,rl,hc32,zc32);
01625          }
01626          /*  Correction for general departure from diffusive equilibrium above Zlb */
01627          hcc32=pdm[3][7]*pdl[1][22];
01628          hcc232=pdm[3][7]*pdl[0][22];
01629          zcc32=pdm[3][6]*pdl[1][21];
01630          rc32=pdm[3][3]*pdl[1][23]*(1.+flags->sw[1]*pdl[0][23]*(input->f107A-150.));
01631          /*  Net density corrected at Alt */
01632          output->d[3]=output->d[3]*ccor2(z,rc32,hcc32,zcc32,hcc232);
01633       }
01634 
01635 
01636       /**** AR DENSITY ****/
01637 
01638       /*   Density variation factor at Zlb */
01639       g40= flags->sw[20]*globe7(pd[5],input,flags);
01640       /*  Diffusive density at Zlb */
01641       db40 = pdm[4][0]*std::exp(g40)*pd[5][0];
01642       /*   Diffusive density at Alt */
01643       output->d[4]=densu(z,db40,tinf,tlb, 40.,alpha[4],&output->t[1],ptm[5],s,mn1,zn1,meso_tn1,meso_tgn1);
01644       dd=output->d[4];
01645       if ((flags->sw[15]) && (z<=altl[4]))
01646       {
01647          /*   Turbopause */
01648          zh40=pdm[4][2];
01649          /*  Mixed density at Zlb */
01650          b40=densu(zh40,db40,tinf,tlb,40.-xmm,alpha[4]-1.,&output->t[1],ptm[5],s,mn1,zn1,meso_tn1,meso_tgn1);
01651          /*  Mixed density at Alt */
01652          dm40=densu(z,b40,tinf,tlb,xmm,0.,&output->t[1],ptm[5],s,mn1,zn1,meso_tn1,meso_tgn1);
01653          zhm40=zhm28;
01654          /*  Net density at Alt */
01655          output->d[4]=dnet(output->d[4],dm40,zhm40,xmm,40.);
01656          /*   Correction to specified mixing ratio at ground */
01657          rl=std::log(b28*pdm[4][1]/b40);
01658          hc40=pdm[4][5]*pdl[1][9];
01659          zc40=pdm[4][4]*pdl[1][8];
01660          /*  Net density corrected at Alt */
01661          output->d[4]=output->d[4]*ccor(z,rl,hc40,zc40);
01662       }
01663 
01664 
01665       /**** HYDROGEN DENSITY ****/
01666 
01667       /*   Density variation factor at Zlb */
01668       g1 = flags->sw[21]*globe7(pd[6], input, flags);
01669       /*  Diffusive density at Zlb */
01670       db01 = pdm[5][0]*std::exp(g1)*pd[6][0];
01671       /*   Diffusive density at Alt */
01672       output->d[6]=densu(z,db01,tinf,tlb,1.,alpha[6],&output->t[1],ptm[5],s,mn1,zn1,meso_tn1,meso_tgn1);
01673       dd=output->d[6];
01674       if ((flags->sw[15]) && (z<=altl[6])) 
01675       {
01676          /*   Turbopause */
01677          zh01=pdm[5][2];
01678          /*  Mixed density at Zlb */
01679          b01=densu(zh01,db01,tinf,tlb,1.-xmm,alpha[6]-1., &output->t[1],ptm[5],s,mn1,zn1,meso_tn1,meso_tgn1);
01680          /*  Mixed density at Alt */
01681          dm01=densu(z,b01,tinf,tlb,xmm,0.,&output->t[1],ptm[5],s,mn1,zn1,meso_tn1,meso_tgn1);
01682          zhm01=zhm28;
01683          /*  Net density at Alt */
01684          output->d[6]=dnet(output->d[6],dm01,zhm01,xmm,1.);
01685          /*   Correction to specified mixing ratio at ground */
01686          rl=std::log(b28*pdm[5][1]*std::sqrt(pdl[1][17]*pdl[1][17])/b01);
01687          hc01=pdm[5][5]*pdl[1][11];
01688          zc01=pdm[5][4]*pdl[1][10];
01689          output->d[6]=output->d[6]*ccor(z,rl,hc01,zc01);
01690          /*   Chemistry correction */
01691          hcc01=pdm[5][7]*pdl[1][19];
01692          zcc01=pdm[5][6]*pdl[1][18];
01693          rc01=pdm[5][3]*pdl[1][20];
01694          /*  Net density corrected at Alt */
01695          output->d[6]=output->d[6]*ccor(z,rc01,hcc01,zcc01);
01696       }
01697 
01698 
01699       /**** ATOMIC NITROGEN DENSITY ****/
01700 
01701       /*   Density variation factor at Zlb */
01702       g14 = flags->sw[21]*globe7(pd[7],input,flags);
01703       /*  Diffusive density at Zlb */
01704       db14 = pdm[6][0]*std::exp(g14)*pd[7][0];
01705       /*   Diffusive density at Alt */
01706       output->d[7]=densu(z,db14,tinf,tlb,14.,alpha[7],&output->t[1],ptm[5],s,mn1,zn1,meso_tn1,meso_tgn1);
01707       dd=output->d[7];
01708       if ((flags->sw[15]) && (z<=altl[7])) 
01709       {
01710          /*   Turbopause */
01711          zh14=pdm[6][2];
01712          /*  Mixed density at Zlb */
01713          b14=densu(zh14,db14,tinf,tlb,14.-xmm,alpha[7]-1., &output->t[1],ptm[5],s,mn1,zn1,meso_tn1,meso_tgn1);
01714          /*  Mixed density at Alt */
01715          dm14=densu(z,b14,tinf,tlb,xmm,0.,&output->t[1],ptm[5],s,mn1,zn1,meso_tn1,meso_tgn1);
01716          zhm14=zhm28;
01717          /*  Net density at Alt */
01718          output->d[7]=dnet(output->d[7],dm14,zhm14,xmm,14.);
01719          /*   Correction to specified mixing ratio at ground */
01720          rl=std::log(b28*pdm[6][1]*std::sqrt(pdl[0][2]*pdl[0][2])/b14);
01721          hc14=pdm[6][5]*pdl[0][1];
01722          zc14=pdm[6][4]*pdl[0][0];
01723          output->d[7]=output->d[7]*ccor(z,rl,hc14,zc14);
01724          /*   Chemistry correction */
01725          hcc14=pdm[6][7]*pdl[0][4];
01726          zcc14=pdm[6][6]*pdl[0][3];
01727          rc14=pdm[6][3]*pdl[0][5];
01728          /*  Net density corrected at Alt */
01729          output->d[7]=output->d[7]*ccor(z,rc14,hcc14,zcc14);
01730       }
01731 
01732 
01733       /**** Anomalous OXYGEN DENSITY ****/
01734 
01735       g16h = flags->sw[21]*globe7(pd[8],input,flags);
01736       db16h = pdm[7][0]*std::exp(g16h)*pd[8][0];
01737       tho = pdm[7][9]*pdl[0][6];
01738       dd=densu(z,db16h,tho,tho,16.,alpha[8],&output->t[1],ptm[5],s,mn1, zn1,meso_tn1,meso_tgn1);
01739       zsht=pdm[7][5];
01740       zmho=pdm[7][4];
01741       zsho=scalh(zmho,16.0,tho);
01742       output->d[8]=dd*std::exp(-zsht/zsho*(std::exp(-(z-zmho)/zsht)-1.));
01743 
01744 
01745       /* total mass density */
01746       output->d[5] = 1.66E-24*(4.0*output->d[0]+16.0*output->d[1]+28.0*output->d[2]+32.0*output->d[3]+40.0*output->d[4]+ output->d[6]+14.0*output->d[7]);
01747       db48=1.66E-24*(4.0*db04+16.0*db16+28.0*db28+32.0*db32+40.0*db40+db01+14.0*db14);
01748 
01749 
01750 
01751       /* temperature */
01752       z = std::sqrt(input->alt*input->alt);
01753       ddum = densu(z,1.0, tinf, tlb, 0.0, 0.0, &output->t[1], ptm[5], s, mn1, zn1, meso_tn1, meso_tgn1);
01754       if (flags->sw[0]) 
01755       {
01756          for(i=0;i<9;i++)
01757             output->d[i]=output->d[i]*1.0E6;
01758          output->d[5]=output->d[5]/1000;
01759       }
01760 
01761    }  //'gts7'
01762 
01763 
01764 
01765 
01767 
01768    /* -------------------------------------------------------------------- */
01769    /* ---------  N R L M S I S E - 0 0    M O D E L    2 0 0 1  ---------- */
01770    /* -------------------------------------------------------------------- */
01771 
01772    /* This file is part of the NRLMSISE-00  C source code package - release
01773     * 20041227
01774     *
01775     * The NRLMSISE-00 model was developed by Mike Picone, Alan Hedin, and
01776     * Doug Drob. They also wrote a NRLMSISE-00 distribution package in 
01777     * FORTRAN which is available at
01778     * http://uap-www.nrl.navy.mil/models_web/msis/msis_home.htm
01779     *
01780     * Dominik Brodowski implemented and maintains this C version. You can
01781     * reach him at mail@brodo.de. See the file "DOCUMENTATION" for details,
01782     * and check http://www.brodo.de/english/pub/nrlmsise/index.html for
01783     * updated releases of this package.
01784     */
01785 
01786    /* TEMPERATURE */
01787    double Msise00Drag::pt[150] = {
01788        9.86573E-01, 1.62228E-02, 1.55270E-02,-1.04323E-01,-3.75801E-03,
01789       -1.18538E-03,-1.24043E-01, 4.56820E-03, 8.76018E-03,-1.36235E-01,
01790       -3.52427E-02, 8.84181E-03,-5.92127E-03,-8.61650E+00, 0.00000E+00,
01791        1.28492E-02, 0.00000E+00, 1.30096E+02, 1.04567E-02, 1.65686E-03,
01792       -5.53887E-06, 2.97810E-03, 0.00000E+00, 5.13122E-03, 8.66784E-02,
01793        1.58727E-01, 0.00000E+00, 0.00000E+00, 0.00000E+00,-7.27026E-06,
01794        0.00000E+00, 6.74494E+00, 4.93933E-03, 2.21656E-03, 2.50802E-03,
01795        0.00000E+00, 0.00000E+00,-2.08841E-02,-1.79873E+00, 1.45103E-03,
01796        2.81769E-04,-1.44703E-03,-5.16394E-05, 8.47001E-02, 1.70147E-01,
01797        5.72562E-03, 5.07493E-05, 4.36148E-03, 1.17863E-04, 4.74364E-03,
01798        6.61278E-03, 4.34292E-05, 1.44373E-03, 2.41470E-05, 2.84426E-03,
01799        8.56560E-04, 2.04028E-03, 0.00000E+00,-3.15994E+03,-2.46423E-03,
01800        1.13843E-03, 4.20512E-04, 0.00000E+00,-9.77214E+01, 6.77794E-03,
01801        5.27499E-03, 1.14936E-03, 0.00000E+00,-6.61311E-03,-1.84255E-02,
01802       -1.96259E-02, 2.98618E+04, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01803        6.44574E+02, 8.84668E-04, 5.05066E-04, 0.00000E+00, 4.02881E+03,
01804       -1.89503E-03, 0.00000E+00, 0.00000E+00, 8.21407E-04, 2.06780E-03,
01805        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01806       -1.20410E-02,-3.63963E-03, 9.92070E-05,-1.15284E-04,-6.33059E-05,
01807       -6.05545E-01, 8.34218E-03,-9.13036E+01, 3.71042E-04, 0.00000E+00,
01808        4.19000E-04, 2.70928E-03, 3.31507E-03,-4.44508E-03,-4.96334E-03,
01809       -1.60449E-03, 3.95119E-03, 2.48924E-03, 5.09815E-04, 4.05302E-03,
01810        2.24076E-03, 0.00000E+00, 6.84256E-03, 4.66354E-04, 0.00000E+00,
01811       -3.68328E-04, 0.00000E+00, 0.00000E+00,-1.46870E+02, 0.00000E+00,
01812        0.00000E+00, 1.09501E-03, 4.65156E-04, 5.62583E-04, 3.21596E+00,
01813        6.43168E-04, 3.14860E-03, 3.40738E-03, 1.78481E-03, 9.62532E-04,
01814        5.58171E-04, 3.43731E+00,-2.33195E-01, 5.10289E-04, 0.00000E+00,
01815        0.00000E+00,-9.25347E+04, 0.00000E+00,-1.99639E-03, 0.00000E+00,
01816        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01817        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00
01818    };
01819 
01820    double Msise00Drag::pd[9][150] = {
01821    /*  HE DENSITY */ {
01822        1.09979E+00,-4.88060E-02,-1.97501E-01,-9.10280E-02,-6.96558E-03,
01823        2.42136E-02, 3.91333E-01,-7.20068E-03,-3.22718E-02, 1.41508E+00,
01824        1.68194E-01, 1.85282E-02, 1.09384E-01,-7.24282E+00, 0.00000E+00,
01825        2.96377E-01,-4.97210E-02, 1.04114E+02,-8.61108E-02,-7.29177E-04,
01826        1.48998E-06, 1.08629E-03, 0.00000E+00, 0.00000E+00, 8.31090E-02,
01827        1.12818E-01,-5.75005E-02,-1.29919E-02,-1.78849E-02,-2.86343E-06,
01828        0.00000E+00,-1.51187E+02,-6.65902E-03, 0.00000E+00,-2.02069E-03,
01829        0.00000E+00, 0.00000E+00, 4.32264E-02,-2.80444E+01,-3.26789E-03,
01830        2.47461E-03, 0.00000E+00, 0.00000E+00, 9.82100E-02, 1.22714E-01,
01831       -3.96450E-02, 0.00000E+00,-2.76489E-03, 0.00000E+00, 1.87723E-03,
01832       -8.09813E-03, 4.34428E-05,-7.70932E-03, 0.00000E+00,-2.28894E-03,
01833       -5.69070E-03,-5.22193E-03, 6.00692E-03,-7.80434E+03,-3.48336E-03,
01834       -6.38362E-03,-1.82190E-03, 0.00000E+00,-7.58976E+01,-2.17875E-02,
01835       -1.72524E-02,-9.06287E-03, 0.00000E+00, 2.44725E-02, 8.66040E-02,
01836        1.05712E-01, 3.02543E+04, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01837       -6.01364E+03,-5.64668E-03,-2.54157E-03, 0.00000E+00, 3.15611E+02,
01838       -5.69158E-03, 0.00000E+00, 0.00000E+00,-4.47216E-03,-4.49523E-03,
01839        4.64428E-03, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01840        4.51236E-02, 2.46520E-02, 6.17794E-03, 0.00000E+00, 0.00000E+00,
01841       -3.62944E-01,-4.80022E-02,-7.57230E+01,-1.99656E-03, 0.00000E+00,
01842       -5.18780E-03,-1.73990E-02,-9.03485E-03, 7.48465E-03, 1.53267E-02,
01843        1.06296E-02, 1.18655E-02, 2.55569E-03, 1.69020E-03, 3.51936E-02,
01844       -1.81242E-02, 0.00000E+00,-1.00529E-01,-5.10574E-03, 0.00000E+00,
01845        2.10228E-03, 0.00000E+00, 0.00000E+00,-1.73255E+02, 5.07833E-01,
01846       -2.41408E-01, 8.75414E-03, 2.77527E-03,-8.90353E-05,-5.25148E+00,
01847       -5.83899E-03,-2.09122E-02,-9.63530E-03, 9.77164E-03, 4.07051E-03,
01848        2.53555E-04,-5.52875E+00,-3.55993E-01,-2.49231E-03, 0.00000E+00,
01849        0.00000E+00, 2.86026E+01, 0.00000E+00, 3.42722E-04, 0.00000E+00,
01850        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01851        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00
01852    }, /* O DENSITY */ {
01853        1.02315E+00,-1.59710E-01,-1.06630E-01,-1.77074E-02,-4.42726E-03,
01854        3.44803E-02, 4.45613E-02,-3.33751E-02,-5.73598E-02, 3.50360E-01,
01855        6.33053E-02, 2.16221E-02, 5.42577E-02,-5.74193E+00, 0.00000E+00,
01856        1.90891E-01,-1.39194E-02, 1.01102E+02, 8.16363E-02, 1.33717E-04,
01857        6.54403E-06, 3.10295E-03, 0.00000E+00, 0.00000E+00, 5.38205E-02,
01858        1.23910E-01,-1.39831E-02, 0.00000E+00, 0.00000E+00,-3.95915E-06,
01859        0.00000E+00,-7.14651E-01,-5.01027E-03, 0.00000E+00,-3.24756E-03,
01860        0.00000E+00, 0.00000E+00, 4.42173E-02,-1.31598E+01,-3.15626E-03,
01861        1.24574E-03,-1.47626E-03,-1.55461E-03, 6.40682E-02, 1.34898E-01,
01862       -2.42415E-02, 0.00000E+00, 0.00000E+00, 0.00000E+00, 6.13666E-04,
01863       -5.40373E-03, 2.61635E-05,-3.33012E-03, 0.00000E+00,-3.08101E-03,
01864       -2.42679E-03,-3.36086E-03, 0.00000E+00,-1.18979E+03,-5.04738E-02,
01865       -2.61547E-03,-1.03132E-03, 1.91583E-04,-8.38132E+01,-1.40517E-02,
01866       -1.14167E-02,-4.08012E-03, 1.73522E-04,-1.39644E-02,-6.64128E-02,
01867       -6.85152E-02,-1.34414E+04, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01868        6.07916E+02,-4.12220E-03,-2.20996E-03, 0.00000E+00, 1.70277E+03,
01869       -4.63015E-03, 0.00000E+00, 0.00000E+00,-2.25360E-03,-2.96204E-03,
01870        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01871        3.92786E-02, 1.31186E-02,-1.78086E-03, 0.00000E+00, 0.00000E+00,
01872       -3.90083E-01,-2.84741E-02,-7.78400E+01,-1.02601E-03, 0.00000E+00,
01873       -7.26485E-04,-5.42181E-03,-5.59305E-03, 1.22825E-02, 1.23868E-02,
01874        6.68835E-03,-1.03303E-02,-9.51903E-03, 2.70021E-04,-2.57084E-02,
01875       -1.32430E-02, 0.00000E+00,-3.81000E-02,-3.16810E-03, 0.00000E+00,
01876        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01877        0.00000E+00,-9.05762E-04,-2.14590E-03,-1.17824E-03, 3.66732E+00,
01878       -3.79729E-04,-6.13966E-03,-5.09082E-03,-1.96332E-03,-3.08280E-03,
01879       -9.75222E-04, 4.03315E+00,-2.52710E-01, 0.00000E+00, 0.00000E+00,
01880        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01881        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01882        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00
01883    }, /* N2 DENSITY */ {
01884        1.16112E+00, 0.00000E+00, 0.00000E+00, 3.33725E-02, 0.00000E+00,
01885        3.48637E-02,-5.44368E-03, 0.00000E+00,-6.73940E-02, 1.74754E-01,
01886        0.00000E+00, 0.00000E+00, 0.00000E+00, 1.74712E+02, 0.00000E+00,
01887        1.26733E-01, 0.00000E+00, 1.03154E+02, 5.52075E-02, 0.00000E+00,
01888        0.00000E+00, 8.13525E-04, 0.00000E+00, 0.00000E+00, 8.66784E-02,
01889        1.58727E-01, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01890        0.00000E+00,-2.50482E+01, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01891        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,-2.48894E-03,
01892        6.16053E-04,-5.79716E-04, 2.95482E-03, 8.47001E-02, 1.70147E-01,
01893        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01894        0.00000E+00, 2.47425E-05, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01895        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01896        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01897        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01898        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01899        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01900        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01901        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01902        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01903        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01904        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01905        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01906        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01907        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01908        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01909        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01910        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01911        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01912        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01913        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00
01914    }, /* TLB */ {
01915        9.44846E-01, 0.00000E+00, 0.00000E+00,-3.08617E-02, 0.00000E+00,
01916       -2.44019E-02, 6.48607E-03, 0.00000E+00, 3.08181E-02, 4.59392E-02,
01917        0.00000E+00, 0.00000E+00, 0.00000E+00, 1.74712E+02, 0.00000E+00,
01918        2.13260E-02, 0.00000E+00,-3.56958E+02, 0.00000E+00, 1.82278E-04,
01919        0.00000E+00, 3.07472E-04, 0.00000E+00, 0.00000E+00, 8.66784E-02,
01920        1.58727E-01, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01921        0.00000E+00, 0.00000E+00, 3.83054E-03, 0.00000E+00, 0.00000E+00,
01922       -1.93065E-03,-1.45090E-03, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01923        0.00000E+00,-1.23493E-03, 1.36736E-03, 8.47001E-02, 1.70147E-01,
01924        3.71469E-03, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01925        5.10250E-03, 2.47425E-05, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01926        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01927        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01928        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01929        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01930        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01931        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01932        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01933        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01934        0.00000E+00, 3.68756E-03, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01935        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01936        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01937        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01938        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01939        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01940        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01941        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01942        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01943        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01944        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00
01945    }, /* O2 DENSITY */ {
01946        1.35580E+00, 1.44816E-01, 0.00000E+00, 6.07767E-02, 0.00000E+00,
01947        2.94777E-02, 7.46900E-02, 0.00000E+00,-9.23822E-02, 8.57342E-02,
01948        0.00000E+00, 0.00000E+00, 0.00000E+00, 2.38636E+01, 0.00000E+00,
01949        7.71653E-02, 0.00000E+00, 8.18751E+01, 1.87736E-02, 0.00000E+00,
01950        0.00000E+00, 1.49667E-02, 0.00000E+00, 0.00000E+00, 8.66784E-02,
01951        1.58727E-01, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01952        0.00000E+00,-3.67874E+02, 5.48158E-03, 0.00000E+00, 0.00000E+00,
01953        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01954        0.00000E+00, 0.00000E+00, 0.00000E+00, 8.47001E-02, 1.70147E-01,
01955        1.22631E-02, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01956        8.17187E-03, 3.71617E-05, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01957        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01958        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,-2.10826E-03,
01959       -3.13640E-03, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01960        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01961        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01962        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01963        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01964       -7.35742E-02,-5.00266E-02, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01965        0.00000E+00, 1.94965E-02, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01966        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01967        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01968        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01969        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01970        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01971        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01972        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01973        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01974        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01975        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00
01976    }, /* AR DENSITY */ {
01977        1.04761E+00, 2.00165E-01, 2.37697E-01, 3.68552E-02, 0.00000E+00,
01978        3.57202E-02,-2.14075E-01, 0.00000E+00,-1.08018E-01,-3.73981E-01,
01979        0.00000E+00, 3.10022E-02,-1.16305E-03,-2.07596E+01, 0.00000E+00,
01980        8.64502E-02, 0.00000E+00, 9.74908E+01, 5.16707E-02, 0.00000E+00,
01981        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 8.66784E-02,
01982        1.58727E-01, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01983        0.00000E+00, 3.46193E+02, 1.34297E-02, 0.00000E+00, 0.00000E+00,
01984        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,-3.48509E-03,
01985       -1.54689E-04, 0.00000E+00, 0.00000E+00, 8.47001E-02, 1.70147E-01,
01986        1.47753E-02, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01987        1.89320E-02, 3.68181E-05, 1.32570E-02, 0.00000E+00, 0.00000E+00,
01988        3.59719E-03, 7.44328E-03,-1.00023E-03,-6.50528E+03, 0.00000E+00,
01989        1.03485E-02,-1.00983E-03,-4.06916E-03,-6.60864E+01,-1.71533E-02,
01990        1.10605E-02, 1.20300E-02,-5.20034E-03, 0.00000E+00, 0.00000E+00,
01991        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01992       -2.62769E+03, 7.13755E-03, 4.17999E-03, 0.00000E+00, 1.25910E+04,
01993        0.00000E+00, 0.00000E+00, 0.00000E+00,-2.23595E-03, 4.60217E-03,
01994        5.71794E-03, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01995       -3.18353E-02,-2.35526E-02,-1.36189E-02, 0.00000E+00, 0.00000E+00,
01996        0.00000E+00, 2.03522E-02,-6.67837E+01,-1.09724E-03, 0.00000E+00,
01997       -1.38821E-02, 1.60468E-02, 0.00000E+00, 0.00000E+00, 0.00000E+00,
01998        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 1.51574E-02,
01999       -5.44470E-04, 0.00000E+00, 7.28224E-02, 6.59413E-02, 0.00000E+00,
02000       -5.15692E-03, 0.00000E+00, 0.00000E+00,-3.70367E+03, 0.00000E+00,
02001        0.00000E+00, 1.36131E-02, 5.38153E-03, 0.00000E+00, 4.76285E+00,
02002       -1.75677E-02, 2.26301E-02, 0.00000E+00, 1.76631E-02, 4.77162E-03,
02003        0.00000E+00, 5.39354E+00, 0.00000E+00,-7.51710E-03, 0.00000E+00,
02004        0.00000E+00,-8.82736E+01, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02005        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02006        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00
02007    }, /* H DENSITY */ {
02008        1.26376E+00,-2.14304E-01,-1.49984E-01, 2.30404E-01, 2.98237E-02,
02009        2.68673E-02, 2.96228E-01, 2.21900E-02,-2.07655E-02, 4.52506E-01,
02010        1.20105E-01, 3.24420E-02, 4.24816E-02,-9.14313E+00, 0.00000E+00,
02011        2.47178E-02,-2.88229E-02, 8.12805E+01, 5.10380E-02,-5.80611E-03,
02012        2.51236E-05,-1.24083E-02, 0.00000E+00, 0.00000E+00, 8.66784E-02,
02013        1.58727E-01,-3.48190E-02, 0.00000E+00, 0.00000E+00, 2.89885E-05,
02014        0.00000E+00, 1.53595E+02,-1.68604E-02, 0.00000E+00, 1.01015E-02,
02015        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 2.84552E-04,
02016       -1.22181E-03, 0.00000E+00, 0.00000E+00, 8.47001E-02, 1.70147E-01,
02017       -1.04927E-02, 0.00000E+00, 0.00000E+00, 0.00000E+00,-5.91313E-03,
02018       -2.30501E-02, 3.14758E-05, 0.00000E+00, 0.00000E+00, 1.26956E-02,
02019        8.35489E-03, 3.10513E-04, 0.00000E+00, 3.42119E+03,-2.45017E-03,
02020       -4.27154E-04, 5.45152E-04, 1.89896E-03, 2.89121E+01,-6.49973E-03,
02021       -1.93855E-02,-1.48492E-02, 0.00000E+00,-5.10576E-02, 7.87306E-02,
02022        9.51981E-02,-1.49422E+04, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02023        2.65503E+02, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02024        0.00000E+00, 0.00000E+00, 0.00000E+00, 6.37110E-03, 3.24789E-04,
02025        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02026        6.14274E-02, 1.00376E-02,-8.41083E-04, 0.00000E+00, 0.00000E+00,
02027        0.00000E+00,-1.27099E-02, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02028       -3.94077E-03,-1.28601E-02,-7.97616E-03, 0.00000E+00, 0.00000E+00,
02029        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02030        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02031        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02032        0.00000E+00,-6.71465E-03,-1.69799E-03, 1.93772E-03, 3.81140E+00,
02033       -7.79290E-03,-1.82589E-02,-1.25860E-02,-1.04311E-02,-3.02465E-03,
02034        2.43063E-03, 3.63237E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02035        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02036        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02037        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00
02038    }, /* N DENSITY */ {
02039        7.09557E+01,-3.26740E-01, 0.00000E+00,-5.16829E-01,-1.71664E-03,
02040        9.09310E-02,-6.71500E-01,-1.47771E-01,-9.27471E-02,-2.30862E-01,
02041       -1.56410E-01, 1.34455E-02,-1.19717E-01, 2.52151E+00, 0.00000E+00,
02042       -2.41582E-01, 5.92939E-02, 4.39756E+00, 9.15280E-02, 4.41292E-03,
02043        0.00000E+00, 8.66807E-03, 0.00000E+00, 0.00000E+00, 8.66784E-02,
02044        1.58727E-01, 9.74701E-02, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02045        0.00000E+00, 6.70217E+01,-1.31660E-03, 0.00000E+00,-1.65317E-02,
02046        0.00000E+00, 0.00000E+00, 8.50247E-02, 2.77428E+01, 4.98658E-03,
02047        6.15115E-03, 9.50156E-03,-2.12723E-02, 8.47001E-02, 1.70147E-01,
02048       -2.38645E-02, 0.00000E+00, 0.00000E+00, 0.00000E+00, 1.37380E-03,
02049       -8.41918E-03, 2.80145E-05, 7.12383E-03, 0.00000E+00,-1.66209E-02,
02050        1.03533E-04,-1.68898E-02, 0.00000E+00, 3.64526E+03, 0.00000E+00,
02051        6.54077E-03, 3.69130E-04, 9.94419E-04, 8.42803E+01,-1.16124E-02,
02052       -7.74414E-03,-1.68844E-03, 1.42809E-03,-1.92955E-03, 1.17225E-01,
02053       -2.41512E-02, 1.50521E+04, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02054        1.60261E+03, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02055        0.00000E+00, 0.00000E+00, 0.00000E+00,-3.54403E-04,-1.87270E-02,
02056        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02057        2.76439E-02, 6.43207E-03,-3.54300E-02, 0.00000E+00, 0.00000E+00,
02058        0.00000E+00,-2.80221E-02, 8.11228E+01,-6.75255E-04, 0.00000E+00,
02059       -1.05162E-02,-3.48292E-03,-6.97321E-03, 0.00000E+00, 0.00000E+00,
02060        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02061        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02062        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02063        0.00000E+00,-1.45546E-03,-1.31970E-02,-3.57751E-03,-1.09021E+00,
02064       -1.50181E-02,-7.12841E-03,-6.64590E-03,-3.52610E-03,-1.87773E-02,
02065       -2.22432E-03,-3.93895E-01, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02066        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02067        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02068        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00 
02069    }, /* HOT O DENSITY */ {
02070        6.04050E-02, 1.57034E+00, 2.99387E-02, 0.00000E+00, 0.00000E+00,
02071        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,-1.51018E+00,
02072        0.00000E+00, 0.00000E+00, 0.00000E+00,-8.61650E+00, 1.26454E-02,
02073        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02074        0.00000E+00, 5.50878E-03, 0.00000E+00, 0.00000E+00, 8.66784E-02,
02075        1.58727E-01, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02076        0.00000E+00, 0.00000E+00, 6.23881E-02, 0.00000E+00, 0.00000E+00,
02077        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02078        0.00000E+00, 0.00000E+00, 0.00000E+00, 8.47001E-02, 1.70147E-01,
02079       -9.45934E-02, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02080        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02081        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02082        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 
02083        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02084        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02085        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02086        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02087        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02088        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02089        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02090        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02091        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02092        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02093        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02094        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02095        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02096        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02097        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02098        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02099        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00
02100    }};
02101    /* S PARAM  */
02102    double Msise00Drag::ps[150] = {
02103        9.56827E-01, 6.20637E-02, 3.18433E-02, 0.00000E+00, 0.00000E+00,
02104        3.94900E-02, 0.00000E+00, 0.00000E+00,-9.24882E-03,-7.94023E-03,
02105        0.00000E+00, 0.00000E+00, 0.00000E+00, 1.74712E+02, 0.00000E+00,
02106        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02107        0.00000E+00, 2.74677E-03, 0.00000E+00, 1.54951E-02, 8.66784E-02,
02108        1.58727E-01, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02109        0.00000E+00, 0.00000E+00, 0.00000E+00,-6.99007E-04, 0.00000E+00,
02110        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02111        0.00000E+00, 1.24362E-02,-5.28756E-03, 8.47001E-02, 1.70147E-01,
02112        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02113        0.00000E+00, 2.47425E-05, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02114        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02115        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02116        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02117        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02118        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02119        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02120        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02121        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02122        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02123        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02124        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02125        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02126        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02127        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02128        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02129        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02130        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02131        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02132        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00
02133    };
02134 
02135    /* TURBO */
02136    double Msise00Drag::pdl[2][25] = {
02137       { 1.09930E+00, 3.90631E+00, 3.07165E+00, 9.86161E-01, 1.63536E+01,
02138        4.63830E+00, 1.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02139        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02140        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02141        0.00000E+00, 0.00000E+00, 1.28840E+00, 3.10302E-02, 1.18339E-01 }, 
02142       { 1.00000E+00, 7.00000E-01, 1.15020E+00, 3.44689E+00, 1.28840E+00,
02143        1.00000E+00, 1.08738E+00, 1.22947E+00, 1.10016E+00, 7.34129E-01,
02144        1.15241E+00, 2.22784E+00, 7.95046E-01, 4.01612E+00, 4.47749E+00,
02145        1.23435E+02,-7.60535E-02, 1.68986E-06, 7.44294E-01, 1.03604E+00,
02146        1.72783E+02, 1.15020E+00, 3.44689E+00,-7.46230E-01, 9.49154E-01 }
02147    };
02148    /* LOWER BOUNDARY */
02149    double Msise00Drag::ptm[10]/* ptm[50]*/ = {
02150        1.04130E+03, 3.86000E+02, 1.95000E+02, 1.66728E+01, 2.13000E+02,
02151        1.20000E+02, 2.40000E+02, 1.87000E+02,-2.00000E+00, 0.00000E+00
02152    };
02153    double Msise00Drag::pdm[8][10] = {
02154    {    2.45600E+07, 6.71072E-06, 1.00000E+02, 0.00000E+00, 1.10000E+02,
02155        1.00000E+01, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00 },\
02156    {    8.59400E+10, 1.00000E+00, 1.05000E+02,-8.00000E+00, 1.10000E+02,
02157        1.00000E+01, 9.00000E+01, 2.00000E+00, 0.00000E+00, 0.00000E+00 },\
02158    {    2.81000E+11, 0.00000E+00, 1.05000E+02, 2.80000E+01, 2.89500E+01,
02159        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00 },
02160    {    3.30000E+10, 2.68270E-01, 1.05000E+02, 1.00000E+00, 1.10000E+02,
02161        1.00000E+01, 1.10000E+02,-1.00000E+01, 0.00000E+00, 0.00000E+00 },
02162    {    1.33000E+09, 1.19615E-02, 1.05000E+02, 0.00000E+00, 1.10000E+02,
02163        1.00000E+01, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00 },
02164    {    1.76100E+05, 1.00000E+00, 9.50000E+01,-8.00000E+00, 1.10000E+02,
02165        1.00000E+01, 9.00000E+01, 2.00000E+00, 0.00000E+00, 0.00000E+00, },
02166    {    1.00000E+07, 1.00000E+00, 1.05000E+02,-8.00000E+00, 1.10000E+02,
02167        1.00000E+01, 9.00000E+01, 2.00000E+00, 0.00000E+00, 0.00000E+00 },
02168    {    1.00000E+06, 1.00000E+00, 1.05000E+02,-8.00000E+00, 5.50000E+02,
02169        7.60000E+01, 9.00000E+01, 2.00000E+00, 0.00000E+00, 4.00000E+03 }};
02170 
02171 
02172    double Msise00Drag::ptl[4][100] = {
02173    /* TN1(2) */ {
02174        1.00858E+00, 4.56011E-02,-2.22972E-02,-5.44388E-02, 5.23136E-04,
02175       -1.88849E-02, 5.23707E-02,-9.43646E-03, 6.31707E-03,-7.80460E-02,
02176       -4.88430E-02, 0.00000E+00, 0.00000E+00,-7.60250E+00, 0.00000E+00,
02177       -1.44635E-02,-1.76843E-02,-1.21517E+02, 2.85647E-02, 0.00000E+00,
02178        0.00000E+00, 6.31792E-04, 0.00000E+00, 5.77197E-03, 8.66784E-02,
02179        1.58727E-01, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02180        0.00000E+00,-8.90272E+03, 3.30611E-03, 3.02172E-03, 0.00000E+00,
02181       -2.13673E-03,-3.20910E-04, 0.00000E+00, 0.00000E+00, 2.76034E-03,
02182        2.82487E-03,-2.97592E-04,-4.21534E-03, 8.47001E-02, 1.70147E-01,
02183        8.96456E-03, 0.00000E+00,-1.08596E-02, 0.00000E+00, 0.00000E+00,
02184        5.57917E-03, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02185        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02186        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02187        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02188        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02189        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02190        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02191        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02192        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02193        0.00000E+00, 9.65405E-03, 0.00000E+00, 0.00000E+00, 2.00000E+00
02194    }, /*  TN1(3) */ {
02195        9.39664E-01, 8.56514E-02,-6.79989E-03, 2.65929E-02,-4.74283E-03,
02196        1.21855E-02,-2.14905E-02, 6.49651E-03,-2.05477E-02,-4.24952E-02,
02197        0.00000E+00, 0.00000E+00, 0.00000E+00, 1.19148E+01, 0.00000E+00,
02198        1.18777E-02,-7.28230E-02,-8.15965E+01, 1.73887E-02, 0.00000E+00,
02199        0.00000E+00, 0.00000E+00,-1.44691E-02, 2.80259E-04, 8.66784E-02,
02200        1.58727E-01, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02201        0.00000E+00, 2.16584E+02, 3.18713E-03, 7.37479E-03, 0.00000E+00,
02202       -2.55018E-03,-3.92806E-03, 0.00000E+00, 0.00000E+00,-2.89757E-03,
02203       -1.33549E-03, 1.02661E-03, 3.53775E-04, 8.47001E-02, 1.70147E-01,
02204       -9.17497E-03, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02205        3.56082E-03, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02206        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02207        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02208        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02209        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02210        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02211        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02212        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02213        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02214        0.00000E+00,-1.00902E-02, 0.00000E+00, 0.00000E+00, 2.00000E+00
02215    }, /* TN1(4) */ {
02216        9.85982E-01,-4.55435E-02, 1.21106E-02, 2.04127E-02,-2.40836E-03,
02217        1.11383E-02,-4.51926E-02, 1.35074E-02,-6.54139E-03, 1.15275E-01,
02218        1.28247E-01, 0.00000E+00, 0.00000E+00,-5.30705E+00, 0.00000E+00,
02219       -3.79332E-02,-6.24741E-02, 7.71062E-01, 2.96315E-02, 0.00000E+00,
02220        0.00000E+00, 0.00000E+00, 6.81051E-03,-4.34767E-03, 8.66784E-02,
02221        1.58727E-01, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02222        0.00000E+00, 1.07003E+01,-2.76907E-03, 4.32474E-04, 0.00000E+00,
02223        1.31497E-03,-6.47517E-04, 0.00000E+00,-2.20621E+01,-1.10804E-03,
02224       -8.09338E-04, 4.18184E-04, 4.29650E-03, 8.47001E-02, 1.70147E-01,
02225        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02226       -4.04337E-03, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02227        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02228        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,-9.52550E-04,
02229        8.56253E-04, 4.33114E-04, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02230        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 1.21223E-03,
02231        2.38694E-04, 9.15245E-04, 1.28385E-03, 8.67668E-04,-5.61425E-06,
02232        1.04445E+00, 3.41112E+01, 0.00000E+00,-8.40704E-01,-2.39639E+02,
02233        7.06668E-01,-2.05873E+01,-3.63696E-01, 2.39245E+01, 0.00000E+00,
02234       -1.06657E-03,-7.67292E-04, 1.54534E-04, 0.00000E+00, 0.00000E+00,
02235        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 2.00000E+00
02236    }, /* TN1(5) TN2(1) */ {
02237        1.00320E+00, 3.83501E-02,-2.38983E-03, 2.83950E-03, 4.20956E-03,
02238        5.86619E-04, 2.19054E-02,-1.00946E-02,-3.50259E-03, 4.17392E-02,
02239       -8.44404E-03, 0.00000E+00, 0.00000E+00, 4.96949E+00, 0.00000E+00,
02240       -7.06478E-03,-1.46494E-02, 3.13258E+01,-1.86493E-03, 0.00000E+00,
02241       -1.67499E-02, 0.00000E+00, 0.00000E+00, 5.12686E-04, 8.66784E-02,
02242        1.58727E-01,-4.64167E-03, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02243        4.37353E-03,-1.99069E+02, 0.00000E+00,-5.34884E-03, 0.00000E+00,
02244        1.62458E-03, 2.93016E-03, 2.67926E-03, 5.90449E+02, 0.00000E+00,
02245        0.00000E+00,-1.17266E-03,-3.58890E-04, 8.47001E-02, 1.70147E-01,
02246        0.00000E+00, 0.00000E+00, 1.38673E-02, 0.00000E+00, 0.00000E+00,
02247        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02248        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02249        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 1.60571E-03,
02250        6.28078E-04, 5.05469E-05, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02251        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,-1.57829E-03,
02252       -4.00855E-04, 5.04077E-05,-1.39001E-03,-2.33406E-03,-4.81197E-04,
02253        1.46758E+00, 6.20332E+00, 0.00000E+00, 3.66476E-01,-6.19760E+01,
02254        3.09198E-01,-1.98999E+01, 0.00000E+00,-3.29933E+02, 0.00000E+00,
02255       -1.10080E-03,-9.39310E-05, 1.39638E-04, 0.00000E+00, 0.00000E+00,
02256        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 2.00000E+00
02257    } };
02258 
02259    double Msise00Drag::pma[10][100] = {
02260    /* TN2(2) */ {
02261        9.81637E-01,-1.41317E-03, 3.87323E-02, 0.00000E+00, 0.00000E+00,
02262        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,-3.58707E-02,
02263       -8.63658E-03, 0.00000E+00, 0.00000E+00,-2.02226E+00, 0.00000E+00,
02264       -8.69424E-03,-1.91397E-02, 8.76779E+01, 4.52188E-03, 0.00000E+00,
02265        2.23760E-02, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02266        0.00000E+00,-7.07572E-03, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02267       -4.11210E-03, 3.50060E+01, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02268        0.00000E+00, 0.00000E+00,-8.36657E-03, 1.61347E+01, 0.00000E+00,
02269        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02270        0.00000E+00, 0.00000E+00,-1.45130E-02, 0.00000E+00, 0.00000E+00,
02271        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02272        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02273        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 1.24152E-03,
02274        6.43365E-04, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02275        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 1.33255E-03,
02276        2.42657E-03, 1.60666E-03,-1.85728E-03,-1.46874E-03,-4.79163E-06,
02277        1.22464E+00, 3.53510E+01, 0.00000E+00, 4.49223E-01,-4.77466E+01,
02278        4.70681E-01, 8.41861E+00,-2.88198E-01, 1.67854E+02, 0.00000E+00,
02279        7.11493E-04, 6.05601E-04, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02280        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 2.00000E+00
02281    }, /* TN2(3) */ {
02282        1.00422E+00,-7.11212E-03, 5.24480E-03, 0.00000E+00, 0.00000E+00,
02283        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,-5.28914E-02,
02284       -2.41301E-02, 0.00000E+00, 0.00000E+00,-2.12219E+01,-1.03830E-02,
02285       -3.28077E-03, 1.65727E-02, 1.68564E+00,-6.68154E-03, 0.00000E+00,
02286        1.45155E-02, 0.00000E+00, 8.42365E-03, 0.00000E+00, 0.00000E+00,
02287        0.00000E+00,-4.34645E-03, 0.00000E+00, 0.00000E+00, 2.16780E-02,
02288        0.00000E+00,-1.38459E+02, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02289        0.00000E+00, 0.00000E+00, 7.04573E-03,-4.73204E+01, 0.00000E+00,
02290        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02291        0.00000E+00, 0.00000E+00, 1.08767E-02, 0.00000E+00, 0.00000E+00,
02292        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02293        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,-8.08279E-03,
02294        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 5.21769E-04,
02295       -2.27387E-04, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02296        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 3.26769E-03,
02297        3.16901E-03, 4.60316E-04,-1.01431E-04, 1.02131E-03, 9.96601E-04,
02298        1.25707E+00, 2.50114E+01, 0.00000E+00, 4.24472E-01,-2.77655E+01,
02299        3.44625E-01, 2.75412E+01, 0.00000E+00, 7.94251E+02, 0.00000E+00,
02300        2.45835E-03, 1.38871E-03, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02301        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 2.00000E+00
02302    }, /* TN2(4) TN3(1) */ {
02303        1.01890E+00,-2.46603E-02, 1.00078E-02, 0.00000E+00, 0.00000E+00,
02304        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,-6.70977E-02,
02305       -4.02286E-02, 0.00000E+00, 0.00000E+00,-2.29466E+01,-7.47019E-03,
02306        2.26580E-03, 2.63931E-02, 3.72625E+01,-6.39041E-03, 0.00000E+00,
02307        9.58383E-03, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02308        0.00000E+00,-1.85291E-03, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02309        0.00000E+00, 1.39717E+02, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02310        0.00000E+00, 0.00000E+00, 9.19771E-03,-3.69121E+02, 0.00000E+00,
02311        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02312        0.00000E+00, 0.00000E+00,-1.57067E-02, 0.00000E+00, 0.00000E+00,
02313        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02314        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,-7.07265E-03,
02315        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,-2.92953E-03,
02316       -2.77739E-03,-4.40092E-04, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02317        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 2.47280E-03,
02318        2.95035E-04,-1.81246E-03, 2.81945E-03, 4.27296E-03, 9.78863E-04,
02319        1.40545E+00,-6.19173E+00, 0.00000E+00, 0.00000E+00,-7.93632E+01,
02320        4.44643E-01,-4.03085E+02, 0.00000E+00, 1.15603E+01, 0.00000E+00,
02321        2.25068E-03, 8.48557E-04,-2.98493E-04, 0.00000E+00, 0.00000E+00,
02322        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 2.00000E+00
02323    }, /* TN3(2) */ {
02324        9.75801E-01, 3.80680E-02,-3.05198E-02, 0.00000E+00, 0.00000E+00,
02325        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 3.85575E-02,
02326        5.04057E-02, 0.00000E+00, 0.00000E+00,-1.76046E+02, 1.44594E-02,
02327       -1.48297E-03,-3.68560E-03, 3.02185E+01,-3.23338E-03, 0.00000E+00,
02328        1.53569E-02, 0.00000E+00,-1.15558E-02, 0.00000E+00, 0.00000E+00,
02329        0.00000E+00, 4.89620E-03, 0.00000E+00, 0.00000E+00,-1.00616E-02,
02330       -8.21324E-03,-1.57757E+02, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02331        0.00000E+00, 0.00000E+00, 6.63564E-03, 4.58410E+01, 0.00000E+00,
02332        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02333        0.00000E+00, 0.00000E+00,-2.51280E-02, 0.00000E+00, 0.00000E+00,
02334        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02335        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 9.91215E-03,
02336        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,-8.73148E-04,
02337       -1.29648E-03,-7.32026E-05, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02338        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,-4.68110E-03,
02339       -4.66003E-03,-1.31567E-03,-7.39390E-04, 6.32499E-04,-4.65588E-04,
02340       -1.29785E+00,-1.57139E+02, 0.00000E+00, 2.58350E-01,-3.69453E+01,
02341        4.10672E-01, 9.78196E+00,-1.52064E-01,-3.85084E+03, 0.00000E+00,
02342       -8.52706E-04,-1.40945E-03,-7.26786E-04, 0.00000E+00, 0.00000E+00,
02343        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 2.00000E+00
02344    }, /* TN3(3) */ {
02345        9.60722E-01, 7.03757E-02,-3.00266E-02, 0.00000E+00, 0.00000E+00,
02346        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 2.22671E-02,
02347        4.10423E-02, 0.00000E+00, 0.00000E+00,-1.63070E+02, 1.06073E-02,
02348        5.40747E-04, 7.79481E-03, 1.44908E+02, 1.51484E-04, 0.00000E+00,
02349        1.97547E-02, 0.00000E+00,-1.41844E-02, 0.00000E+00, 0.00000E+00,
02350        0.00000E+00, 5.77884E-03, 0.00000E+00, 0.00000E+00, 9.74319E-03,
02351        0.00000E+00,-2.88015E+03, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02352        0.00000E+00, 0.00000E+00,-4.44902E-03,-2.92760E+01, 0.00000E+00,
02353        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02354        0.00000E+00, 0.00000E+00, 2.34419E-02, 0.00000E+00, 0.00000E+00,
02355        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02356        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 5.36685E-03,
02357        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,-4.65325E-04,
02358       -5.50628E-04, 3.31465E-04, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02359        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,-2.06179E-03,
02360       -3.08575E-03,-7.93589E-04,-1.08629E-04, 5.95511E-04,-9.05050E-04,
02361        1.18997E+00, 4.15924E+01, 0.00000E+00,-4.72064E-01,-9.47150E+02,
02362        3.98723E-01, 1.98304E+01, 0.00000E+00, 3.73219E+03, 0.00000E+00,
02363       -1.50040E-03,-1.14933E-03,-1.56769E-04, 0.00000E+00, 0.00000E+00,
02364        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 2.00000E+00
02365    }, /* TN3(4) */ {
02366        1.03123E+00,-7.05124E-02, 8.71615E-03, 0.00000E+00, 0.00000E+00,
02367        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,-3.82621E-02,
02368       -9.80975E-03, 0.00000E+00, 0.00000E+00, 2.89286E+01, 9.57341E-03,
02369        0.00000E+00, 0.00000E+00, 8.66153E+01, 7.91938E-04, 0.00000E+00,
02370        0.00000E+00, 0.00000E+00, 4.68917E-03, 0.00000E+00, 0.00000E+00,
02371        0.00000E+00, 7.86638E-03, 0.00000E+00, 0.00000E+00, 9.90827E-03,
02372        0.00000E+00, 6.55573E+01, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02373        0.00000E+00, 0.00000E+00, 0.00000E+00,-4.00200E+01, 0.00000E+00,
02374        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02375        0.00000E+00, 0.00000E+00, 7.07457E-03, 0.00000E+00, 0.00000E+00,
02376        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02377        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 5.72268E-03,
02378        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,-2.04970E-04,
02379        1.21560E-03,-8.05579E-06, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02380        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,-2.49941E-03,
02381       -4.57256E-04,-1.59311E-04, 2.96481E-04,-1.77318E-03,-6.37918E-04,
02382        1.02395E+00, 1.28172E+01, 0.00000E+00, 1.49903E-01,-2.63818E+01,
02383        0.00000E+00, 4.70628E+01,-2.22139E-01, 4.82292E-02, 0.00000E+00,
02384       -8.67075E-04,-5.86479E-04, 5.32462E-04, 0.00000E+00, 0.00000E+00,
02385        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 2.00000E+00
02386    }, /* TN3(5) SURFACE TEMP TSL */ {
02387        1.00828E+00,-9.10404E-02,-2.26549E-02, 0.00000E+00, 0.00000E+00,
02388        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,-2.32420E-02,
02389       -9.08925E-03, 0.00000E+00, 0.00000E+00, 3.36105E+01, 0.00000E+00,
02390        0.00000E+00, 0.00000E+00,-1.24957E+01,-5.87939E-03, 0.00000E+00,
02391        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02392        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02393        0.00000E+00, 2.79765E+01, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02394        0.00000E+00, 0.00000E+00, 0.00000E+00, 2.01237E+03, 0.00000E+00,
02395        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02396        0.00000E+00, 0.00000E+00,-1.75553E-02, 0.00000E+00, 0.00000E+00,
02397        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02398        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02399        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 3.29699E-03,
02400        1.26659E-03, 2.68402E-04, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02401        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 1.17894E-03,
02402        1.48746E-03, 1.06478E-04, 1.34743E-04,-2.20939E-03,-6.23523E-04,
02403        6.36539E-01, 1.13621E+01, 0.00000E+00,-3.93777E-01, 2.38687E+03,
02404        0.00000E+00, 6.61865E+02,-1.21434E-01, 9.27608E+00, 0.00000E+00,
02405        1.68478E-04, 1.24892E-03, 1.71345E-03, 0.00000E+00, 0.00000E+00,
02406        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 2.00000E+00
02407    }, /* TGN3(2) SURFACE GRAD TSLG */ {
02408        1.57293E+00,-6.78400E-01, 6.47500E-01, 0.00000E+00, 0.00000E+00,
02409        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,-7.62974E-02,
02410       -3.60423E-01, 0.00000E+00, 0.00000E+00, 1.28358E+02, 0.00000E+00,
02411        0.00000E+00, 0.00000E+00, 4.68038E+01, 0.00000E+00, 0.00000E+00,
02412        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02413        0.00000E+00,-1.67898E-01, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02414        0.00000E+00, 2.90994E+04, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02415        0.00000E+00, 0.00000E+00, 0.00000E+00, 3.15706E+01, 0.00000E+00,
02416        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02417        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02418        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02419        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02420        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02421        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02422        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02423        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02424        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02425        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02426        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02427        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 2.00000E+00
02428    }, /* TGN2(1) TGN1(2) */ {
02429        8.60028E-01, 3.77052E-01, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02430        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,-1.17570E+00,
02431        0.00000E+00, 0.00000E+00, 0.00000E+00, 7.77757E-03, 0.00000E+00,
02432        0.00000E+00, 0.00000E+00, 1.01024E+02, 0.00000E+00, 0.00000E+00,
02433        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02434        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02435        0.00000E+00, 6.54251E+02, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02436        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02437        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02438        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02439        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02440        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02441        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02442        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02443        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,-1.56959E-02,
02444        1.91001E-02, 3.15971E-02, 1.00982E-02,-6.71565E-03, 2.57693E-03,
02445        1.38692E+00, 2.82132E-01, 0.00000E+00, 0.00000E+00, 3.81511E+02,
02446        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02447        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02448        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 2.00000E+00
02449    }, /* TGN3(1) TGN2(2) */ {
02450        1.06029E+00,-5.25231E-02, 3.73034E-01, 0.00000E+00, 0.00000E+00,
02451        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 3.31072E-02,
02452       -3.88409E-01, 0.00000E+00, 0.00000E+00,-1.65295E+02,-2.13801E-01,
02453       -4.38916E-02,-3.22716E-01,-8.82393E+01, 1.18458E-01, 0.00000E+00,
02454       -4.35863E-01, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02455        0.00000E+00,-1.19782E-01, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02456        0.00000E+00, 2.62229E+01, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02457        0.00000E+00, 0.00000E+00, 0.00000E+00,-5.37443E+01, 0.00000E+00,
02458        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02459        0.00000E+00, 0.00000E+00,-4.55788E-01, 0.00000E+00, 0.00000E+00,
02460        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02461        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02462        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 3.84009E-02,
02463        3.96733E-02, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02464        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 5.05494E-02,
02465        7.39617E-02, 1.92200E-02,-8.46151E-03,-1.34244E-02, 1.96338E-02,
02466        1.50421E+00, 1.88368E+01, 0.00000E+00, 0.00000E+00,-5.13114E+01,
02467        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02468        5.11923E-02, 3.61225E-02, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02469        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 2.00000E+00
02470    } };
02471     
02472    /* SEMIANNUAL MULT SAM */
02473    double Msise00Drag::sam[100] = {
02474        1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00,
02475        1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00,
02476        1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00,
02477        1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00,
02478        1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00,
02479        1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00,
02480        1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00,
02481        1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00,
02482        1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00,
02483        1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00, 1.00000E+00,
02484        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02485        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02486        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02487        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02488        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02489        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02490        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02491        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02492        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,
02493        0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00
02494    };
02495     
02496     
02497    /* MIDDLE ATMOSPHERE AVERAGES */
02498    double Msise00Drag::pavgm[10] = {
02499        2.61000E+02, 2.64000E+02, 2.29000E+02, 2.17000E+02, 2.17000E+02,
02500        2.23000E+02, 2.86760E+02,-2.93940E+00, 2.50000E+00, 0.00000E+00 };
02501 
02502 
02504 
02505    /* PARMB */
02506    double Msise00Drag::gsurf = 0.0;
02507    double Msise00Drag::re = 0.0;
02508 
02509    /* GTS3C */
02510    double Msise00Drag::dd=0.0;
02511 
02512     /* DMIX */
02513    double Msise00Drag::dm04=0.0;
02514    double Msise00Drag::dm16=0.0;
02515    double Msise00Drag::dm28=0.0;
02516    double Msise00Drag::dm32=0.0;
02517    double Msise00Drag::dm40=0.0;
02518    double Msise00Drag::dm01=0.0;
02519    double Msise00Drag::dm14=0.0;
02520 
02521     /* MESO7 */
02522    double Msise00Drag::meso_tn1[5]={0.0};
02523    double Msise00Drag::meso_tn2[4]={0.0};
02524    double Msise00Drag::meso_tn3[5]={0.0};
02525    double Msise00Drag::meso_tgn1[2]={0.0};
02526    double Msise00Drag::meso_tgn2[2]={0.0};
02527    double Msise00Drag::meso_tgn3[2]={0.0};
02528 
02529     /* LPOLY */
02530    double Msise00Drag::dfa=0.0;
02531    double Msise00Drag::plg[4][9]={0.0};
02532    double Msise00Drag::ctloc=0.0;
02533    double Msise00Drag::stloc=0.0;
02534    double Msise00Drag::c2tloc=0.0;
02535    double Msise00Drag::s2tloc=0.0;
02536    double Msise00Drag::s3tloc=0.0;
02537    double Msise00Drag::c3tloc=0.0;
02538    double Msise00Drag::apdf=0.0;
02539    double Msise00Drag::apt[4]={0.0};
02540 
02541 
02542 }  // End of namespace 'gpstk'
02543 
02544 
02545 
02546 

Generated on Wed May 22 03:31:10 2013 for GPS ToolKit Software Library by  doxygen 1.3.9.1