1 #ifndef AEROSOL_EXTINCTION_IMP_BASE_H 2 #define AEROSOL_EXTINCTION_IMP_BASE_H 21 { fill_cache();
return aext; }
24 return (
aext(i) +
aext(i + 1)) / 2; }
43 virtual void print(std::ostream& Os)
const { Os <<
desc(); }
49 virtual std::string
desc()
const {
return "AerosolExtinctionImpBase"; }
67 blitz::Array<double, 1> uncert(
coefficient().rows());
99 for(
int layer_idx = 0; layer_idx <
pressure()->number_layer(); layer_idx++) {
101 tot_aod += (delta_press * (
aext(layer_idx) +
aext(layer_idx + 1) ));
110 void init(
const std::string Aerosol_name,
111 const blitz::Array<double, 1>& Coeff,
112 const blitz::Array<bool, 1>& Used_flag,
114 bool Mark_according_to_press =
true,
117 Mark_according_to_press,
119 aerosol_name_ = Aerosol_name;
135 const blitz::Array<double, 1>& Coeff,
136 const blitz::Array<bool, 1>& Used_flag,
138 bool Mark_according_to_press =
true,
141 Mark_according_to_press, Pdep_start),
142 cache_stale(true), aerosol_name_(Aerosol_name) { }
144 void fill_cache()
const 152 std::string aerosol_name_;
virtual ArrayAd< double, 1 > aerosol_extinction() const
void resize_number_variable(int nvar)
#define range_check(V, Min, Max)
Range check.
AerosolExtinctionImpBase(const std::string &Aerosol_name, const blitz::Array< double, 1 > &Coeff, const blitz::Array< bool, 1 > &Used_flag, const boost::shared_ptr< Pressure > &Press, bool Mark_according_to_press=true, int Pdep_start=0)
Constructor that sets the coefficient() and used_flag() values.
blitz::Array< double, 1 > aerosol_parameter() const
Returns the value of the coefficients used to generate the aerosol extinction.
virtual std::string model_short_name() const =0
A short name representing the type of extinction model being implemented.
virtual boost::shared_ptr< AerosolExtinction > clone() const =0
Clone a AerosolExtinction object.
void init(const std::string Aerosol_name, const blitz::Array< double, 1 > &Coeff, const blitz::Array< bool, 1 > &Used_flag, const boost::shared_ptr< Pressure > &Press, bool Mark_according_to_press=true, int Pdep_start=0)
Initialize object.
virtual void update_sub_state_hook()
Hook for anything a derived class needs to do after coefficient is updated and before notify_update...
blitz::Array< double, 2 > sv_cov_sub
The subset of cov_full that is "owned" by this class, what was passed through update_sub_state.
ArrayAd< double, 1 > aext
The cached aerosol extinction for each level.
virtual void print(std::ostream &Os) const
Print to stream.
virtual std::string desc() const
Description of object, to be printed to stream.
const boost::shared_ptr< Pressure > & pressure() const
bool cache_stale
If this is true, the recalculate the vmr the next time we need it.
const blitz::Array< T, D > & value() const
int number_variable() const
AerosolExtinctionImpBase()
Default constructor, derived class should call init if they use this constructor. ...
const ArrayAd< double, 1 > & coefficient() const
blitz::Array< double, 1 > aerosol_parameter_uncertainty() const
Returns the uncertainty of the aerosol type coefficients.
virtual AutoDerivative< double > extinction_for_layer(int i) const
Extinction for given layer.
It is common to have a class that is an Observable with a set of coefficients, a subset of which are ...
virtual std::string aerosol_name() const
Name of aerosol.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
void init(const blitz::Array< double, 1 > &Coeff, const blitz::Array< bool, 1 > &Used_flag, const boost::shared_ptr< Pressure > &Press=boost::shared_ptr< Pressure >(), bool Mark_according_to_press=true, int Pdep_start=0)
As a design principle, we have each base class with the absolutely minimum interface needed for use f...
ArrayAd< double, 1 > coeff
Coefficients.
virtual void calc_aerosol_extinction() const =0
Derived classes should provide a function to fill in vmr when this is called.
virtual ~AerosolExtinctionImpBase()
virtual AutoDerivative< double > total_aod() const
Total aerosol optical depth of the extinction values in aext.
This class maps the state vector to the aerosol extinction on each level.