GCBM
peatlandspinupnext.h
Go to the documentation of this file.
1 #ifndef MOJA_MODULES_CBM_PLSPINUPNEXT_H_
2 #define MOJA_MODULES_CBM_PLSPINUPNEXT_H_
3 
4 #include "moja/modules/cbm/_modules.cbm_exports.h"
6 
12 
13 namespace moja {
14 namespace modules {
15 namespace cbm {
16 
17  /*
18  After regular spinup procedure, this class is called to quicly build up the peat DOM pools.
19  This class is implemented based on R-code
20  */
21  class CBM_API PeatlandSpinupNext : public CBMModuleBase {
22  public:
24  virtual ~PeatlandSpinupNext() = default;
25 
26  void configure(const DynamicObject& config) override;
27  void subscribe(NotificationCenter& notificationCenter) override;
28 
29  void doLocalDomainInit() override;
30  //void doTimingInit() override;
31  void doPrePostDisturbanceEvent() override;
32 
33  private:
34  const flint::IPool* _softwoodMerch;
35  const flint::IPool* _softwoodOther;
36  const flint::IPool* _softwoodFoliage;
37  const flint::IPool* _softwoodCoarseRoots;
38  const flint::IPool* _softwoodFineRoots;
39  const flint::IPool* _softwoodStemSnag;
40  const flint::IPool* _softwoodBranchSnag;
41 
42  const flint::IPool* _hardwoodMerch;
43  const flint::IPool* _hardwoodOther;
44  const flint::IPool* _hardwoodFoliage;
45  const flint::IPool* _hardwoodCoarseRoots;
46  const flint::IPool* _hardwoodFineRoots;
47  const flint::IPool* _hardwoodStemSnag;
48  const flint::IPool* _hardwoodBranchSnag;
49 
50  const flint::IPool* _softwoodStem;
51  const flint::IPool* _hardwoodStem;
52 
53  const flint::IPool* _woodyFoliageLive;
54  const flint::IPool* _woodyStemsBranchesLive;
55  const flint::IPool* _woodyRootsLive;
56  const flint::IPool* _sedgeFoliageLive;
57  const flint::IPool* _sedgeRootsLive;
58  const flint::IPool* _featherMossLive;
59  const flint::IPool* _sphagnumMossLive;
60 
61  const flint::IPool* _woodyFoliageDead;
62  const flint::IPool* _woodyFineDead;
63  const flint::IPool* _woodyCoarseDead;
64  const flint::IPool* _woodyRootsDead;
65  const flint::IPool* _sedgeFoliageDead;
66  const flint::IPool* _sedgeRootsDead;
67  const flint::IPool* _feathermossDead;
68  const flint::IPool* _acrotelm_o;
69  const flint::IPool* _catotelm_a;
70  const flint::IPool* _acrotelm_a;
71  const flint::IPool* _catotelm_o;
72 
73  const flint::IPool* _atmosphere;
74 
75  const flint::IVariable* _turnoverRates;
76 
77  double _softwoodFoliageFallRate{ 0 };
78  double _hardwoodFoliageFallRate{ 0 };
79  double _stemAnnualTurnOverRate{ 0 };
80  double _stemSnagTurnoverRate{ 0 };
81  double _softwoodBranchTurnOverRate{ 0 };
82  double _hardwoodBranchTurnOverRate{ 0 };
83  double _coarseRootTurnProp{ 0 };
84  double _fineRootTurnProp{ 0 };
85  double _otherToBranchSnagSplit{ 0 };
86  double _branchSnagTurnoverRate{ 0 };
87 
88 
89  int smallTreeOn{ 0 };
90  double smallTreeFoliageRemoval{ 0 };
91  double smallTreeFineRootRemoval{ 0 };
92  double smallTreeCoarseRootRemoval{ 0 };
93  double smallTreeOtherRemovalToWFD{ 0 };
94  double smallTreeBranchSnagRemoval{ 0 };
95  double smallTreeStemSnagRemoval{ 0 };
96 
97  int largeTreeOn{ 0 };
98  double largeTreeFoliageRemoval{ 0 };
99  double largeTreeFineRootRemoval{ 0 };
100  double largeTreeCoarseRootRemoval{ 0 };
101  double largeTreeOtherRemovalToWFD{ 0 };
102  double largeTreeBranchSnagRemoval{ 0 };
103  double largeTreeStemSnagRemoval{ 0 };
104 
105  double meanAnnualTemperature{ 0 };
106  double f_r{ 1 };
107  double f_fr{ 1 };
108 
109  // decay parameters associated to this peatland unit
110  std::shared_ptr<PeatlandDecayParameters> decayParas;
111 
112  // turnover parameters associated to this peatland unit
113  std::shared_ptr<PeatlandTurnoverParameters> turnoverParas;
114 
115  // the growth parameters associated to this peatland unit
116  std::shared_ptr<PeatlandGrowthParameters> growthParas;
117 
118  // the peatland fire parameter
119  std::shared_ptr<PeatlandFireParameters> fireParas;
120 
121  void getTreeTurnoverRate(Peatlands peatlandId);
122 
123  void getAndUpdateParameter();
124 
125  void getNonOpenPeatlandRemovals(Peatlands peatlandId);
126 
127  void populatePeatlandDeadPoolsV1();
128 
129  void populatePeatlandDeadPoolsV2();
130 
131  void populatePeatlandDeadPoolsV3();
132 
133  void getCurrentDeadPoolValues();
134 
135  void resetSlowPools();
136 
137  inline double modifyQ10(double baseQ10Para) {
138  return (pow(baseQ10Para, 0.1 * (meanAnnualTemperature - 10)));
139  };
140  };
141 
142 }}} // namespace moja::modules::cbm
143 
144 #endif // MOJA_MODULES_CBM_PLDECAY_H_
145 
moja::modules::cbm::PeatlandSpinupNext::_softwoodMerch
const flint::IPool * _softwoodMerch
Definition: peatlandspinupnext.h:34
moja::modules::cbm::PeatlandSpinupNext::_atmosphere
const flint::IPool * _atmosphere
Definition: peatlandspinupnext.h:73
moja::modules::cbm::PeatlandSpinupNext::_catotelm_a
const flint::IPool * _catotelm_a
Definition: peatlandspinupnext.h:69
moja::modules::cbm::PeatlandSpinupNext::_hardwoodCoarseRoots
const flint::IPool * _hardwoodCoarseRoots
Definition: peatlandspinupnext.h:45
moja::modules::cbm
Definition: ageclasshelper.cpp:12
moja::modules::cbm::Peatlands
Peatlands
Definition: peatlands.h:7
moja::modules::cbm::PeatlandSpinupNext::PeatlandSpinupNext
PeatlandSpinupNext()
Definition: peatlandspinupnext.h:23
moja::modules::cbm::PeatlandSpinupNext::_sedgeRootsLive
const flint::IPool * _sedgeRootsLive
Definition: peatlandspinupnext.h:57
moja::modules::cbm::PeatlandSpinupNext::_softwoodBranchSnag
const flint::IPool * _softwoodBranchSnag
Definition: peatlandspinupnext.h:40
moja::modules::cbm::PeatlandSpinupNext::_hardwoodMerch
const flint::IPool * _hardwoodMerch
Definition: peatlandspinupnext.h:42
peatlandgrowthparameters.h
moja::modules::cbm::PeatlandSpinupNext::_sedgeFoliageDead
const flint::IPool * _sedgeFoliageDead
Definition: peatlandspinupnext.h:65
moja::modules::cbm::CBMModuleBase
Definition: cbmmodulebase.h:22
moja::modules::cbm::PeatlandSpinupNext::_acrotelm_o
const flint::IPool * _acrotelm_o
Definition: peatlandspinupnext.h:68
moja::modules::cbm::PeatlandSpinupNext::_woodyRootsLive
const flint::IPool * _woodyRootsLive
Definition: peatlandspinupnext.h:55
peatlands.h
moja::modules::cbm::PeatlandSpinupNext::_hardwoodStem
const flint::IPool * _hardwoodStem
Definition: peatlandspinupnext.h:51
moja::modules::cbm::PeatlandSpinupNext::_featherMossLive
const flint::IPool * _featherMossLive
Definition: peatlandspinupnext.h:58
moja::modules::cbm::PeatlandSpinupNext::_woodyCoarseDead
const flint::IPool * _woodyCoarseDead
Definition: peatlandspinupnext.h:63
moja::modules::cbm::PeatlandSpinupNext::_softwoodFoliage
const flint::IPool * _softwoodFoliage
Definition: peatlandspinupnext.h:36
moja::modules::cbm::PeatlandSpinupNext::_woodyFoliageLive
const flint::IPool * _woodyFoliageLive
Definition: peatlandspinupnext.h:53
moja::modules::cbm::PeatlandSpinupNext::_softwoodCoarseRoots
const flint::IPool * _softwoodCoarseRoots
Definition: peatlandspinupnext.h:37
moja::modules::cbm::PeatlandSpinupNext::_acrotelm_a
const flint::IPool * _acrotelm_a
Definition: peatlandspinupnext.h:70
moja::modules::cbm::PeatlandSpinupNext::_softwoodOther
const flint::IPool * _softwoodOther
Definition: peatlandspinupnext.h:35
moja::modules::cbm::PeatlandSpinupNext::_sedgeFoliageLive
const flint::IPool * _sedgeFoliageLive
Definition: peatlandspinupnext.h:56
moja::modules::cbm::PeatlandSpinupNext::_softwoodFineRoots
const flint::IPool * _softwoodFineRoots
Definition: peatlandspinupnext.h:38
moja::modules::cbm::PeatlandSpinupNext::growthParas
std::shared_ptr< PeatlandGrowthParameters > growthParas
Definition: peatlandspinupnext.h:116
moja::modules::cbm::PeatlandSpinupNext::modifyQ10
double modifyQ10(double baseQ10Para)
Definition: peatlandspinupnext.h:137
moja::modules::cbm::PeatlandSpinupNext
Definition: peatlandspinupnext.h:21
moja::modules::cbm::PeatlandSpinupNext::_catotelm_o
const flint::IPool * _catotelm_o
Definition: peatlandspinupnext.h:71
moja::modules::cbm::PeatlandSpinupNext::_hardwoodBranchSnag
const flint::IPool * _hardwoodBranchSnag
Definition: peatlandspinupnext.h:48
moja::modules::cbm::PeatlandSpinupNext::decayParas
std::shared_ptr< PeatlandDecayParameters > decayParas
Definition: peatlandspinupnext.h:110
moja::modules::cbm::PeatlandSpinupNext::_hardwoodOther
const flint::IPool * _hardwoodOther
Definition: peatlandspinupnext.h:43
peatlanddecayparameters.h
moja::modules::cbm::PeatlandSpinupNext::_woodyRootsDead
const flint::IPool * _woodyRootsDead
Definition: peatlandspinupnext.h:64
moja::modules::cbm::PeatlandSpinupNext::_hardwoodStemSnag
const flint::IPool * _hardwoodStemSnag
Definition: peatlandspinupnext.h:47
moja::modules::cbm::PeatlandSpinupNext::_sphagnumMossLive
const flint::IPool * _sphagnumMossLive
Definition: peatlandspinupnext.h:59
moja::modules::cbm::PeatlandSpinupNext::_woodyFineDead
const flint::IPool * _woodyFineDead
Definition: peatlandspinupnext.h:62
peatlandfireparameters.h
moja::modules::cbm::PeatlandSpinupNext::_softwoodStem
const flint::IPool * _softwoodStem
Definition: peatlandspinupnext.h:50
moja::modules::cbm::PeatlandSpinupNext::_hardwoodFoliage
const flint::IPool * _hardwoodFoliage
Definition: peatlandspinupnext.h:44
moja::modules::cbm::PeatlandSpinupNext::_woodyFoliageDead
const flint::IPool * _woodyFoliageDead
Definition: peatlandspinupnext.h:61
peatlandturnoverparameters.h
moja::modules::cbm::PeatlandSpinupNext::_sedgeRootsDead
const flint::IPool * _sedgeRootsDead
Definition: peatlandspinupnext.h:66
moja::modules::cbm::PeatlandSpinupNext::_woodyStemsBranchesLive
const flint::IPool * _woodyStemsBranchesLive
Definition: peatlandspinupnext.h:54
moja::modules::cbm::PeatlandSpinupNext::_feathermossDead
const flint::IPool * _feathermossDead
Definition: peatlandspinupnext.h:67
moja::modules::cbm::PeatlandSpinupNext::_hardwoodFineRoots
const flint::IPool * _hardwoodFineRoots
Definition: peatlandspinupnext.h:46
moja::modules::cbm::PeatlandSpinupNext::_softwoodStemSnag
const flint::IPool * _softwoodStemSnag
Definition: peatlandspinupnext.h:39
moja
Definition: ageclasshelper.cpp:10
cbmmodulebase.h
moja::modules::cbm::PeatlandSpinupNext::_turnoverRates
const flint::IVariable * _turnoverRates
Definition: peatlandspinupnext.h:75
moja::modules::cbm::PeatlandSpinupNext::fireParas
std::shared_ptr< PeatlandFireParameters > fireParas
Definition: peatlandspinupnext.h:119
moja::modules::cbm::PeatlandSpinupNext::turnoverParas
std::shared_ptr< PeatlandTurnoverParameters > turnoverParas
Definition: peatlandspinupnext.h:113