GCBM
mossdecaymodule.h
Go to the documentation of this file.
1 #ifndef MOJA_MODULES_CBM_MOSSDECAY_H_
2 #define MOJA_MODULES_CBM_MOSSDECAY_H_
3 
4 #include "moja/modules/cbm/_modules.cbm_exports.h"
7 
8 namespace moja {
9  namespace modules {
10  namespace cbm {
11 
15  class CBM_API MossDecayModule : public CBMModuleBase {
16  public:
17  MossDecayModule(std::shared_ptr<StandGrowthCurveFactory> gcFactory)
18  : _gcFactory(gcFactory) {};
19 
20  virtual ~MossDecayModule() = default;
21 
22  void configure(const DynamicObject& config) override;
23  void subscribe(NotificationCenter& notificationCenter) override;
24 
25  flint::ModuleTypes moduleType() override { return flint::ModuleTypes::Model; };
26 
27  void doLocalDomainInit() override;
28  void doTimingInit() override;
29  void doTimingStep() override;
30 
31  private:
32  std::shared_ptr<StandGrowthCurveFactory> _gcFactory;
33 
34  flint::IVariable* _mossParameters;
35 
36  const flint::IPool* _featherMossFast = nullptr;;
37  const flint::IPool* _sphagnumMossFast = nullptr;;
38  const flint::IPool* _featherMossSlow = nullptr;;
39  const flint::IPool* _sphagnumMossSlow = nullptr;;
40  const flint::IPool* _CO2 = nullptr;;
41  bool runMoss{ false };
42 
43  double kff; //base decay rate feather moss fast pool
44  double ksf; //base decay rate sphagnum fast pool
45  double kfs; //base decay rate feather moss slow pool
46  double kss; //sphagnum slow pool base decay rate
47  double q10; //Q10 temperature coefficient
48  double tref; //reference temperature
49  double akff; //applied feather moss fast pool applied decay rate
50  double akfs; //applied feather moss slow pool applied decay rate
51  double aksf; //applied sphagnum fast pool applied decay rate
52  double akss; //applied sphagnum slow pool applied decay rate
53  double m; //parameter for F6
54  double n; //parameter for F6
55 
56  double fastToSlowTurnoverRate; //fast moss pool to slow moss pool turnover rate
57  double fastToAirDecayRate; //fast moss pool to CO2 air pool rate
58 
61 
62  //Sphagnum slow pool base decay rate, kss = m*ln(maxVolume) + n
63  double F6(double m, double n, double maxVolume);
64 
65  //Applied decay rate to all moss pools: kff, kfs, ksf, kss
66  //kff - feather fast decay rate
67  //kfs - feather slow decay rate
68  //ksf - sphagnum fast decay rate
69  //kss - sphagnum slow decay rate
70  double F7(double baseDecayRate, double meanAnnualTemperature, double q10);
71 
72  void updateMossAppliedDecayParameters(double standMaximumVolume, double meanAnnualTemperature);
73 
74  void doMossFastPoolDecay();
75 
76  void doMossSlowPoolDecay();
77  };
78 
79  }
80  }
81 }
82 #endif
moja::modules::cbm::MossDecayModule
Parameters for moss related computing.
Definition: mossdecaymodule.h:15
moja::modules::cbm
Definition: ageclasshelper.cpp:12
moja::modules::cbm::MossDecayModule::akss
double akss
Definition: mossdecaymodule.h:52
moja::modules::cbm::MossDecayModule::kss
double kss
Definition: mossdecaymodule.h:46
moja::modules::cbm::MossDecayModule::meanAnnualTemperature
double meanAnnualTemperature
Definition: mossdecaymodule.h:59
moja::modules::cbm::MossDecayModule::fastToSlowTurnoverRate
double fastToSlowTurnoverRate
Definition: mossdecaymodule.h:56
moja::modules::cbm::CBMModuleBase
Definition: cbmmodulebase.h:22
moja::modules::cbm::MossDecayModule::ksf
double ksf
Definition: mossdecaymodule.h:44
moja::modules::cbm::MossDecayModule::q10
double q10
Definition: mossdecaymodule.h:47
moja::modules::cbm::MossDecayModule::kff
double kff
Definition: mossdecaymodule.h:43
moja::modules::cbm::MossDecayModule::MossDecayModule
MossDecayModule(std::shared_ptr< StandGrowthCurveFactory > gcFactory)
Definition: mossdecaymodule.h:17
moja::modules::cbm::MossDecayModule::n
double n
Definition: mossdecaymodule.h:54
moja::modules::cbm::MossDecayModule::currentStandGCId
Int64 currentStandGCId
Definition: mossdecaymodule.h:60
moja::modules::cbm::MossDecayModule::tref
double tref
Definition: mossdecaymodule.h:48
moja::modules::cbm::MossDecayModule::aksf
double aksf
Definition: mossdecaymodule.h:51
moja::modules::cbm::MossDecayModule::_mossParameters
flint::IVariable * _mossParameters
Definition: mossdecaymodule.h:34
moja::modules::cbm::MossDecayModule::m
double m
Definition: mossdecaymodule.h:53
moja::modules::cbm::MossDecayModule::moduleType
flint::ModuleTypes moduleType() override
Definition: mossdecaymodule.h:25
moja::modules::cbm::MossDecayModule::_gcFactory
std::shared_ptr< StandGrowthCurveFactory > _gcFactory
Definition: mossdecaymodule.h:32
moja::modules::cbm::MossDecayModule::akff
double akff
Definition: mossdecaymodule.h:49
moja::modules::cbm::MossDecayModule::kfs
double kfs
Definition: mossdecaymodule.h:45
moja::modules::cbm::MossDecayModule::akfs
double akfs
Definition: mossdecaymodule.h:50
standgrowthcurvefactory.h
moja::modules::cbm::MossDecayModule::fastToAirDecayRate
double fastToAirDecayRate
Definition: mossdecaymodule.h:57
moja
Definition: ageclasshelper.cpp:10
cbmmodulebase.h