1 #ifndef ABSORBER_VMR_IMP_BASE_H 2 #define ABSORBER_VMR_IMP_BASE_H 5 #include <boost/function.hpp> 20 virtual std::string
gas_name()
const {
return gas_name_;}
23 { fill_cache();
return vmr(P); }
36 virtual void print(std::ostream& Os)
const { Os <<
desc(); }
42 virtual std::string
desc()
const {
return "AbsorberVmrImpBase"; }
76 void init(
const std::string Gas_name,
77 const blitz::Array<double, 1>& Coeff,
78 const blitz::Array<bool, 1>& Used_flag,
80 bool Mark_according_to_press =
true,
83 Mark_according_to_press,
101 const blitz::Array<double, 1>& Coeff,
102 const blitz::Array<bool, 1>& Used_flag,
104 bool Mark_according_to_press =
true,
107 Mark_according_to_press, Pdep_start),
108 cache_stale(true), gas_name_(Gas_name) { }
110 void fill_cache()
const 116 std::string gas_name_;
AbsorberVmrImpBase(const std::string &Gas_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.
virtual void calc_vmr() const =0
Derived classes should provide a function to fill in vmr when this is called.
ArrayAd< double, 1 > sv_full
The last full state vector we have been updated with, saved for reference by derived class...
void init(const std::string Gas_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.
As a design principle, we have each base class with the absolutely minimum interface needed for use f...
int sub_vector_size() const
Length of the sub set of the state vector used by this object.
virtual ~AbsorberVmrImpBase()
virtual AutoDerivative< double > volume_mixing_ratio(const AutoDerivative< double > &P) const
This returns the volume mixing ratio at the given pressure level.
virtual blitz::Array< bool, 1 > state_used() const
Indicate what portion of the state vector is used to calculate the VMR.
virtual boost::shared_ptr< AbsorberVmr > clone() const =0
Clone a AbsorberVmr object.
int state_vector_start_index() const
Starting index of state vector used by this object.
This gives the Gas Absorber Volumn mixing ratio for a single gas.
bool cache_stale
If this is true, the recalculate the vmr the next time we need it.
virtual std::string desc() const
Description of object, to be printed to stream.
AbsorberVmrImpBase()
Default constructor, derived class should call init if they use this constructor. ...
virtual void print(std::ostream &Os) const
Print to stream.
It is common to have a class that is an Observable with a set of coefficients, a subset of which are ...
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)
virtual void update_sub_state_hook()
Hook for anything a derived class needs to do after coefficient is updated and before notify_update...
boost::function< AutoDerivative< double >AutoDerivative< double >)> vmr
The cached volumn mixing ration.
virtual std::string gas_name() const
This indicates the name of this particular Absorber.