JSBSim Flight Dynamics Model 1.0 (23 February 2013)
An Open Source Flight Dynamics and Control Software Library in C++

FGStandardAtmosphere.cpp

00001 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00002 
00003  Module:       FGStandardAtmosphere.cpp
00004  Author:       Jon Berndt, Tony Peden
00005  Date started: 5/2011
00006  Purpose:      Models the 1976 U.S. Standard Atmosphere
00007  Called by:    FGFDMExec
00008 
00009  ------------- Copyright (C) 2011  Jon S. Berndt (jon@jsbsim.org) -------------
00010 
00011  This program is free software; you can redistribute it and/or modify it under
00012  the terms of the GNU Lesser General Public License as published by the Free Software
00013  Foundation; either version 2 of the License, or (at your option) any later
00014  version.
00015 
00016  This program is distributed in the hope that it will be useful, but WITHOUT
00017  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00018  FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00019  details.
00020 
00021  You should have received a copy of the GNU Lesser General Public License along with
00022  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00023  Place - Suite 330, Boston, MA  02111-1307, USA.
00024 
00025  Further information about the GNU Lesser General Public License can also be found on
00026  the world wide web at http://www.gnu.org.
00027 
00028 FUNCTIONAL DESCRIPTION
00029 --------------------------------------------------------------------------------
00030 
00031 
00032 HISTORY
00033 --------------------------------------------------------------------------------
00034 
00035 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00036 COMMENTS, REFERENCES,  and NOTES
00037 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00038 [1]   Anderson, John D. "Introduction to Flight, Third Edition", McGraw-Hill,
00039       1989, ISBN 0-07-001641-0
00040 
00041 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00042 INCLUDES
00043 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
00044 
00045 #include <iostream>
00046 #include <iomanip>
00047 #include <cstdlib>
00048 #include "FGFDMExec.h"
00049 #include "FGStandardAtmosphere.h"
00050 
00051 namespace JSBSim {
00052 
00053 static const char *IdSrc = "$Id: FGStandardAtmosphere.cpp,v 1.21 2012/04/13 13:18:27 jberndt Exp $";
00054 static const char *IdHdr = ID_STANDARDATMOSPHERE;
00055 
00056 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00057 CLASS IMPLEMENTATION
00058 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
00059 
00060 FGStandardAtmosphere::FGStandardAtmosphere(FGFDMExec* fdmex) : FGAtmosphere(fdmex),
00061                                                                TemperatureBias(0.0),
00062                                                                TemperatureDeltaGradient(0.0)
00063 {
00064   Name = "FGStandardAtmosphere";
00065 
00066   StdAtmosTemperatureTable = new FGTable(9);
00067 
00068   // This is the U.S. Standard Atmosphere table for temperature in degrees
00069   // Rankine, based on geometric altitude. The table values are often given
00070   // in literature relative to geopotential altitude. 
00071   //
00072   //                        GeoMet Alt    Temp      GeoPot Alt  GeoMet Alt
00073   //                           (ft)      (deg R)      (km)        (km)
00074   //                         --------   --------    ----------  ----------
00075   *StdAtmosTemperatureTable <<      0.0 << 518.67 //    0.000       0.000
00076                             <<  36151.6 << 390.0  //   11.000      11.019
00077                             <<  65823.5 << 390.0  //   20.000      20.063
00078                             << 105518.4 << 411.6  //   32.000      32.162
00079                             << 155347.8 << 487.2  //   47.000      47.350
00080                             << 168677.8 << 487.2  //   51.000      51.413
00081                             << 235570.9 << 386.4  //   71.000      71.802
00082                             << 282152.2 << 336.5  //   84.852      86.000
00083                             << 298556.4 << 336.5; //               91.000 - First layer in high altitude regime 
00084 
00085   LapseRateVector.resize(StdAtmosTemperatureTable->GetNumRows()-1);
00086   PressureBreakpointVector.resize(StdAtmosTemperatureTable->GetNumRows());
00087 
00088   // Assume the altitude to fade out the gradient at is at the highest
00089   // altitude in the table. Above that, other functions are used to
00090   // calculate temperature.
00091   GradientFadeoutAltitude = (*StdAtmosTemperatureTable)(StdAtmosTemperatureTable->GetNumRows(),0);
00092 
00093   bind();
00094   Debug(0);
00095 }
00096 
00097 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00098 
00099 FGStandardAtmosphere::~FGStandardAtmosphere()
00100 {
00101   delete StdAtmosTemperatureTable;
00102   LapseRateVector.clear();
00103   Debug(1);
00104 }
00105 
00106 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00107 
00108 bool FGStandardAtmosphere::InitModel(void)
00109 {
00110   PressureBreakpointVector[0] = StdSLpressure = 2116.22; // psf
00111   TemperatureDeltaGradient = 0.0;
00112   TemperatureBias = 0.0;
00113   CalculateLapseRates();
00114   CalculatePressureBreakpoints();
00115   Calculate(0.0);
00116   StdSLtemperature = SLtemperature = Temperature;
00117   SLpressure = Pressure;
00118   StdSLdensity     = SLdensity = Density;
00119   StdSLsoundspeed  = SLsoundspeed = Soundspeed;
00120 
00121   rSLtemperature = 1/SLtemperature ;
00122   rSLpressure    = 1/SLpressure    ;
00123   rSLdensity     = 1/SLdensity     ;
00124   rSLsoundspeed  = 1/SLsoundspeed  ;
00125 
00126 //  PrintStandardAtmosphereTable();
00127 
00128   return true;
00129 }
00130 
00131 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00132 // Get the actual pressure as modeled at a specified altitude
00133 // These calculations are from equations 33a and 33b in the U.S. Standard Atmosphere
00134 // document referenced in the documentation for this code.
00135 
00136 double FGStandardAtmosphere::GetPressure(double altitude) const
00137 {
00138   unsigned int b=0;
00139   double pressure = 0.0;
00140   double Lmb, Exp, Tmb, deltaH, factor;
00141   double numRows = StdAtmosTemperatureTable->GetNumRows();
00142 
00143   // Iterate through the altitudes to find the current Base Altitude
00144   // in the table. That is, if the current altitude (the argument passed in)
00145   // is 20000 ft, then the base altitude from the table is 0.0. If the
00146   // passed-in altitude is 40000 ft, the base altitude is 36151.6 ft (and
00147   // the index "b" is 2 - the second entry in the table).
00148   double testAlt = (*StdAtmosTemperatureTable)(b+1,0);
00149   while ((altitude >= testAlt) && (b <= numRows-2)) {
00150     b++;
00151     testAlt = (*StdAtmosTemperatureTable)(b+1,0);
00152   }
00153   if (b>0) b--;
00154 
00155   double BaseAlt = (*StdAtmosTemperatureTable)(b+1,0);
00156   Tmb = GetTemperature(BaseAlt);
00157   deltaH = altitude - BaseAlt;
00158 
00159   if (LapseRateVector[b] != 0.00) {
00160     Lmb = LapseRateVector[b];
00161     Exp = Mair/(Rstar*Lmb);
00162     factor = Tmb/(Tmb + Lmb*deltaH);
00163     pressure = PressureBreakpointVector[b]*pow(factor, Exp);
00164   } else {
00165     pressure = PressureBreakpointVector[b]*exp(-Mair*deltaH/(Rstar*Tmb));
00166   }
00167 
00168   return pressure;
00169 }
00170 
00171 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00172 
00173 void FGStandardAtmosphere::SetPressureSL(ePressure unit, double pressure)
00174 {
00175   double press = ConvertToPSF(pressure, unit);
00176 
00177   PressureBreakpointVector[0] = press;
00178   CalculatePressureBreakpoints();
00179 }
00180 
00181 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00182 // Get the modeled temperature at a specified altitude, including any bias or gradient
00183 // effects.
00184 
00185 double FGStandardAtmosphere::GetTemperature(double altitude) const
00186 {
00187   double T = StdAtmosTemperatureTable->GetValue(altitude) + TemperatureBias;
00188   if (altitude <= GradientFadeoutAltitude)
00189     T += TemperatureDeltaGradient * (GradientFadeoutAltitude - altitude);
00190 
00191   return T;
00192 }
00193 
00194 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00195 // Retrieves the standard temperature at a particular altitude.
00196 
00197 double FGStandardAtmosphere::GetStdTemperature(double altitude) const
00198 {
00199   double Lk9 = 0.00658368; // deg R per foot
00200   double Tinf = 1800.0; // Same as 1000 Kelvin
00201   double temp = Tinf;
00202 
00203   if (altitude < 298556.4) {                // 91 km - station 8
00204 
00205     temp = StdAtmosTemperatureTable->GetValue(altitude);
00206 
00207   } else if (altitude < 360892.4) {        // 110 km - station 9
00208 
00209     temp = 473.7429 - 137.38176 * sqrt(1.0 - pow((altitude - 298556.4)/65429.462, 2.0));
00210 
00211   } else if (altitude < 393700.8) {        // 120 km - station 10
00212 
00213     temp = 432 + Lk9 * (altitude - 360892.4);
00214 
00215   } else if (altitude < 3280839.9) {        // 1000 km station 12
00216 
00217     double lambda = 0.00001870364;
00218     double eps = (altitude - 393700.8) * (20855531.5 + 393700.8) / (20855531.5 + altitude);
00219     temp = Tinf - (Tinf - 648.0) * exp(-lambda*eps);
00220 
00221   }
00222 
00223   return temp;
00224 }
00225 
00226 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00227 
00228 double FGStandardAtmosphere::GetStdPressure(double altitude) const
00229 {
00230   double press=0;
00231   if (TemperatureBias == 0.0 && TemperatureDeltaGradient == 0.0 && PressureBreakpointVector[0] == StdSLpressure) {
00232     press = GetPressure(altitude);
00233   } else if (altitude <= 100000.0) {
00234     GetStdPressure100K(altitude);
00235   } else {
00236     // Cannot currently retrieve the standard pressure
00237   }
00238   return press;
00239 }
00240 
00241 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00242 // This function calculates an approximation of the standard atmospheric pressure
00243 // up to an altitude of about 100,000 ft. If the temperature and pressure are not
00244 // altered for local conditions, the GetPressure(h) function should be used,
00245 // as that is valid to a much higher altitude. This function is accurate to within
00246 // a couple of psf up to 100K ft. This polynomial fit was determined using Excel.
00247 
00248 double FGStandardAtmosphere::GetStdPressure100K(double altitude) const
00249 {
00250   // Limit this equation to input altitudes of 100000 ft.
00251   if (altitude > 100000.0) altitude = 100000.0;
00252 
00253   double alt[5];
00254   const double coef[5] = {  2116.217,
00255                           -7.648932746E-2,
00256                            1.0925498604E-6,
00257                           -7.1135726027E-12,
00258                            1.7470331356E-17 };
00259 
00260   alt[0] = 1;
00261   for (int pwr=1; pwr<=4; pwr++) alt[pwr] = alt[pwr-1]*altitude;
00262 
00263   double press = 0.0;
00264   for (int ctr=0; ctr<=4; ctr++) press += coef[ctr]*alt[ctr];
00265   return press;
00266 }
00267 
00268 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00269 // Get the standard density at a specified altitude
00270 
00271 double FGStandardAtmosphere::GetStdDensity(double altitude) const
00272 {
00273   return GetStdPressure(altitude)/(Reng * GetStdTemperature(altitude));
00274 }
00275 
00276 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00277 
00278 void FGStandardAtmosphere::SetTemperature(double t, double h, eTemperature unit)
00279 {
00280   double targetSLtemp = ConvertToRankine(t, unit);
00281 
00282   TemperatureBias = 0.0;
00283   TemperatureBias = targetSLtemp - GetTemperature(h);
00284   CalculatePressureBreakpoints();
00285 }
00286 
00287 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00288 
00289 void FGStandardAtmosphere::SetTemperatureBias(eTemperature unit, double t)
00290 {
00291   if (unit == eCelsius || unit == eKelvin)
00292     t *= 1.80; // If temp delta "t" is given in metric, scale up to English
00293 
00294   TemperatureBias = t;
00295   CalculatePressureBreakpoints();
00296 }
00297 
00298 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00299 // This function calculates a bias based on the supplied temperature for sea
00300 // level. The bias is applied to the entire temperature profile at all altitudes.
00301 // Internally, the Rankine scale is used for calculations, so any temperature
00302 // supplied must be converted to that unit.
00303 
00304 void FGStandardAtmosphere::SetTemperatureSL(double t, eTemperature unit)
00305 {
00306   SetTemperature(t, 0.0, unit);
00307 }
00308 
00309 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00310 // Sets a Sea Level temperature delta that is ramped out by 86 km (282,152 ft).
00311 
00312 void FGStandardAtmosphere::SetSLTemperatureGradedDelta(eTemperature unit, double deltemp)
00313 {
00314   SetTemperatureGradedDelta(deltemp, 0.0, unit);
00315 }
00316 
00317 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00318 // Sets a temperature delta at the supplied altitude that is ramped out by 86 km.
00319 // After this calculation is performed, the lapse rates and pressure breakpoints
00320 // must be recalculated. Since we are calculating a delta here and not an actual
00321 // temperature, we only need to be concerned about a scale factor and not
00322 // the actual temperature itself.
00323 
00324 void FGStandardAtmosphere::SetTemperatureGradedDelta(double deltemp, double h, eTemperature unit)
00325 {
00326   if (unit == eCelsius || unit == eKelvin)
00327     deltemp *= 1.80; // If temp delta "t" is given in metric, scale up to English
00328 
00329   TemperatureDeltaGradient = deltemp/(GradientFadeoutAltitude - h);
00330   CalculateLapseRates();
00331   CalculatePressureBreakpoints();
00332 }
00333 
00334 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00335 
00336   void FGStandardAtmosphere::PrintStandardAtmosphereTable()
00337 {
00338   std::cout << "Altitude (ft)   Temp (F)   Pressure (psf)   Density (sl/ft3)" << std::endl;
00339   std::cout << "-------------   --------   --------------   ----------------" << std::endl;
00340   for (int i=0; i<280000; i+=1000) {
00341     Calculate(i);
00342     std::cout  << std::setw(12) << std::setprecision(2) << i
00343        << "  " << std::setw(9)  << std::setprecision(2) << Temperature - 459.67
00344        << "  " << std::setw(13) << std::setprecision(4) << Pressure
00345        << "  " << std::setw(18) << std::setprecision(8) << Density
00346        << std::endl;
00347   }
00348 
00349   // Re-execute the Run() method to reset the calculated values
00350   Run(false);
00351 }
00352 
00353 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00354 // This function calculates (or recalculates) the lapse rate over an altitude range
00355 // where the "bh" in this case refers to the index of the base height in the 
00356 // StdAtmosTemperatureTable table. This function should be called anytime the 
00357 // temperature table is altered, such as when a gradient is applied across the 
00358 // temperature table for a range of altitudes.
00359 
00360 void FGStandardAtmosphere::CalculateLapseRates()
00361 {
00362   for (unsigned int bh=0; bh<LapseRateVector.size(); bh++)
00363   {
00364     double t0 = (*StdAtmosTemperatureTable)(bh+1,1);
00365     double t1 = (*StdAtmosTemperatureTable)(bh+2,1);
00366     double h0 = (*StdAtmosTemperatureTable)(bh+1,0);
00367     double h1 = (*StdAtmosTemperatureTable)(bh+2,0);
00368     LapseRateVector[bh] = (t1 - t0) / (h1 - h0) + TemperatureDeltaGradient;
00369   }
00370 }
00371 
00372 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00373 
00374 void FGStandardAtmosphere::CalculatePressureBreakpoints()
00375 {
00376   for (unsigned int b=0; b<PressureBreakpointVector.size()-1; b++) {
00377     double BaseTemp = (*StdAtmosTemperatureTable)(b+1,1);
00378     double BaseAlt = (*StdAtmosTemperatureTable)(b+1,0);
00379     double UpperAlt = (*StdAtmosTemperatureTable)(b+2,0);
00380     double deltaH = UpperAlt - BaseAlt;
00381     double Tmb = BaseTemp
00382                  + TemperatureBias 
00383                  + (GradientFadeoutAltitude - BaseAlt)*TemperatureDeltaGradient;
00384     if (LapseRateVector[b] != 0.00) {
00385       double Lmb = LapseRateVector[b];
00386       double Exp = Mair/(Rstar*Lmb);
00387       double factor = Tmb/(Tmb + Lmb*deltaH);
00388       PressureBreakpointVector[b+1] = PressureBreakpointVector[b]*pow(factor, Exp);
00389     } else {
00390       PressureBreakpointVector[b+1] = PressureBreakpointVector[b]*exp(-Mair*deltaH/(Rstar*Tmb));
00391     }
00392   }
00393 }
00394 
00395 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00396 
00397 void FGStandardAtmosphere::ResetSLTemperature()
00398 {
00399   TemperatureBias = TemperatureDeltaGradient = 0.0;
00400   CalculateLapseRates();
00401   CalculatePressureBreakpoints();
00402 }
00403 
00404 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00405 
00406 void FGStandardAtmosphere::ResetSLPressure()
00407 {
00408   PressureBreakpointVector[0] = StdSLpressure; // psf
00409   CalculatePressureBreakpoints();
00410 }
00411 
00412 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00413 
00414 void FGStandardAtmosphere::bind(void)
00415 {
00416   typedef double (FGStandardAtmosphere::*PMFi)(int) const;
00417   typedef void (FGStandardAtmosphere::*PMF)(int, double);
00418   PropertyManager->Tie("atmosphere/delta-T", this, eRankine,
00419                                     (PMFi)&FGStandardAtmosphere::GetTemperatureBias,
00420                                     (PMF)&FGStandardAtmosphere::SetTemperatureBias);
00421   PropertyManager->Tie("atmosphere/SL-graded-delta-T", this, eRankine,
00422                                     (PMFi)&FGStandardAtmosphere::GetTemperatureDeltaGradient,
00423                                     (PMF)&FGStandardAtmosphere::SetSLTemperatureGradedDelta);
00424   PropertyManager->Tie("atmosphere/P-sl-psf", this, ePSF,
00425                                    (PMFi)&FGStandardAtmosphere::GetPressureSL,
00426                                    (PMF)&FGStandardAtmosphere::SetPressureSL);
00427 }
00428 
00429 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00430 //    The bitmasked value choices are as follows:
00431 //    unset: In this case (the default) JSBSim would only print
00432 //       out the normally expected messages, essentially echoing
00433 //       the config files as they are read. If the environment
00434 //       variable is not set, debug_lvl is set to 1 internally
00435 //    0: This requests JSBSim not to output any messages
00436 //       whatsoever.
00437 //    1: This value explicity requests the normal JSBSim
00438 //       startup messages
00439 //    2: This value asks for a message to be printed out when
00440 //       a class is instantiated
00441 //    4: When this value is set, a message is displayed when a
00442 //       FGModel object executes its Run() method
00443 //    8: When this value is set, various runtime state variables
00444 //       are printed out periodically
00445 //    16: When set various parameters are sanity checked and
00446 //       a message is printed out when they go out of bounds
00447 
00448 void FGStandardAtmosphere::Debug(int from)
00449 {
00450   if (debug_lvl <= 0) return;
00451 
00452   if (debug_lvl & 1) { // Standard console startup message output
00453     if (from == 0) { // Constructor
00454     }
00455   }
00456   if (debug_lvl & 2 ) { // Instantiation/Destruction notification
00457     if (from == 0) std::cout << "Instantiated: FGStandardAtmosphere" << std::endl;
00458     if (from == 1) std::cout << "Destroyed:    FGStandardAtmosphere" << std::endl;
00459   }
00460   if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
00461   }
00462   if (debug_lvl & 8 ) { // Runtime state variables
00463   }
00464   if (debug_lvl & 16) { // Sanity checking
00465   }
00466   if (debug_lvl & 128) { // 
00467   }
00468   if (debug_lvl & 64) {
00469     if (from == 0) { // Constructor
00470       std::cout << IdSrc << std::endl;
00471       std::cout << IdHdr << std::endl;
00472     }
00473   }
00474 }
00475 
00476 } // namespace JSBSim