1 #ifndef ABSORBER_ABSCO_H 2 #define ABSORBER_ABSCO_H 47 virtual std::string
gas_name(
int Species_index)
const 49 return vmr[Species_index]->gas_name();
60 cache_tau_gas_stale =
true;
65 cache_tau_gas_stale =
true;
70 cache_tau_gas_stale =
true;
75 cache_tau_gas_stale =
true;
80 virtual blitz::Array<double, 2>
98 virtual void print(std::ostream& Os)
const;
108 (
const std::string& Gas_name)
const;
116 { fill_tau_gas_cache();
return psub;}
126 (
double wn,
double p,
int Spec_index,
int Species_index)
const;
128 int Species_index,
int 131 double eps_rel = 1e-3)
const;
132 blitz::Array<double, 2>
135 double eps_rel = 1e-3)
const;
140 std::vector<boost::shared_ptr<Altitude> > alt;
141 std::vector<boost::shared_ptr<AbsorberVmr> > vmr;
142 std::vector<boost::shared_ptr<GasAbsorption> > gas_absorption;
163 mutable bool cache_tau_gas_stale;
164 mutable std::vector<boost::shared_ptr<AbscoInterpolator> > absco_interp;
172 mutable std::vector<blitz::Range> layer_range;
175 mutable std::vector<ArrayWithUnit<double, 1> > weight;
189 mutable std::vector<std::vector<int> > pressure_nonzero_column;
190 mutable std::vector<blitz::Array<double, 1> > p1_grad;
191 mutable std::vector<blitz::Array<double, 1> > p2_grad;
194 mutable std::vector<std::vector<int> > integrand_nonzero_column;
195 mutable std::vector<blitz::Array<double, 4> > integrand_jac;
198 mutable std::vector<int> absco_nonzero_column;
205 blitz::Array<double, 2>
206 tau_gas_nder(
double wn,
int spec_index)
const;
208 tau_gas_der(
double wn,
int spec_index)
const;
209 void fill_tau_gas_cache()
const;
210 void create_sublayer()
const;
virtual std::string gas_name(int Species_index) const
Name of gases, in the order that optical_depth_each_layer returns them.
#define range_check(V, Min, Max)
Range check.
This class maintains the absorber portion of the state.
ArrayAd< double, 1 > pressure_weighting_function_grid() const
This is the pressure weighting function by grid level.
This is a AutoDerivative that also has units associated with it.
The class handles the calculation of the altitude and gravity constants.
virtual boost::shared_ptr< Absorber > clone() const
Clone an Absorber object.
ArrayAdWithUnit< double, 1 > h2o_vmr_sublayer() const
Return the H2O volume mixing ratio we use for each sublayer.
double integrand(double wn, double p, int Spec_index, int Species_index) const
Integrand used in the absorption calculation.
AbsorberAbsco(const std::vector< boost::shared_ptr< AbsorberVmr > > Vmr, const boost::shared_ptr< Pressure > &Press, const boost::shared_ptr< Temperature > &Temp, const std::vector< boost::shared_ptr< Altitude > > &Alt, const std::vector< boost::shared_ptr< GasAbsorption > > &Gas_absorption, const boost::shared_ptr< Constant > &C, int Nsub=10)
Create an absorber.
ArrayAdWithUnit< double, 1 > dry_air_molecular_density_layer() const
This is a helper function to compute the common part of the dry air mass and wet air mass routines...
const Unit dimensionless("dimensionless", 1.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
virtual void print(std::ostream &Os) const
virtual boost::shared_ptr< AbsorberVmr > absorber_vmr(const std::string &Gas_name) const
Returns the AbsorberVmr object for a given species index.
virtual blitz::Array< double, 2 > optical_depth_each_layer_nder(double wn, int spec_index) const
virtual int number_layer() const
AutoDerivative< double > average_vmr(const std::string &Gas_name) const
Returns the simple average volume mixing ratio for a gas.
ArrayAdWithUnit< double, 1 > wet_air_column_thickness_layer() const
This is the wet air column thickness by layer.
AutoDerivativeWithUnit< double > integrand_independent_wn(int Spec_index, int Species_index, const DoubleWithUnit &P) const
This is the portion of the optical depth calculation integrand that is independent on the wave number...
void notify_update_do(const Absorber &Self)
Function to call to notify Observers of a state change.
const Unit A("A", 1.0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0)
ArrayAd< double, 1 > pressure_weighting_function_layer() const
This is the pressure weighting function by layer.
virtual void notify_update(const Pressure &P)
For performance, we cache some data as we calculate it.
AutoDerivative< double > total_number_density(const std::string &Gas_name) const
ArrayWithUnit< double, 1 > pressure_sublayer() const
Return the pressure we use for each sublayer.
virtual ArrayAd< double, 2 > optical_depth_each_layer(double wn, int spec_index) const
This gives the optical depth for each layer, for the given wave number.
We frequently have a double with units associated with it.
double optical_depth_each_layer_direct_integrate(double wn, int Spec_index, int Species_index, int Layer_index, double eps_abs=0, double eps_rel=1e-3) const
Find the optical depth for a layer by directly integrating the integrand function.
This handles informing a set of interested objects when the state vector has updated.
DoubleWithUnit convert(const Unit &R) const
Convert to the given units.
virtual void notify_update(const Temperature &T)
Called when the Observed object is updated.
ArrayAdWithUnit< double, 1 > vmr_sublayer(const std::string &Gas_name) const
Return the volume mixing ratio we use for each sublayer.
This gives the Gas Absorber Volumn mixing ratio for a single gas.
This class maintains the pressure portion of the state.
Libraries such as boost::units allow unit handling where we know the units at compile time...
This is a thin wrapper around the GSL integration function.
virtual int number_spectrometer() const
Contains classes to abstract away details in various Spurr Radiative Transfer software.
ArrayAdWithUnit< double, 1 > specific_humidity_layer() const
Returns specific humidity by layer.
ArrayAdWithUnit< double, 1 > gravity_sublayer(int Spec_index) const
Return the gravity we use for each sublayer.
This class maintains the absorber portion of the state.
This class maintains the temperature portion of the state.
virtual void notify_update(const StateVector &Sv)
Called when the Observed object is updated.
virtual void notify_update(const AbsorberVmr &A)
Called when the Observed object is updated.
ArrayAdWithUnit< double, 1 > gas_column_thickness_layer(const std::string &Gas_name) const
This is the column thickness of a gas by layer.
ArrayAdWithUnit< double, 1 > temperature_sublayer() const
Return the temperature we use for each sublayer.
virtual void notify_update(const Altitude &A)
Called when the Observed object is updated.
virtual AutoDerivative< double > xgas(const std::string &Gas_name) const
This calculates the gas column, e.g., XCO2.
AutoDerivativeWithUnit< double > gas_total_column_thickness(const std::string &Gas_name) const
This is the total column thickness of a gas.
virtual int number_species() const
Number of species.
ArrayAdWithUnit< double, 1 > dry_air_column_thickness_layer() const
This is the dry air column thickness by layer.
const Pressure & pressure() const
Simple Mixin to be and Observer of another object of class T.
boost::shared_ptr< GasAbsorption > gas_absorption_ptr(const std::string &Gas_name) const
Return GasAbsorption as a pointer.