GCBM
mossgrowthmodule.h
Go to the documentation of this file.
1 #ifndef MOJA_MODULES_CBM_MOSSGROWTH_H_
2 #define MOJA_MODULES_CBM_MOSSGROWTH_H_
3 
4 #include "moja/modules/cbm/_modules.cbm_exports.h"
7 
8 namespace moja {
9  namespace modules {
10  namespace cbm {
11 
12  class CBM_API MossGrowthModule : public CBMModuleBase {
13  public:
14  MossGrowthModule(std::shared_ptr<StandGrowthCurveFactory> gcFactory)
15  : _gcFactory(gcFactory) {};
16 
17  virtual ~MossGrowthModule() = default;
18 
19  void configure(const DynamicObject& config) override;
20  void subscribe(NotificationCenter& notificationCenter) override;
21 
22  flint::ModuleTypes moduleType() override { return flint::ModuleTypes::Model; };
23 
24  void doLocalDomainInit() override;
25  void doTimingInit() override;
26  void doTimingStep() override;
27 
28  private:
29  std::shared_ptr<StandGrowthCurveFactory> _gcFactory;
30 
31  flint::IVariable* _mossParameters = nullptr;;
32  const flint::IPool* _atmosphere = nullptr;;
33  const flint::IPool* _featherMossLive = nullptr;;
34  const flint::IPool* _sphagnumMossLive = nullptr;;
35  flint::IVariable* _regenDelay = nullptr;
36  flint::IVariable* _spinupMossOnly = nullptr;
37  flint::IVariable* _age = nullptr;
38 
39  bool runMoss{ false };
40  Int64 currentStandGCId{ -1 };
41 
42  //moss growth related parameters
43 
47  double a{ 0.0 }; //parameter for F1
48 
52  double b{ 0.0 }; //parameter for F1
53 
57  double c{ 0.0 }; //parameter for F2
58 
62  double d{ 0.0 }; //parameter for F2
63 
67  double e{ 0.0 }; //parameter for F3
68 
72  double f{ 0.0 }; //parameter for F3
73 
77  double g{ 0.0 }; //parameter for F4
78 
82  double h{ 0.0 }; //parameter for F4
83 
87  double i{ 0.0 }; //parameter for F5
88 
92  double j{ 0.0 }; //parameter for F5
93 
97  double l{ 0.0 }; //parameter for F5
98 
99  //Canopy openess, O(t) as a function of merchant volume : 10^(((a)*(Log(V(t))) + b)
100  double F1(double a, double b, double volume);
101 
102  //Feather moss ground cover, GCFm(t) = c*O(t) + d
103  double F2(double c, double d, int age, double openNess);
104 
105  //Sphagnum ground cover, GCSp(t) = e*O(t) + f
106  double F3(double e, double f, int age, double openNess);
107 
108  //Feather moss NPP, NPPFm = (g*O(t))^h
109  double F4(double g, double h, double openNess);
110 
111  //Sphagnum NPP, NPPSp = i*(O(t)^2) + j*O(t) + l
112  double F5(double i, double j, double l, double openNess);
113 
114  void doMossGrowth(int mossAge, double standMerchVolume);
115  };
116  }
117  }
118 }
119 #endif
moja::modules::cbm::MossGrowthModule::MossGrowthModule
MossGrowthModule(std::shared_ptr< StandGrowthCurveFactory > gcFactory)
Definition: mossgrowthmodule.h:14
moja::modules::cbm
Definition: ageclasshelper.cpp:12
moja::modules::cbm::MossGrowthModule::_gcFactory
std::shared_ptr< StandGrowthCurveFactory > _gcFactory
Definition: mossgrowthmodule.h:29
moja::modules::cbm::CBMModuleBase
Definition: cbmmodulebase.h:22
standgrowthcurvefactory.h
moja
Definition: ageclasshelper.cpp:10
cbmmodulebase.h
moja::modules::cbm::MossGrowthModule::moduleType
flint::ModuleTypes moduleType() override
Definition: mossgrowthmodule.h:22
moja::modules::cbm::MossGrowthModule
Definition: mossgrowthmodule.h:12