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

#include <cbmdecaymodule.h>

Inheritance diagram for CBMDecayModule:
Inheritance graph
Collaboration diagram for CBMDecayModule:
Collaboration graph

Public Member Functions

 CBMDecayModule ()
 
virtual ~CBMDecayModule ()=default
 
void configure (const DynamicObject &config) override
 
void subscribe (NotificationCenter &notificationCenter) override
 
void doLocalDomainInit () override
 
void doTimingInit () override
 
void doTimingStep () 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 getTransfer (std::shared_ptr< flint::IOperation > operation, double meanAnnualTemperature, const std::string &domPool, const flint::IPool *poolSrc, const flint::IPool *poolDest)
 
void getTransfer (std::shared_ptr< flint::IOperation > operation, double meanAnnualTemperature, const std::string &domPool, const flint::IPool *pool)
 
bool shouldRun ()
 
void initPeatland ()
 

Private Attributes

const flint::IPool * _aboveGroundVeryFastSoil
 
const flint::IPool * _belowGroundVeryFastSoil
 
const flint::IPool * _aboveGroundFastSoil
 
const flint::IPool * _belowGroundFastSoil
 
const flint::IPool * _mediumSoil
 
const flint::IPool * _aboveGroundSlowSoil
 
const flint::IPool * _belowGroundSlowSoil
 
const flint::IPool * _softwoodStemSnag
 
const flint::IPool * _softwoodBranchSnag
 
const flint::IPool * _hardwoodStemSnag
 
const flint::IPool * _hardwoodBranchSnag
 
const flint::IPool * _atmosphere
 
flint::IVariable * _spinupMossOnly
 
flint::IVariable * _isDecaying
 
double _slowMixingRate
 
bool _extraDecayRemovals { false }
 
bool _skipForPeatland { false }
 
std::map< std::string, PoolDecayParameters_decayParameters
 
std::map< std::string, std::map< std::string, double > > _decayRemovals
 

Constructor & Destructor Documentation

◆ CBMDecayModule()

◆ ~CBMDecayModule()

virtual ~CBMDecayModule ( )
virtualdefault

Member Function Documentation

◆ configure()

void configure ( const DynamicObject &  config)
override

Configuration function

Assign CBMDecayModule._extraDecayRemovals the value of variable "extra_decay_removals" if it is contained in parameter config

Parameters
configDynamicObject&
Returns
void

◆ doLocalDomainInit()

void doLocalDomainInit ( )
overridevirtual

◆ doTimingInit()

void doTimingInit ( )
overridevirtual

Assign CBMDecayModule._slowMixingRate value of variable "slow_ag_to_bg_mixing_rate" in _landUnitData
If CBMDecayModule._extraDecayRemovals is true, assign the proportion of transfer between the source and
destination pools in CBMDecayModule._decayRemovals
Invoke CBMDecayModule.initPeatland()

Returns
void

Reimplemented from CBMModuleBase.

◆ doTimingStep()

void doTimingStep ( )
overridevirtual

◆ getTransfer() [1/2]

void getTransfer ( std::shared_ptr< flint::IOperation >  operation,
double  meanAnnualTemperature,
const std::string &  domPool,
const flint::IPool *  pool 
)
private

Transfer between source and destination pools (Overloaded Operation)

Initialise the double variables decayRate and proptoatmosphere from CBMDecayModule._decayParameters
Get the additional removals from the amount decayed to the atmosphere and add transfer to the operation
using the parameter(pool),dstPool,decayRate and dstProps. Add transfer to operation parameter using the parameters(pool,_atmopshere), decayRate and propToAtmosphere.

Parameters
operationshared_ptr<Ioperation>
meanAnnualTemperaturedouble
domPoolstring&
poolIPool*
Returns
void

◆ getTransfer() [2/2]

void getTransfer ( std::shared_ptr< flint::IOperation >  operation,
double  meanAnnualTemperature,
const std::string &  domPool,
const flint::IPool *  poolSrc,
const flint::IPool *  poolDest 
)
private

Transfer between source and destination pools (Overloaded function)

Initialise the double variables decayRate and proptoatmosphere from CBMDecayModule._decayParameters
Invoke addTransfer() method on parameter operation, using arguments poolSrc, CBMDecayModule._atmosphere, poolDest
and variables decayRate and propToAtmosphere.

Parameters
operationshared_ptr<Ioperation>
meanAnnualTemperaturedouble
domPoolstring&
poolSrcIPool*
poolDestIPool*
Returns
void

◆ initPeatland()

void initPeatland ( )
private

Reset CBMDecayModule._skipForPeatland as false
If the variable "enable_peatland" exists in_landUnitData and is not null,
if the peatlandId corresponding to the value of the variable "peatland_class" is not equal to
Peatlands::OPEN_PEATLAND_BOG, Peatlands::OPEN_PEATLAND_POORFEN or Peatlands::OPEN_PEATLAND_RICHFEN,
value of CBMDecayModule._skipForPeatland is set to true else false, i.e skip decay when running peatland on any open peatland

skip decay when running peatland on any open peatland

Returns
void

◆ shouldRun()

bool shouldRun ( )
private

Determine if the module should be run.

When moss module is spinning up, nothing to grow, turnover and decay. Return true if CBMDecayModule._spinupMossOnly is false and CBMDecayModule._isDecaying is true

Returns
bool

◆ subscribe()

void subscribe ( NotificationCenter &  notificationCenter)
override

Subscribe to the signals LocalDomainInit, TimingInit, and TimingStep

Parameters
notificationCenterNotificationCenter&
Returns
void

Member Data Documentation

◆ _aboveGroundFastSoil

const flint::IPool* _aboveGroundFastSoil
private

◆ _aboveGroundSlowSoil

const flint::IPool* _aboveGroundSlowSoil
private

◆ _aboveGroundVeryFastSoil

const flint::IPool* _aboveGroundVeryFastSoil
private

◆ _atmosphere

const flint::IPool* _atmosphere
private

◆ _belowGroundFastSoil

const flint::IPool* _belowGroundFastSoil
private

◆ _belowGroundSlowSoil

const flint::IPool* _belowGroundSlowSoil
private

◆ _belowGroundVeryFastSoil

const flint::IPool* _belowGroundVeryFastSoil
private

◆ _decayParameters

std::map<std::string, PoolDecayParameters> _decayParameters
private

◆ _decayRemovals

std::map<std::string, std::map<std::string, double> > _decayRemovals
private

◆ _extraDecayRemovals

bool _extraDecayRemovals { false }
private

◆ _hardwoodBranchSnag

const flint::IPool* _hardwoodBranchSnag
private

◆ _hardwoodStemSnag

const flint::IPool* _hardwoodStemSnag
private

◆ _isDecaying

flint::IVariable* _isDecaying
private

◆ _mediumSoil

const flint::IPool* _mediumSoil
private

◆ _skipForPeatland

bool _skipForPeatland { false }
private

◆ _slowMixingRate

double _slowMixingRate
private

◆ _softwoodBranchSnag

const flint::IPool* _softwoodBranchSnag
private

◆ _softwoodStemSnag

const flint::IPool* _softwoodStemSnag
private

◆ _spinupMossOnly

flint::IVariable* _spinupMossOnly
private

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