GCBM
smalltreegrowthcurve.h
Go to the documentation of this file.
1 #ifndef MOJA_MODULES_CBM_SMALLTREEGROWTHCURVE_H_
2 #define MOJA_MODULES_CBM_SMALLTREEGROWTHCURVE_H_
3 
4 #include "moja/modules/cbm/_modules.cbm_exports.h"
5 #include "moja/flint/modulebase.h"
6 
9 
10 #include <unordered_map>
11 
12 namespace moja {
13 namespace modules {
14 namespace cbm {
15 
17 
18  class CBM_API SmallTreeGrowthCurve {
19  public:
21  virtual ~SmallTreeGrowthCurve() {}
22 
23  SmallTreeGrowthCurve(SpeciesType speciesType);
24 
25  std::string getEcoBoundary() const;
26  SpeciesType speciesType() const;
27 
28  void checkUpdateEcoParameters(std::string ecoBoundaryName, const DynamicObject& data);
29 
30  std::unordered_map<std::string, double> getSmallTreeBiomassCarbonIncrements(double stem, double other, double foliage, double coarseRoot, double fineRoot, int age);
31 
32  double getStemwoodVolumeAtAge(int age);
33 
34  double getStemwoodBiomass(double stemwoodVolume);
35 
36  double getBiomassPercentage(COMPONENT component, double totalStemVolume);
37 
38  void setRootBiomassEquation();
39 
40  void generateOrUpdateCarbonCurve();
41 
42  private:
43  int maxAge{200};
44 
45  double a_bio{0.0};
46  double b_bio{0.0};
47  double a1{0.0};
48  double a2{0.0};
49  double a3{0.0};
50  double b1{0.0};
51  double b2{0.0};
52  double b3{0.0};
53  double c1{0.0};
54  double c2{0.0};
55  double c3{0.0};
56  double a_vol{0.0};
57  double b_vol{0.0};
58 
59  double vol_max{ 0.0 };
60  double vol_min{ 0.0 };
61  double p_sw_min{ 0.0 };
62  double p_sw_max{ 0.0 };
63  double p_fl_min{ 0.0 };
64  double p_fl_max{ 0.0 };
65  double p_br_min{ 0.0 };
66  double p_br_max{ 0.0 };
67  double p_sb_min{ 0.0 };
68  double p_sb_max{ 0.0 };
69 
70  double sw_a{ 0.0 };
71  double hw_a{ 0.0 };
72  double hw_b{ 0.0 };
73  double frp_a{ 0.0 };
74  double frp_b{ 0.0 };
75  double frp_c{ 0.0 };
76 
77  std::string ecoBoundaryName;
79 
80  std::vector<double> stemCarbonIncrements;
81  std::vector<double> foliageCarbonIncrements;
82  std::vector<double> otherCarbonIncrements;
83 
84  std::shared_ptr<cbm::RootBiomassEquation> rootBiomassEquation;
85 
86  void setParametersValue(const DynamicObject& data);
87  void initilizeVectors();
88  double commonDivider(double volume);
89  std::unordered_map<std::string, double> getAGIncrements(double stem, double other, double foliage, int age);
90  };
91 
92 }}}
93 #endif
moja::modules::cbm::SmallTreeGrowthCurve
Definition: smalltreegrowthcurve.h:18
moja::modules::cbm::SmallTreeGrowthCurve::typeName
SpeciesType typeName
Definition: smalltreegrowthcurve.h:78
moja::modules::cbm
Definition: ageclasshelper.cpp:12
moja::modules::cbm::COMPONENT
COMPONENT
Definition: smalltreegrowthcurve.h:16
moja::modules::cbm::COMPONENT::STEMWOOD
@ STEMWOOD
moja::modules::cbm::SmallTreeGrowthCurve::foliageCarbonIncrements
std::vector< double > foliageCarbonIncrements
Definition: smalltreegrowthcurve.h:81
moja::modules::cbm::COMPONENT::OTHER
@ OTHER
moja::modules::cbm::SpeciesType
SpeciesType
Enumeration of tree species type, softwood or hardwood.
Definition: treespecies.h:14
moja::modules::cbm::COMPONENT::FOLIAGE
@ FOLIAGE
moja::modules::cbm::SmallTreeGrowthCurve::~SmallTreeGrowthCurve
virtual ~SmallTreeGrowthCurve()
Definition: smalltreegrowthcurve.h:21
moja::modules::cbm::SmallTreeGrowthCurve::ecoBoundaryName
std::string ecoBoundaryName
Definition: smalltreegrowthcurve.h:77
moja::modules::cbm::SmallTreeGrowthCurve::stemCarbonIncrements
std::vector< double > stemCarbonIncrements
Definition: smalltreegrowthcurve.h:80
moja::modules::cbm::COMPONENT::BARK
@ BARK
moja::modules::cbm::SmallTreeGrowthCurve::otherCarbonIncrements
std::vector< double > otherCarbonIncrements
Definition: smalltreegrowthcurve.h:82
moja::modules::cbm::SmallTreeGrowthCurve::SmallTreeGrowthCurve
SmallTreeGrowthCurve()
Definition: smalltreegrowthcurve.h:20
moja
Definition: ageclasshelper.cpp:10
moja::modules::cbm::SmallTreeGrowthCurve::rootBiomassEquation
std::shared_ptr< cbm::RootBiomassEquation > rootBiomassEquation
Definition: smalltreegrowthcurve.h:84
rootbiomassequation.h
moja::modules::cbm::COMPONENT::BRANCH
@ BRANCH
treespecies.h