GCBM
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PeatlandSpinupTurnOverModule Class Reference

#include <peatlandspinupturnovermodule.h>

Inheritance diagram for PeatlandSpinupTurnOverModule:
Inheritance graph
Collaboration diagram for PeatlandSpinupTurnOverModule:
Collaboration graph

Public Member Functions

 PeatlandSpinupTurnOverModule ()
 
virtual ~PeatlandSpinupTurnOverModule ()
 
void doLocalDomainInit () override
 
void doTimingInit () override
 
void doTimingStep () override
 
- Public Member Functions inherited from PeatlandTurnoverModuleBase
 PeatlandTurnoverModuleBase ()
 
virtual ~PeatlandTurnoverModuleBase ()=default
 
void configure (const DynamicObject &config) override
 
void subscribe (NotificationCenter &notificationCenter) 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 doLocalDomainShutdown ()
 
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 doDisturbanceEvent (DynamicVar)
 
virtual void doPrePostDisturbanceEvent ()
 
virtual void doPostDisturbanceEvent ()
 
virtual void doPostDisturbanceEvent2 ()
 
virtual void doPostNotification (short preMessageSignal)
 

Private Member Functions

void doWaterTableFlux ()
 
void loadPeatlandInitialPoolValues (const DynamicObject &data)
 

Private Attributes

flint::IVariable * _spinupMossOnly = nullptr
 
flint::IVariable * _appliedAnnualWTD { nullptr }
 
double _spinup_longterm_wtd { 0 }
 
double _spinup_previous_annual_wtd { 0 }
 
double _spinup_current_annual_wtd { 0 }
 
bool _isInitialPoolLoaded { false }
 

Additional Inherited Members

- Protected Member Functions inherited from PeatlandTurnoverModuleBase
void updatePeatlandLivePoolValue ()
 
void doLivePoolTurnover ()
 
double computeWaterTableDepth (double dc, int peatlandID)
 
double computeCarbonTransfers (double previousAwtd, double currentAwtd, double a, double b)
 
- Protected Attributes inherited from PeatlandTurnoverModuleBase
const flint::IPool * _atmosphere = nullptr
 
const flint::IPool * _woodyFoliageLive = nullptr
 
const flint::IPool * _woodyStemsBranchesLive = nullptr
 
const flint::IPool * _woodyRootsLive = nullptr
 
const flint::IPool * _sedgeFoliageLive = nullptr
 
const flint::IPool * _sedgeRootsLive = nullptr
 
const flint::IPool * _featherMossLive = nullptr
 
const flint::IPool * _sphagnumMossLive = nullptr
 
const flint::IPool * _woodyFineDead = nullptr
 
const flint::IPool * _woodyCoarseDead = nullptr
 
const flint::IPool * _woodyFoliageDead = nullptr
 
const flint::IPool * _woodyRootsDead = nullptr
 
const flint::IPool * _sedgeFoliageDead = nullptr
 
const flint::IPool * _sedgeRootsDead = nullptr
 
const flint::IPool * _feathermossDead = nullptr
 
const flint::IPool * _acrotelm_o = nullptr
 
const flint::IPool * _catotelm_a = nullptr
 
const flint::IPool * _acrotelm_a = nullptr
 
const flint::IPool * _catotelm_o = nullptr
 
flint::IVariable * _regenDelay = nullptr
 
flint::IVariable * _shrubAge = nullptr
 Peatland shrub age variable, which may be very old /summary> More...
 
std::shared_ptr< PeatlandTurnoverParametersturnoverParas = nullptr
 Turnover parameters associated to this peatland unit /summary> More...
 
std::shared_ptr< PeatlandGrowthParametersgrowthParas = nullptr
 Growth parameters associated to this peatland unit /summary> More...
 
DynamicObject baseWTDParameters
 
double woodyFoliageLive { 0 }
 
double woodyStemsBranchesLive { 0 }
 
double woodyRootsLive { 0 }
 
double sedgeFoliageLive { 0 }
 
double sedgeRootsLive { 0 }
 
double featherMossLive { 0 }
 
double sphagnumMossLive { 0 }
 
bool _runPeatland { false }
 
int _peatlandId { -1 }
 

Constructor & Destructor Documentation

◆ PeatlandSpinupTurnOverModule()

◆ ~PeatlandSpinupTurnOverModule()

virtual ~PeatlandSpinupTurnOverModule ( )
virtual

Member Function Documentation

◆ doLocalDomainInit()

void doLocalDomainInit ( )
overridevirtual

Set the value of the pools "Atmosphere", "WoodyFoilageLive", "WoodyStemsBranchesLive", "WoodyRootsLive", "SedgeFoliageLive", "SedgeRootsLive", "SphagnumMossLive", "FeatherMossLive", "WoodyFoliageDead", "WoodyFineDead", "WoodyCoarseDead", "WoodyRootsDead", "SedgeFoliageDead", "SedgeRootsDead", "FeathermossDead", "Acrotelm_O", "Catotelm_A", "Acrotelm_A", "Catotelm_O" from _landUnitData to PeatlandSpinupTurnOverModule._atmosphere, PeatlandSpinupTurnOverModule._woodyFoliageLive, PeatlandSpinupTurnOverModule._woodyStemsBranchesLive, PeatlandSpinupTurnOverModule._sedgeFoliageLive, PeatlandSpinupTurnOverModule._sedgeRootsLive, PeatlandSpinupTurnOverModule._sphagnumMossLive, PeatlandSpinupTurnOverModule._featherMossLive, PeatlandSpinupTurnOverModule._woodyFoliageDead, PeatlandSpinupTurnOverModule._woodyFineDead, PeatlandSpinupTurnOverModule._woodyCoarseDead, PeatlandSpinupTurnOverModule._woodyRootsDead, PeatlandSpinupTurnOverModule._sedgeFoliageDead, PeatlandSpinupTurnOverModule._sedgeRootsDead, PeatlandSpinupTurnOverModule._feathermossDead, PeatlandSpinupTurnOverModule._acrotelm_O, PeatlandSpinupTurnOverModule._catotelm_A, PeatlandSpinupTurnOverModule._acrotelm_A, PeatlandSpinupTurnOverModule._catotelm_O

