35 CNPair(
const double c,
const double n) {
C=c;
N=n; }
40 double CN() {
return N>0?
C/
N:0.; }
62 CNPool(
const double c,
const double n,
const double param_value) {
C=c;
N=n; mParameter=param_value; }
68 void addBiomass(
const double biomass,
const double CNratio,
const double parameter_value);
116 void addHarvest(
const Tree* tree,
const double remove_stem_pct,
const double remove_branch_pct,
const double remove_foliage_pct );
126 const double branch_to_snag,
const double branch_to_soil,
127 const double foliage_to_soil) { addBiomassPools(tree, stem_to_snag, stem_to_soil, branch_to_snag, branch_to_soil, foliage_to_soil);}
130 void addToSoil(
const Species *species,
const CNPair &woody_pool,
const CNPair &litter_pool,
double woody_aboveground_C,
double fine_aboveground_C);
142 void addBiomassPools(
const Tree *tree,
const double stem_to_snag,
const double stem_to_soil,
const double branch_to_snag,
const double branch_to_soil,
const double foliage_to_soil);
143 double calculateClimateFactors();
144 double mClimateFactor;
147 int poolIndex(
const float dbh) {
if (dbh<mDBHLower)
return 0;
if (dbh>mDBHHigher)
return 2;
return 1;}
150 double mNumberOfSnags[3];
152 double mAvgHeight[3];
153 double mAvgVolume[3];
154 double mTimeSinceDeath[3];
156 double mCurrentKSW[3];
164 double mDeciduousFoliageLitter;
165 double mLabileFluxAbovegroundCarbon;
166 double mRefrFluxAbovegroundCarbon;
167 double mOtherWoodAbovegroundFrac;
168 double mTotalSnagCarbon;
173 CNPair mTotalToDisturbance;
174 static double mDBHLower, mDBHHigher;
175 static double mCarbonThreshold[3];
CNPair stores a duple of carbon and nitrogen (kg/ha) use addBiomass(biomass, cnratio) to add biomass;...
Definition: snag.h:31
double CN()
current CN ratio
Definition: snag.h:40
const CNPair operator-(const CNPair &p2) const
return the difference of two pools
Definition: snag.h:51
static void setCFraction(const double fraction)
set the global fraction of carbon of biomass
Definition: snag.h:34
bool isEmpty() const
returns true if pool is empty
Definition: snag.h:36
void addBiomass(const double biomass, const double CNratio)
add biomass to the pool (kg dry mass/ha); CNratio is used to calculate the N-Content,...
Definition: snag.h:46
void operator+=(const CNPair &s)
add contents of a pool
Definition: snag.h:48
bool isValid() const
return true if pool is valid (content of C or N >=0)
Definition: snag.h:37
double C
Definition: snag.h:38
double N
Definition: snag.h:39
static double biomassCFraction
Definition: snag.h:54
CNPair()
Definition: snag.h:33
CNPair(const double c, const double n)
Definition: snag.h:35
double biomass() const
retrieve the amount of biomass (kg/ha). Uses the global C-fraciton. Soil pools are in t/ha!...
Definition: snag.h:43
const CNPair operator*(const double factor) const
return the pool multiplied with 'factor'
Definition: snag.h:52
void clear()
Definition: snag.h:41
const CNPair operator+(const CNPair &p2) const
return the sum of two pools
Definition: snag.h:50
void operator*=(const double factor)
Multiply pool with 'factor'.
Definition: snag.h:49
CNPool provides (in addition to CNPair) also a weighted parameter value (e.g.
Definition: snag.h:59
void setParameter(const double value)
Definition: snag.h:70
void operator+=(const CNPool &s)
Definition: snag.cpp:60
CNPool()
Definition: snag.h:61
double parameter() const
get weighting parameter
Definition: snag.h:63
void clear()
Definition: snag.h:65
void add(const CNPair &s, const double parameter_value)
convenience function
Definition: snag.h:69
void addBiomass(const double biomass, const double CNratio, const double parameter_value)
add biomass with a specific 'CNRatio' and 'parameter_value'
Definition: snag.cpp:49
CNPool(const double c, const double n, const double param_value)
Definition: snag.h:62
const CNPool operator*(const double factor) const
return the pool multiplied with 'factor'
Definition: snag.h:73
ResourceUnit is the spatial unit that encapsulates a forest stand and links to several environmental ...
Definition: resourceunit.h:49
Snag deals with carbon / nitrogen fluxes from the forest until the reach soil pools.
Definition: snag.h:79
void addHarvest(const Tree *tree, const double remove_stem_pct, const double remove_branch_pct, const double remove_foliage_pct)
add residual biomass of 'tree' after harvesting.
Definition: snag.cpp:527
void management(const double factor)
cut down swd and move to soil pools
Definition: snag.cpp:603
double otherWoodAbovegroundFraction() const
fraction of branches in 'other' pools (0..1)
Definition: snag.h:98
QList< QVariant > debugList()
return a debug output
Definition: snag.cpp:159
const CNPool & refractoryFlux() const
deadwood flux to the soil (kg/ha)
Definition: snag.h:91
void newYear()
to be executed at the beginning of a simulation year. This cleans up the transfer pools.
Definition: snag.cpp:184
const CNPair & totalOtherWood() const
sum of C and N in other woody pools (branches + coarse roots) kg/RU
Definition: snag.h:97
void removeCarbon(const double factor)
disturbance function: remove the fraction of 'factor' of biomass from the SWD pools; 0: remove nothin...
Definition: snag.cpp:581
const CNPair & fluxToAtmosphere() const
total kg/RU heterotrophic respiration / flux to atm
Definition: snag.h:99
double labileFluxAbovegroundCarbon() const
C input to the labile flux from aboveground sources (kg/ha)
Definition: snag.h:92
void scaleInitialState()
used to scale the input to the actual area of the resource unit
Definition: snag.cpp:145
void calculateYear()
to be called at the end of the year (after tree growth, harvesting). Calculates flow to the soil.
Definition: snag.cpp:239
double totalCarbon() const
total carbon in snags (kg/RU): not scaled to 1ha!!
Definition: snag.h:95
const CNPair & fluxToExtern() const
total kg/RU harvests
Definition: snag.h:100
Snag()
Definition: snag.cpp:96
double refractoryFluxAbovegroundCarbon() const
C input of the input to the refractory (woody) flux from aboveground sources (kg/ha)
Definition: snag.h:93
void addBiomassToSoil(const CNPool &woody_pool, const CNPool &litter_pool)
add non-tree biomass to soil (litter input). Inputs in kg/ha. decomposition rate in parameter value o...
Definition: snag.cpp:569
void addMortality(const Tree *tree)
adds the 'tree' to the appropriate Snag pools.
Definition: snag.cpp:478
double freshDeciduousFoliage() const
deciduous foliage litter (kg/ha) from the previous year
Definition: snag.h:104
bool isStateEmpty() const
Definition: snag.h:88
const CNPool & labileFlux() const
litter flux to the soil (kg/ha)
Definition: snag.h:90
bool isEmpty() const
Definition: snag.h:89
void addTurnoverWood(const Species *species, const double woody_biomass)
Definition: snag.cpp:375
void addDisturbance(const Tree *tree, const double stem_to_snag, const double stem_to_soil, const double branch_to_snag, const double branch_to_soil, const double foliage_to_soil)
a tree dies and the biomass of the tree is split between snags/soils/removals
Definition: snag.h:125
void setup(const ResourceUnit *ru)
initial setup routine.
Definition: snag.cpp:102
static void setupThresholds(const double lower, const double upper)
setup class thresholds, needs to be called only once... (static)
Definition: snag.cpp:79
const CNPair & fluxToDisturbance() const
total kg/RU due to disturbance (e.g. fire)
Definition: snag.h:101
const CNPair & totalSWD() const
sum of C and N in SWD pools (stems) kg/RU
Definition: snag.h:96
void addToSoil(const Species *species, const CNPair &woody_pool, const CNPair &litter_pool, double woody_aboveground_C, double fine_aboveground_C)
add (died) biomass from the regeneration layer
Definition: snag.cpp:557
void addTurnoverLitter(const Species *species, const double litter_foliage, const double litter_fineroot)
add for a tree with diameter
Definition: snag.cpp:362
double climateFactor() const
the 're' climate factor to modify decay rates (also used in ICBM/2N model)
Definition: snag.h:94
way to save/load the current state of the model to a database.
Definition: snapshot.h:35
The behavior and general properties of tree species.
Definition: species.h:75
A tree is the basic simulation entity of iLand and represents a single tree.
Definition: tree.h:44