GCBM
|
#include <cbmpeatlandspinupoutput.h>
Public Member Functions | |
CBMPeatlandSpinupOutput () | |
virtual | ~CBMPeatlandSpinupOutput () |
void | configure (const DynamicObject &config) override |
void | subscribe (NotificationCenter ¬ificationCenter) override |
void | doLocalDomainInit () override |
void | doTimingInit () override |
void | doLocalDomainShutdown () override |
void | doTimingStep () override |
void | doDisturbanceEvent (DynamicVar) override |
void | doPrePostDisturbanceEvent () override |
Public Member Functions inherited from CBMModuleBase | |
virtual | ~CBMModuleBase ()=default |
void | onSystemInit () override |
void | onSystemShutdown () override |
void | onLocalDomainInit () override |
void | onLocalDomainShutdown () override |
void | onLocalDomainProcessingUnitInit () override |
void | onLocalDomainProcessingUnitShutdown () override |
void | onPreTimingSequence () override |
void | onTimingInit () override |
void | onTimingPrePostInit () override |
void | onTimingPostInit () override |
void | onTimingPostInit2 () override |
void | onTimingShutdown () override |
void | onTimingStep () override |
void | onTimingPreEndStep () override |
void | onTimingEndStep () override |
void | onTimingPostStep () override |
void | onOutputStep () override |
void | onPrePostDisturbanceEvent () override |
void | onPostDisturbanceEvent () override |
void | onPostDisturbanceEvent2 () override |
void | onError (std::string msg) override |
void | onDisturbanceEvent (DynamicVar e) override |
void | onPostNotification (short preMessageSignal) override |
virtual void | doSystemInit () |
virtual void | doSystemShutdown () |
virtual void | doLocalDomainProcessingUnitInit () |
virtual void | doLocalDomainProcessingUnitShutdown () |
virtual void | doPreTimingSequence () |
virtual void | doTimingPrePostInit () |
virtual void | doTimingPostInit () |
virtual void | doTimingPostInit2 () |
virtual void | doTimingShutdown () |
virtual void | doTimingPreEndStep () |
virtual void | doTimingEndStep () |
virtual void | doTimingPostStep () |
virtual void | doOutputStep () |
virtual void | doError (std::string msg) |
virtual void | doPostDisturbanceEvent () |
virtual void | doPostDisturbanceEvent2 () |
virtual void | doPostNotification (short preMessageSignal) |
Private Member Functions | |
std::string | getTimeStamp () |
void | outputPoolValues () |
Private Attributes | |
flint::IVariable * | _peatland_spinup_rotation |
flint::IVariable * | _stand_age |
flint::IVariable * | _tree_age |
flint::IVariable * | _shrub_age |
bool | _runPeatland { false } |
bool | _isOutputLog { false } |
bool | _isSpinupFileCreated { false } |
std::ofstream | timeStepOutputFile |
int | _peatlandId { -1 } |
int | _fireReturnIntervalValue { -1 } |
std::string | _fileName |
std::string | _testRunId |
std::string | fileNameFixed |
|
virtual |
|
override |
Configuration function
Assign values of "spinup_output_file", "test_run_id", "log_output" in parameter config to CBMPeatlandSpinupOutput._fileName, CBMPeatlandSpinupOutput._testRunId and CBMPeatlandSpinupOutput._isOutputLog
config | DynamicObject& |
|
overridevirtual |
If CBMPeatlandSpinupOutput._isOutputLog,CBMPeatlandSpinupOutput._isSpinupFileCreated are true and
value of variable "peat_pool_cached" in _landUnitData is false, invoke CBMPeatlandSpinupOutput.outputPoolValues().
DynamicVar | n |
Reimplemented from CBMModuleBase.
|
overridevirtual |
Assign CBMPeatlandSpinupOutput._peatland_spinup_rotation as variable "peatland_spinup_rotation"
, CBMPeatlandSpinupOutput._tree_age as variable "peatland_smalltree_age" ,CBMPeatlandSpinupOutput._shrub_age as
variable "peatland_shrub_age", CBMPeatlandSpinupOutput._stand_age as variable "age" from _landUnitData
if CBMPeatlandSpinupOutput._isSpinupFileCreated is false and _landUnitData has variable "spinup_output_file"
Assign a variable fileName (string) the value of variable "spinup_output_file" in _landUnitData
If value of variable "fire_return_interval" in _landUnitData is not empty and has a value > 0,
value of variable "fire_return_interval" in _landUnitData is appended to variable fileName
else, the variable fileName is assigned the current timestamp
If a file with fileName does not exist, open the file using CBMPeatlandSpinupOutput._timeStepOutputFile and add each pool (from the second pool onwards) returned from poolCollection() in _landUnitData
else open the file using CBMPeatlandSpinupOutput._timeStepOutputFile.
Assign CBMPeatlandSpinupOutput._isOutputLog and CBMPeatlandSpinupOutput._isSpinupFileCreated to true.
Reimplemented from CBMModuleBase.
|
overridevirtual |
If CBMPeatlandSpinupOutput.isSpinUpFileCreated, invoke CBMPeatlandSpinupOutput.timeStepOutputFile.flush() and CBMPeatlandSpinupOutput.timeStepOutputFile.close()
Reimplemented from CBMModuleBase.
|
overridevirtual |
If CBMPeatlandSpinupOutput._isOutputLog,CBMPeatlandSpinupOutput._isSpinupFileCreated are true and
value of variable "peat_pool_cached" in _landUnitData is false, invoke CBMPeatlandSpinupOutput.outputPoolValues().
Reimplemented from CBMModuleBase.
|
overridevirtual |
If the value of the variable "peatland_class" in _landUnitData is not empty and greater than 0,
Assign CBMPeatlandSpinupOutput._runPeatland to true and CBMPeatlandSpinupOutput._fireReturnIntervalValue the value of the variable "fire_return_interval" (integer),
if it is not empty, else a value of -1
Reimplemented from CBMModuleBase.
|
overridevirtual |
If CBMPeatlandSpinupOutput._isOutputLog,CBMPeatlandSpinupOutput._isSpinupFileCreated are true and
value of variable "peat_pool_cached" in _landUnitData is false, invoke CBMPeatlandSpinupOutput.outputPoolValues().
Reimplemented from CBMModuleBase.
|
private |
Get the timeStamp using Poco::LocalDateTime()
|
private |
Print Pool Values.
If CBMPeatlandSpinupOutput._runPeatland and CBMPeatlandSpinupOutput._isOutputLog are true, Write into CBMPeatlandSpinupOutput.timeStepOutputFile the values CBMPeatlandSpinupOutput._peatlandId,
CBMPeatlandSpinupOutput._fireReturnIntervalValue, CBMPeatlandSpinupOutput._peatland_spinup_rotation,
and CBMPeatlandSpinupOutput._shrub_age
Add each pool (from the second pool onwards) returned from poolCollection() in _landUnitData and open the file using CBMPeatlandSpinupOutput._timeStepOutputFile.
|
override |
Subscribe to the signals LocalDomianInit,TimingInit,TimigEndStep,TimingStep, LocalDomainShutDown,DisturbanceEvent and PrePostDisturbanceEvent.
notificationCenter | NotificationCenter& |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |