GCBM
peatlanddecaymodule.h
Go to the documentation of this file.
1 #ifndef MOJA_MODULES_CBM_PLDECAY_H_
2 #define MOJA_MODULES_CBM_PLDECAY_H_
3 
4 #include "moja/modules/cbm/_modules.cbm_exports.h"
6 
10 
12 
13 namespace moja {
14  namespace modules {
15  namespace cbm {
16 
17  class CBM_API PeatlandDecayModule : public CBMModuleBase {
18  public:
20  virtual ~PeatlandDecayModule() = default;
21 
22  void configure(const DynamicObject& config) override;
23  void subscribe(NotificationCenter& notificationCenter) override;
24 
25  void doLocalDomainInit() override;
26  void doTimingInit() override;
27  void doTimingStep() override;
28 
29  private:
30  const flint::IPool* _woodyFoliageDead{ nullptr };
31  const flint::IPool* _woodyFineDead{ nullptr };
32  const flint::IPool* _woodyCoarseDead{ nullptr };
33  const flint::IPool* _woodyRootsDead{ nullptr };
34  const flint::IPool* _sedgeFoliageDead{ nullptr };
35  const flint::IPool* _sedgeRootsDead{ nullptr };
36  const flint::IPool* _feathermossDead{ nullptr };
37  const flint::IPool* _acrotelm_o{ nullptr };
38  const flint::IPool* _catotelm_a{ nullptr };
39  const flint::IPool* _acrotelm_a{ nullptr };
40  const flint::IPool* _catotelm_o{ nullptr };
41  const flint::IPool* _co2{ nullptr };
42  const flint::IPool* _ch4{ nullptr };
43  const flint::IPool* _tempCarbon{ nullptr };
44 
45  flint::IVariable* _spinupMossOnly{ nullptr };
46  flint::IVariable* _appliedAnnualWTD{ nullptr };
47 
48  double _meanAnnualTemperature{ 0 };
49  int _peatlandId{ -1 };
50  bool _runPeatland{ false };
51 
55  std::shared_ptr<PeatlandDecayParameters> decayParas{ nullptr };
56 
60  std::shared_ptr<PeatlandTurnoverParameters> turnoverParas{ nullptr };
61 
65  std::shared_ptr<PeatlandWTDBaseFCH4Parameters> wtdFch4Paras{ nullptr };
66 
67  DynamicObject baseWTDParameters;
68 
69  void doDeadPoolTurnover(double turnoverRate);
70  void doPeatlandDecay(double turnoverRate, double awtd);
71  void doPeatlandNewCH4ModelDecay(double turnoverRate);
72  void allocateCh4CO2(double awtd);
73  void updateParameters();
74 
75  double getCurrentYearWaterTable();
76  double getToCO2Rate(double rate, double turnoverRate, double awtd);
77  double getToCH4Rate(double rate, double turnoverRate, double awtd);
78  double computeWaterTableDepth(double dc, int peatlandID);
79  };
80  }
81  }
82 } // namespace moja::modules::cbm
83 
84 #endif // MOJA_MODULES_CBM_PLDECAY_H_
moja::modules::cbm
Definition: ageclasshelper.cpp:12
timeseries.h
moja::modules::cbm::CBMModuleBase
Definition: cbmmodulebase.h:22
moja::modules::cbm::PeatlandDecayModule::baseWTDParameters
DynamicObject baseWTDParameters
Definition: peatlanddecaymodule.h:67
peatlandwtdbasefch4parameters.h
peatlanddecayparameters.h
moja::modules::cbm::PeatlandDecayModule
Definition: peatlanddecaymodule.h:17
moja::modules::cbm::PeatlandDecayModule::PeatlandDecayModule
PeatlandDecayModule()
Definition: peatlanddecaymodule.h:19
peatlandturnoverparameters.h
moja
Definition: ageclasshelper.cpp:10
cbmmodulebase.h