ReFRACtor
altitude_hydrostatic.h
Go to the documentation of this file.
1 #ifndef ALTITUDE_HYDROSTATIC_H
2 #define ALTITUDE_HYDROSTATIC_H
3 #include "altitude.h"
4 #include "pressure.h"
5 #include "temperature.h"
6 #include "double_with_unit.h"
7 #include "linear_interpolate.h"
8 
9 namespace FullPhysics {
10 /****************************************************************/
19 class AltitudeHydrostatic : public Observer<Temperature>,
20  public Observer<Pressure>,
21  public Altitude
22 {
23 public:
26  const DoubleWithUnit& Latitude,
27  const DoubleWithUnit& Surface_height,
28  const int Num_sublayer = 10);
29  virtual ~AltitudeHydrostatic() {};
32 
33 //-----------------------------------------------------------------------
37 //-----------------------------------------------------------------------
38 
39  virtual void notify_update(const Pressure& P)
40  {
41  cache_is_stale = true;
42  }
43 
44 //-----------------------------------------------------------------------
48 //-----------------------------------------------------------------------
49 
50  virtual void notify_update(const Temperature& T)
51  {
52  cache_is_stale = true;
53  }
54 
57  { calc_alt_and_grav();
59  return AutoDerivativeWithUnit<double>((*alt)(p_pas.value), units::km); }
62  { calc_alt_and_grav();
64  return AutoDerivativeWithUnit<double>((*grav)(p_pas.value), "m/s^2");
65  }
66  virtual void print(std::ostream& Os) const { Os << "AltitudeHydrostatic"; }
68  { boost::shared_ptr<Pressure> pnew = p->clone();
69  return clone(pnew, t->clone(pnew)); }
72  const boost::shared_ptr<Temperature>& Temp) const;
73 private:
75  lin_type;
76  mutable bool cache_is_stale;
77  mutable boost::shared_ptr<lin_type> alt;
78  mutable boost::shared_ptr<lin_type> grav;
79  DoubleWithUnit latitude, surface_height;
82  int num_sublayer;
83  void calc_alt_and_grav() const;
85  gravity_calc(double gdlat, AutoDerivative<double> altit) const;
86  void altitude_calc
87  (const ArrayAdWithUnit<double, 1>& press_grid,
88  const ArrayAdWithUnit<double, 1>& temp_grid) const;
89 };
90 
91 }
92 #endif
virtual void notify_update(const Temperature &T)
For performance, we cache some data as we calculate it.
This is a AutoDerivative that also has units associated with it.
The class handles the calculation of the altitude and gravity constants.
Definition: altitude.h:19
virtual AutoDerivativeWithUnit< double > gravity(const AutoDerivativeWithUnit< double > &P) const
Return gravity constant for the given pressure.
AutoDerivativeWithUnit< T > convert(const Unit &R) const
Convert to the given units.
This class takes a set of points and values, and linearly interpolates between those values...
This class handles the calculation of the altitude an gravity constants, automatically updating with ...
virtual AutoDerivativeWithUnit< double > altitude(const AutoDerivativeWithUnit< double > &P) const
Return altitude grid for the given pressure.
const Unit Pa("Pa", N/(m *m))
AltitudeHydrostatic(const boost::shared_ptr< Pressure > &P, const boost::shared_ptr< Temperature > &T, const DoubleWithUnit &Latitude, const DoubleWithUnit &Surface_height, const int Num_sublayer=10)
Constructor.
We frequently have a double with units associated with it.
This is a specialization of LinearInterpolate for AutoDerivative.
This class maintains the pressure portion of the state.
Definition: pressure.h:32
virtual void print(std::ostream &Os) const
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
This class maintains the temperature portion of the state.
Definition: temperature.h:22
virtual void notify_update(const Pressure &P)
For performance, we cache some data as we calculate it.
const Unit km("km", 1e3 *m)
virtual boost::shared_ptr< Altitude > clone() const
Clone an Altitude object.
Simple Mixin to be and Observer of another object of class T.
Definition: observer.h:29

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:08