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

Parameters for moss related computing. More...

#include <mossdecaymodule.h>

Inheritance diagram for MossDecayModule:
Inheritance graph
Collaboration diagram for MossDecayModule:
Collaboration graph

Public Member Functions

 MossDecayModule (std::shared_ptr< StandGrowthCurveFactory > gcFactory)
 
virtual ~MossDecayModule ()=default
 
void configure (const DynamicObject &config) override
 
void subscribe (NotificationCenter &notificationCenter) override
 
flint::ModuleTypes moduleType () 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

double F6 (double m, double n, double maxVolume)
 
double F7 (double baseDecayRate, double meanAnnualTemperature, double q10)
 
void updateMossAppliedDecayParameters (double standMaximumVolume, double meanAnnualTemperature)
 
void doMossFastPoolDecay ()
 
void doMossSlowPoolDecay ()
 

Private Attributes

std::shared_ptr< StandGrowthCurveFactory_gcFactory
 
flint::IVariable * _mossParameters
 
const flint::IPool * _featherMossFast = nullptr
 
const flint::IPool * _sphagnumMossFast = nullptr
 
const flint::IPool * _featherMossSlow = nullptr
 
const flint::IPool * _sphagnumMossSlow = nullptr
 
const flint::IPool * _CO2 = nullptr
 
bool runMoss { false }
 
double kff
 
double ksf
 
double kfs
 
double kss
 
double q10
 
double tref
 
double akff
 
double akfs
 
double aksf
 
double akss
 
double m
 
double n
 
double fastToSlowTurnoverRate
 
double fastToAirDecayRate
 
double meanAnnualTemperature
 
Int64 currentStandGCId
 

Detailed Description

Parameters for moss related computing.


Constructor & Destructor Documentation

◆ MossDecayModule()

MossDecayModule ( std::shared_ptr< StandGrowthCurveFactory gcFactory)

◆ ~MossDecayModule()

virtual ~MossDecayModule ( )
virtualdefault

Member Function Documentation

◆ configure()

void configure ( const DynamicObject &  config)
override

Configuration function

Parameters
configconst DynamicObject&
Returns
void

◆ doLocalDomainInit()

void doLocalDomainInit ( )
overridevirtual

Initialise MossDecayModule._featherMossFast, MossDecayModule._sphagnumMossFast, MossDecayModule._featherMossSlow, MossDecayModule._sphagnumMossSlow, MossDecayModule._CO2 value of "FeatherMossFast", SphagnumMossFast", "FeatherMossSlow", "SphagnumMossSlow", "CO2" in _landUnitData

Initialise MossDecayModule._mossParameters as variable "moss_parameters" in _landUnitData,
MossDecayModule.fastToSlowTurnoverRate, MossDecayModule.fastToAirDecayRate, MossDecayModule.kff, MossDecayModule.ksf, MossDecayModule.kfs, MossDecayModule.kss, MossDecayModule.q10, MossDecayModule.tref, MossDecayModule.m, MossDecayModule.n values of "fastToSlowTurnoverRate", "fastToAirDecayRate", "kff", "ksf", "kfs", "kss", "q10", "tref", "m", "n" in MossDecayModule._mossParameters

Returns
void

Reimplemented from CBMModuleBase.

◆ doMossFastPoolDecay()

void doMossFastPoolDecay ( )
private

Moss fast pool turnover and decay

Invoke createStockOperation() on _landUnitData
Add feather fast to slow and to air transfers between source MossDecayModule._featherMossFast and sink MossDecayModule._featherMossSlow with transfer value MossDecayModule._featherMossFast * MossDecayModule.akff * MossDecayModule.fastToSlowTurnoverRate, source MossDecayModule._featherMossFast and sink MossDecayModule._CO2 with transfer value MossDecayModule._featherMossFast * MossDecayModule.akff * MossDecayModule.fastToAirDecayRate
Add sphagnum fast to slow and to air transfers between source MossDecayModule._sphagnumMossFast and sink MossDecayModule._sphagnumMossSlow with transfer value MossDecayModule._sphagnumMossFast * MossDecayModule.aksf * MossDecayModule.fastToSlowTurnoverRate source MossDecayModule._sphagnumMossFast and sink MossDecayModule._CO2 with transfer value MossDecayModule._sphagnumMossFast * MossDecayModule.aksf * MossDecayModule.fastToAirDecayRate
Invoke submitOperation() on _landUnitData to submit the transfers

Returns
void

◆ doMossSlowPoolDecay()

void doMossSlowPoolDecay ( )
private

Moss slow pool decay only Invoke createProportionalOperation() on _landUnitData, add a transfer of MossDecayModule.akfs from source MossDecayModule._featherMossSlow to sink MossDecayModule._CO2, transfer of MossDecayModule.akss from source MossDecayModule._sphagnumMossSlow to sink MossDecayModule._CO2
Invoke submitOperation() on _landUnitData to submit the transfers

Returns
void

◆ doTimingInit()

void doTimingInit ( )
overridevirtual

If variable "enable_moss" exists in _landUnitData and it has a value, assign MossDecayModule.meanAnnualTemperature the value of variable "default_mean_annual_temperature" in _landUnitData if value of variable "mean_annual_temperature" is empty.
Invoke Helper.runMoss() with arguments as value of variables "growth_curve_id", "moss_leading_species" and "leading_species" in _landUnitData
Assign MossDisturbanceModule.runMoss to true if variable "peatland_class" in _landUnitData is empty, variable "growth_curve_id" in _landUnitData is not empty, and Helper.runMoss() returns true

Returns
void

Reimplemented from CBMModuleBase.

◆ doTimingStep()

void doTimingStep ( )
overridevirtual

If MossDecayModule.runMoss is true, and the value of variable "growth_curve_id" in _landUnitData > 0, Get the annual maximumVolume of the stand as, invoke StandGrowthCurve.getAnnualStandMaximumVolume() on the result of StandGrowthCurveFactory.getStandGrowthCurve() on MossDecayModule._gcFactory with argument as the value of variable "growth_curve_id" in _landUnitData
Invoke MossDecayModule.updateMossAppliedDecayParameters() with arguments maximumVolume, MossDecayModule.meanAnnualTemperature, MossDecayModule.doMossFastPoolDecay(), MossDecayModule.doMossSlowPoolDecay()

Returns
void

Reimplemented from CBMModuleBase.

◆ F6()

double F6 ( double  m,
double  n,
double  maxVolume 
)
private

Return the Sphagnum slow pool base decay rate, applied on pool MossDecayModule.kss, given as m * ln(maxVolume) + n

Parameters
mdouble
ndouble
maxVolumedouble
Returns
double

◆ F7()

double F7 ( double  baseDecayRate,
double  meanAnnualTemperature,
double  q10 
)
private

Applied decay rate to all moss pools :kff, kfs, ksf, kss, given as (baseDecayRate * (e ^ ((meanAnnualTemperature - 10) * (ln(q10) * 0.1))

Parameters
baseDecayRatedouble
meanAnnualTemperaturedouble
q10double
Returns
double

◆ moduleType()

flint::ModuleTypes moduleType ( )
override

◆ subscribe()

void subscribe ( NotificationCenter &  notificationCenter)
override

Subscribe to the signals LocalDomainInit, TimingInit and TimingStep

Parameters
notificationCenterNotificationCenter&
Returns
void

◆ updateMossAppliedDecayParameters()

void updateMossAppliedDecayParameters ( double  standMaximumVolume,
double  meanAnnualTemperature 
)
private

Update moss pool base decay rate based on mean annual temperature and q10 value

Assign MossDecayModule.kss, sphagnum slow decay rate, result of MossDecayModule.F6() with arguments MossDecayModule.m, MossDecayModule.n and parameter standMaximumVolume
MossDecayModule.akff, applied feather moss fast pool applied decay rate, the result of MossDecayModule.F7() with arguments MossDecayModule.kff, parameter meanAnnualTemperature and MossDecayModule.q10
MossDecayModule.akfs, applied feather moss slow pool applied decay rate, the result of MossDecayModule.F7() with arguments MossDecayModule.kfs, parameter meanAnnualTemperature and MossDecayModule.q10
MossDecayModule.aksf, applied sphagnum fast pool applied decay rate, the result of MossDecayModule.F7() with arguments MossDecayModule.ksf, parameter meanAnnualTemperature and MossDecayModule.q10
MossDecayModule.akss, applied sphagnum slow pool applied decay rate, the result of MossDecayModule.F7() with arguments MossDecayModule.kss, parameter meanAnnualTemperature and MossDecayModule.q10

Parameters
standMaximumVolumedouble
meanAnnualTemperaturedouble
Returns
void

Member Data Documentation

◆ _CO2

const flint::IPool* _CO2 = nullptr
private

◆ _featherMossFast

const flint::IPool* _featherMossFast = nullptr
private

◆ _featherMossSlow

const flint::IPool* _featherMossSlow = nullptr
private

◆ _gcFactory

std::shared_ptr<StandGrowthCurveFactory> _gcFactory
private

◆ _mossParameters

flint::IVariable* _mossParameters
private

◆ _sphagnumMossFast

const flint::IPool* _sphagnumMossFast = nullptr
private

◆ _sphagnumMossSlow

const flint::IPool* _sphagnumMossSlow = nullptr
private

◆ akff

double akff
private

◆ akfs

double akfs
private

◆ aksf

double aksf
private

◆ akss

double akss
private

◆ currentStandGCId

Int64 currentStandGCId
private

◆ fastToAirDecayRate

double fastToAirDecayRate
private

◆ fastToSlowTurnoverRate

double fastToSlowTurnoverRate
private

◆ kff

double kff
private

◆ kfs

double kfs
private

◆ ksf

double ksf
private

◆ kss

double kss
private

◆ m

double m
private

◆ meanAnnualTemperature

double meanAnnualTemperature
private

◆ n

double n
private

◆ q10

double q10
private

◆ runMoss

bool runMoss { false }
private

◆ tref

double tref
private

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