GCBM
cbmpeatlandspinupoutput.h
Go to the documentation of this file.
1 #ifndef MOJA_MODULES_CBM_PEATLAND_SPINUP_OUTPUT_H_
2 #define MOJA_MODULES_CBM_PEATLAND_SPINUP_OUTPUT_H_
3 
4 #include "moja/modules/cbm/_modules.cbm_exports.h"
6 
7 #include <fstream>
8 
9 namespace moja {
10  namespace modules {
11  namespace cbm {
12 
13  /*
14  Record the pool values during peatland spinup phase
15  */
16  class CBM_API CBMPeatlandSpinupOutput : public CBMModuleBase {
17  public:
20 
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 doLocalDomainShutdown() override;
28  void doTimingStep() override;
29  void doDisturbanceEvent(DynamicVar) override;
30  void doPrePostDisturbanceEvent() override;
31 
32  private:
33  flint::IVariable* _peatland_spinup_rotation;
34  flint::IVariable* _stand_age;
35  flint::IVariable* _tree_age;
36  flint::IVariable* _shrub_age;
37 
38  bool _runPeatland{ false };
39  bool _isOutputLog{ false };
40  bool _isSpinupFileCreated{ false };
41 
42  std::ofstream timeStepOutputFile;
43 
44  int _peatlandId{ -1 };
45  int _fireReturnIntervalValue{ -1 };
46 
47  std::string _fileName;
48  std::string _testRunId;
49 
50  std::string getTimeStamp();
51  void outputPoolValues();
52  std::string fileNameFixed;
53  };
54  }
55  }
56 }
57 #endif
moja::modules::cbm
Definition: ageclasshelper.cpp:12
moja::modules::cbm::CBMPeatlandSpinupOutput::_shrub_age
flint::IVariable * _shrub_age
Definition: cbmpeatlandspinupoutput.h:36
moja::modules::cbm::CBMPeatlandSpinupOutput
Definition: cbmpeatlandspinupoutput.h:16
moja::modules::cbm::CBMModuleBase
Definition: cbmmodulebase.h:22
moja::modules::cbm::CBMPeatlandSpinupOutput::_fileName
std::string _fileName
Definition: cbmpeatlandspinupoutput.h:47
moja::modules::cbm::CBMPeatlandSpinupOutput::~CBMPeatlandSpinupOutput
virtual ~CBMPeatlandSpinupOutput()
Definition: cbmpeatlandspinupoutput.h:19
moja::modules::cbm::CBMPeatlandSpinupOutput::_tree_age
flint::IVariable * _tree_age
Definition: cbmpeatlandspinupoutput.h:35
moja::modules::cbm::CBMPeatlandSpinupOutput::fileNameFixed
std::string fileNameFixed
Definition: cbmpeatlandspinupoutput.h:52
moja::modules::cbm::CBMPeatlandSpinupOutput::CBMPeatlandSpinupOutput
CBMPeatlandSpinupOutput()
Definition: cbmpeatlandspinupoutput.h:18
moja::modules::cbm::CBMPeatlandSpinupOutput::_stand_age
flint::IVariable * _stand_age
Definition: cbmpeatlandspinupoutput.h:34
moja::modules::cbm::CBMPeatlandSpinupOutput::_peatland_spinup_rotation
flint::IVariable * _peatland_spinup_rotation
Definition: cbmpeatlandspinupoutput.h:33
moja::modules::cbm::CBMPeatlandSpinupOutput::timeStepOutputFile
std::ofstream timeStepOutputFile
Definition: cbmpeatlandspinupoutput.h:42
moja
Definition: ageclasshelper.cpp:10
cbmmodulebase.h
moja::modules::cbm::CBMPeatlandSpinupOutput::_testRunId
std::string _testRunId
Definition: cbmpeatlandspinupoutput.h:48