Set value of variables "spinup_moss_only", "regen_delay", "base_wtd_parameters", "applied_annual_wtd" from _landUnitData to PeatlandSpinupTurnOverModule._spinupMossOnly, PeatlandSpinupTurnOverModule._regenDelay, PeatlandSpinupTurnOverModule.baseWTDParameters, PeatlandSpinupTurnOverModule._appliedAnnualWTD

Returns
void

Reimplemented from CBMModuleBase.

◆ doTimingInit()

void doTimingInit ( )
overridevirtual

Set PeatlandSpinupTurnOverModule._runPeatland to false, PeatlandSpinupTurnOverModule._appliedAnnualWTD is only valid in forward run, reset it for spinup
If value of variable "load_peatpool_initials" in _landUnitData is not null, invoke PeatlandSpinupTurnOverModule.loadPeatlandInitialPoolValues()
If the value of "peatland_class" in _landUnitData is not empty, set PeatlandSpinupTurnOverModule._runPeatland to true
assign turnoverParas a shared pointer of PeatlandGrowthParameters and set it to "peatland_turnover_parameters" in _landUnitData
assign growthParas a shared pointer of PeatlandGrowthParameters ans set it to "peatland_growth_parameters" in _landUnitData
Set the result of PeatlandSpinupTurnOverModule.computeWaterTableDepth() to the three water table depths PeatlandSpinupTurnOverModule._spinup_longterm_wtd, PeatlandSpinupTurnOverModule._spinup_previous_annual_wtd and PeatlandSpinupTurnOverModule._spinup_current_annual_wtd in spinup phase
In spinup run, always set PeatlandSpinupTurnOverModule._appliedAnnualWTD same as spinup long term WTD, the result of PeatlandSpinupTurnOverModule.computeWaterTableDepth()

Returns
void

Reimplemented from CBMModuleBase.

◆ doTimingStep()

void doTimingStep ( )
overridevirtual

If PeatlandSpinupTurnOverModule.spinupMossOnly is true, return
Else, if PeatlandSpinupTurnOverModule._runPeatland is true, if value of PeatlandSpinupTurnOverModule._regenDelay > 0, there is no growth in delay period, invoke PeatlandSpinupTurnOverModule.doWaterTableFlux(), else, invoke PeatlandSpinupTurnOverModule.updatePeatlandLivePool() to update the current pool value, PeatlandSpinupTurnOverModule.doLiveTurnover() to turnover on live pools, and PeatlandSpinupTurnOverModule.doWaterTableFlux() to update the flux between catotelm and acrotelm due to water table changes

Returns
void

Reimplemented from CBMModuleBase.

◆ doWaterTableFlux()

void doWaterTableFlux ( )
private

Add transfers between the pools PeatlandSpinupTurnOverModule._catotelm_o, PeatlandSpinupTurnOverModule._catotelm_a, PeatlandSpinupTurnOverModule._acrotelm_o, PeatlandSpinupTurnOverModule._acrotelm_a based on the values of current annual water table depth PeatlandSpinupTurnOverModule._spinup_current_annual_wtd, previous annual water table depth PeatlandSpinupTurnOverModule._spinup_previous_annual_wtd and long term annual water table depth PeatlandSpinupTurnOverModule._spinup_longterm_wtd
Invoke createStockOperation() on _landUnitData, compute the flux using PeatlandSpinupTurnOverModule.computeCarbonTransfers()
Submit the stock operation to the LandUnitData and apply the stock operation to the _landUnitData

Returns
void

◆ loadPeatlandInitialPoolValues()

void loadPeatlandInitialPoolValues ( const DynamicObject &  data)
private

Invoke createStockOperation() on _landUnitData
Add transfers from source PeatlandSpinupTurnOverModule._atmosphere to sink PeatlandSpinupTurnOverModule._acrotelm_o, transfer amount is value "acrotelm" in parameter data, source PeatlandSpinupTurnOverModule._atmosphere to sink PeatlandSpinupTurnOverModule._catotelm_o, transfer amount is value "catotelm" in parameter data
Submit the operation to _landUnitData, invoke submitOperation() and applyOperations() on _landUnitData

Parameters
dataconst DynamicObject&
Returns
void

Member Data Documentation

◆ _appliedAnnualWTD

flint::IVariable* _appliedAnnualWTD { nullptr }
private

◆ _isInitialPoolLoaded

bool _isInitialPoolLoaded { false }
private

◆ _spinup_current_annual_wtd

double _spinup_current_annual_wtd { 0 }
private

◆ _spinup_longterm_wtd

double _spinup_longterm_wtd { 0 }
private

◆ _spinup_previous_annual_wtd

double _spinup_previous_annual_wtd { 0 }
private

◆ _spinupMossOnly

flint::IVariable* _spinupMossOnly = nullptr
private

The documentation for this class was generated from the following files: