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

#include <mossgrowthmodule.h>

Inheritance diagram for MossGrowthModule:
Inheritance graph
Collaboration diagram for MossGrowthModule:
Collaboration graph

Public Member Functions

 MossGrowthModule (std::shared_ptr< StandGrowthCurveFactory > gcFactory)
 
virtual ~MossGrowthModule ()=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 F1 (double a, double b, double volume)
 
double F2 (double c, double d, int age, double openNess)
 
double F3 (double e, double f, int age, double openNess)
 
double F4 (double g, double h, double openNess)
 
double F5 (double i, double j, double l, double openNess)
 
void doMossGrowth (int mossAge, double standMerchVolume)
 

Private Attributes

std::shared_ptr< StandGrowthCurveFactory_gcFactory
 
flint::IVariable * _mossParameters = nullptr
 
const flint::IPool * _atmosphere = nullptr
 
const flint::IPool * _featherMossLive = nullptr
 
const flint::IPool * _sphagnumMossLive = nullptr
 
flint::IVariable * _regenDelay = nullptr
 
flint::IVariable * _spinupMossOnly = nullptr
 
flint::IVariable * _age = nullptr
 
bool runMoss { false }
 
Int64 currentStandGCId { -1 }
 
double a { 0.0 }
 Parameter for F1
More...
 
double b { 0.0 }
 Parameter for F1
More...
 
double c { 0.0 }
 Parameter for F2
More...
 
double d { 0.0 }
 Parameter for F2 More...
 
double e { 0.0 }
 Parameter for F3 More...
 
double f { 0.0 }
 Parameter for F3
More...
 
double g { 0.0 }
 Parameter for F4
More...
 
double h { 0.0 }
 Parameter for F4
More...
 
double i { 0.0 }
 Parameter for F5
More...
 
double j { 0.0 }
 Parameter for F5 More...
 
double l { 0.0 }
 Parameter for F5
More...
 

Constructor & Destructor Documentation

◆ MossGrowthModule()

MossGrowthModule ( std::shared_ptr< StandGrowthCurveFactory gcFactory)

◆ ~MossGrowthModule()

virtual ~MossGrowthModule ( )
virtualdefault

Member Function Documentation

◆ configure()

void configure ( const DynamicObject &  config)
override

Configuration function

Parameters
configconst DynamicObject&
Returns
void

◆ doLocalDomainInit()

void doLocalDomainInit ( )
overridevirtual

Initialise MossGrowthModule._atmosphere, MossGrowthModule._featherMossLive, MossGrowthModule._sphagnumMossLive value of "Atmosphere", "FeatherMossLive", "FeatherMossSlow", "SphagnumMossLive" in _landUnitData

Initialise MossGrowthModule._mossParameters, _regenDelay, _age as variables "moss_parameters", "regen_delay" and "age" in _landUnitData,
MossGrowthModule.a, MossGrowthModule.b, MossGrowthModule.c, MossGrowthModule.d, MossGrowthModule.e, MossGrowthModule.f, MossGrowthModule.g, MossGrowthModule.h, MossGrowthModule.i, MossGrowthModule.j, MossGrowthModule.i values of "a", "b", "c", "d", "e", "f", "g", "h", "i", "j" in _landUnitData

Returns
void

Reimplemented from CBMModuleBase.

◆ doMossGrowth()

void doMossGrowth ( int  mossAge,
double  standMerchVolume 
)
private

Invoke createStockOperation() on _landUnitData
Assign variable canopyOpenness result of MossGrowthModule.F1() with arguments MossGrowthModule.a, MossGrowthModule.b, parameter standMerchVolume,
groundCoverFeatherMoss result of MossGrowthModule.F2() with arguments MossGrowthModule.c, MossGrowthModule.d, parameter mossAge and variable canopyOpenness,
groundCoverSphagnumMoss result of MossGrowthModule.F3() with arguments MossGrowthModule.e, MossGrowthModule.f, parameter mossAge and variable canopyOpenness,
nppFeatherMoss result of MossGrowthModule.F4() with arguments MossGrowthModule.g, MossGrowthModule.h, and variable canopyOpenness,
nppSphagnumMoss result of MossGrowthModule.F5() with arguments MossGrowthModule.i, MossGrowthModule.j, MossGrowthModule.l and variable canopyOpenness,
Add transfers between source MossGrowthModule._atmosphere to sink MossGrowthModule._featherMossLive with transfer value nppFeatherMoss * groundCoverFeatherMoss / 100.0,
source MossGrowthModule._atmosphere to sink MossGrowthModule._sphagnumMossLive with transfer value nppSphagnumMoss * groundCoverSphagnumMoss / 100.0

Invoke submitOperation() on _landUnitData to submit the transfers

Parameters
mossAgeint
standMerchVolumedouble
Returns
void

◆ doTimingInit()

void doTimingInit ( )
overridevirtual

If variable "enable_moss" exists in _landUnitData and it has a value, invoke Helper.runMoss() with arguments as value of variables "growth_curve_id", "moss_leading_species" and "leading_species" in _landUnitData
Assign MossGrowthModule.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 the value of MossGrowthModule._regenDelay is greater than 0, return
If MossGrowthModule.runMoss is true, get the total stand volume at MossGrowthModule._age as : invoke StandGrowthCurve.getStandTotalVolumeAtAge() with argument MossGrowthModule._age, on the result of StandGrowthCurveFactory.getStandGrowthCurve() on MossGrowthModule._gcFactory with argument as the value of variable "growth_curve_id" in _landUnitData
Invoke MossGrowthModule.doMossGrowth() with arguments age, total stand volume at MossGrowthModule._age
When moss module is spinning up, i.e MossGrowthModule.spinupMossOnly is true, increment the value of spinupMossOnly._age by 1 and update it

Returns
void

Reimplemented from CBMModuleBase.

◆ F1()

double F1 ( double  a,
double  b,
double  volume 
)
private

Return Canopy openNess

Canopy openNess, O(t) as a function of merchant volume given a value 60.0 if parameter volume = 0, else O(t) = 10 ^ (((a) * (log(volume)) + b)

Parameters
adouble
bdouble
volumedouble
Returns
double

◆ F2()

double F2 ( double  c,
double  d,
int  age,
double  openNess 
)
private

Return Feather moss ground cover

Feather moss ground cover, given a value 0 if parameter age < 0, a value 100 if parameter openNess > 70.0, else GCFm(t) = c * openNess + d

Parameters
cdouble
ddouble
ageint
openNessdouble
Returns
double

◆ F3()

double F3 ( double  e,
double  f,
int  age,
double  openNess 
)
private

Return Sphagnum ground cover

Feather moss ground cover, given a value 0 if parameter age < 0, a value 100 if parameter openNess > 70.0, else GCSp(t) = e * openNess + f

Parameters
edouble
fdouble
ageint
openNessdouble
Returns
double

◆ F4()

double F4 ( double  g,
double  h,
double  openNess 
)
private

Return Feather moss NPP

Feather moss NPP, given a value 0 if parameter age < 0, a value 100 if parameter openNess > 70.0, else GCSp(t) = e * openNess + f

Parameters
edouble
fdouble
openNessdouble
Returns
double

◆ F5()

double F5 ( double  i,
double  j,
double  l,
double  openNess 
)
private

Return Sphagnum NPP

Sphagnum NPP, given as NPPSp = i * (openNess ^ 2) + j * openNess + l

Parameters
idouble
jdouble
ldouble
openNessdouble
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

Member Data Documentation

◆ _age

flint::IVariable* _age = nullptr
private

◆ _atmosphere

const flint::IPool* _atmosphere = nullptr
private

◆ _featherMossLive

const flint::IPool* _featherMossLive = nullptr
private

◆ _gcFactory

std::shared_ptr<StandGrowthCurveFactory> _gcFactory
private

◆ _mossParameters

flint::IVariable* _mossParameters = nullptr
private

◆ _regenDelay

flint::IVariable* _regenDelay = nullptr
private

◆ _sphagnumMossLive

const flint::IPool* _sphagnumMossLive = nullptr
private

◆ _spinupMossOnly

flint::IVariable* _spinupMossOnly = nullptr
private

◆ a

double a { 0.0 }
private

Parameter for F1


◆ b

double b { 0.0 }
private

Parameter for F1


◆ c

double c { 0.0 }
private

Parameter for F2


◆ currentStandGCId

Int64 currentStandGCId { -1 }
private

◆ d

double d { 0.0 }
private

Parameter for F2


◆ e

double e { 0.0 }
private

Parameter for F3


◆ f

double f { 0.0 }
private

Parameter for F3


◆ g

double g { 0.0 }
private

Parameter for F4


◆ h

double h { 0.0 }
private

Parameter for F4


◆ i

double i { 0.0 }
private

Parameter for F5


◆ j

double j { 0.0 }
private

Parameter for F5


◆ l

double l { 0.0 }
private

Parameter for F5


◆ runMoss

bool runMoss { false }
private

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