26#include <QtCore/QVector>
27#include <QtCore/QRectF>
76 const QList<ResourceUnitSpecies*> &
ruSpecies()
const {
return mRUSpecies; }
77 QVector<Tree> &
trees() {
return mTrees; }
78 const QVector<Tree> &
constTrees()
const {
return mTrees; }
84 int index()
const {
return mIndex; }
85 int id()
const {
return mID; }
88 double area()
const {
return mPixelCount*100; }
94 double leafArea()
const {
return mAggregatedLA; }
95 double interceptedArea(
const double LA,
const double LightResponse) {
return mEffectiveArea_perWLA * LA * LightResponse; }
96 const double &
LRImodifier()
const {
return mLRI_modification; }
116 void addWLA(
const float LA,
const float LRI) { mAggregatedWLA += LA*LRI; mAggregatedLA += LA; }
117 void addLR(
const float LA,
const float LightResponse) { mAggregatedLR += LA*LightResponse; }
120 void addTreeAging(
const double leaf_area,
const double aging_factor) { mAverageAging += leaf_area*aging_factor; }
123 void countStockedPixel(
bool pixelIsStocked) { mPixelCount++;
if (pixelIsStocked) mStockedPixelCount++; }
144 void updateSVDState();
153 QList<ResourceUnitSpecies*> mRUSpecies;
154 QVector<Tree> mTrees;
157 QPoint mCornerOffset;
158 double mAggregatedLA;
159 double mAggregatedWLA;
160 double mAggregatedLR;
161 double mEffectiveArea;
162 double mEffectiveArea_perWLA;
163 double mLRI_modification;
164 double mAverageAging;
165 float *mSaplingHeightMap;
167 RUSVDState(): localComposition(0), midDistanceComposition(0) {}
168 ~RUSVDState() {
if (localComposition) {
delete localComposition;
delete midDistanceComposition; } }
170 qint16 previousStateId;
173 QVector<float> *localComposition;
174 QVector<float> *midDistanceComposition;
176 void clear() { stateId=previousStateId=time=previousTime=0; }
181 int mStockedPixelCount;
183 double mStockableArea;
186 bool mCreateDebugOutput;
Climate handles climate input data and performs some basic related calculations on that data.
Definition: climate.h:66
Definition: expressionwrapper.h:58
ResourceUnit is the spatial unit that encapsulates a forest stand and links to several environmental ...
Definition: resourceunit.h:49
const StandStatistics & statistics() const
Definition: resourceunit.h:81
double interceptedArea(const double LA, const double LightResponse)
Definition: resourceunit.h:95
const QRectF & boundingBox() const
Definition: resourceunit.h:86
int newTreeIndex()
returns the index of a newly inserted tree
Definition: resourceunit.cpp:253
int svdStateId() const
the Id of the state the resource unit is in
Definition: resourceunit.h:101
bool hasDiedTrees() const
if true, the resource unit has dead trees and needs maybe some cleanup
Definition: resourceunit.h:114
void yearEnd()
called at the end of a year (after regeneration??)
Definition: resourceunit.cpp:441
void addTreeAgingForAllTrees()
calculate average tree aging for all trees of a RU. Used directly after stand initialization.
Definition: resourceunit.cpp:506
void recreateStandStatistics(bool recalculate_stats)
re-build stand statistics after some change happened to the resource unit
Definition: resourceunit.cpp:555
void setClimate(Climate *climate)
Definition: resourceunit.h:56
const QPoint & cornerPointOffset() const
coordinates on the LIF grid of the upper left corner of the RU
Definition: resourceunit.h:87
void addLR(const float LA, const float LightResponse)
Definition: resourceunit.h:117
void countStockedPixel(bool pixelIsStocked)
Definition: resourceunit.h:123
Snag * snag() const
access the snag object
Definition: resourceunit.h:64
SaplingCell * saplingCell(const QPoint &lifCoords) const
return a pointer to the 2x2m SaplingCell located at 'lif'
Definition: resourceunit.cpp:151
double topHeight(bool &rIrregular) const
calculate the top tree height (as 90th percentile of the top heights on the 10m pixels),...
Definition: resourceunit.cpp:220
void beforeGrow()
called before growth of individuals
Definition: resourceunit.cpp:426
Tree & newTree()
returns a modifiable reference to a free space inside the tree-vector. should be used for tree-init.
Definition: resourceunit.cpp:244
void addTreeAging(const double leaf_area, const double aging_factor)
aggregate the tree aging values (weighted by leaf area)
Definition: resourceunit.h:120
int svdPreviousStateId() const
the Id of the state the resource unit was previously in
Definition: resourceunit.h:103
void treeDied()
sets the flag that indicates that the resource unit contains dead trees
Definition: resourceunit.h:113
void setID(const int id)
Definition: resourceunit.h:58
void calculateCarbonCycle()
calculate snag dynamics at the end of a year
Definition: resourceunit.cpp:582
const QList< ResourceUnitSpecies * > & ruSpecies() const
Definition: resourceunit.h:76
QVector< Tree > & trees()
reference to the tree list.
Definition: resourceunit.h:77
double averageAging() const
leaf area weighted average aging
Definition: resourceunit.h:97
void setCreateDebugOutput(const bool do_dbg)
enable/disable output generation for RU
Definition: resourceunit.h:127
double stockedArea() const
get the stocked area in m2
Definition: resourceunit.h:89
SaplingCell * saplingCellArray() const
access the array of sapling-cells
Definition: resourceunit.h:66
const WaterCycle * waterCycle() const
water model of the unit
Definition: resourceunit.h:63
void snagNewYear()
clean transfer pools
Definition: resourceunit.h:132
double area() const
get the resource unit area in m2
Definition: resourceunit.h:88
double productiveArea() const
TotalArea - Unstocked Area - loss due to BeerLambert (m2)
Definition: resourceunit.h:91
bool shouldCreateDebugOutput() const
is debug output enabled for the RU?
Definition: resourceunit.h:128
const ResourceUnitVariables & resouceUnitVariables() const
access to variables that are specific to resourceUnit (e.g. nitrogenAvailable)
Definition: resourceunit.h:80
void calculateInterceptedArea()
function that distributes effective interception area according to the weight of Light response and L...
Definition: resourceunit.cpp:414
ResourceUnit(const int index)
Definition: resourceunit.cpp:69
double leafArea() const
total leaf area of resource unit (m2)
Definition: resourceunit.h:94
void setSpeciesSet(SpeciesSet *set)
set species and setup the species-per-RU-data
Definition: resourceunit.cpp:188
Tree * tree(const int index)
get pointer to a tree
Definition: resourceunit.h:79
const Climate * climate() const
link to the climate on this resource unit
Definition: resourceunit.h:61
ResourceUnitSpecies * resourceUnitSpecies(const int species_index) const
get RU-Species-container with index 'species_index' from the RU
Definition: resourceunit.h:75
void setStockableArea(const double area)
set stockable area (m2)
Definition: resourceunit.h:126
~ResourceUnit()
Definition: resourceunit.cpp:49
int id() const
Definition: resourceunit.h:85
int svdStateTime() const
the number of years the RU is already in the current state svdStateId()
Definition: resourceunit.h:105
const ResourceUnitSpecies * constResourceUnitSpecies(const Species *species) const
get RU-Species-container of species from the RU
Definition: resourceunit.cpp:215
void addWLA(const float LA, const float LRI)
addWLA() is called by each tree to aggregate the total weighted leaf area on a unit
Definition: resourceunit.h:116
Soil * soil() const
access the soil model
Definition: resourceunit.h:65
void newYear()
reset values for a new simulation year
Definition: resourceunit.cpp:302
void production()
called after the LIP/LIF calc, before growth of individual trees. Production (3PG),...
Definition: resourceunit.cpp:336
ResourceUnitSpecies & resourceUnitSpecies(const Species *species)
get RU-Species-container of species from the RU
Definition: resourceunit.cpp:210
int index() const
Definition: resourceunit.h:84
const QVector< Tree > & constTrees() const
reference to the (const) tree list.
Definition: resourceunit.h:78
void afterGrow()
called after the growth of individuals
Definition: resourceunit.cpp:432
double saplingCoveredArea(bool below130cm) const
return the area (m2) which is covered by saplings (cells >0 saplings) if below130cm is false,...
Definition: resourceunit.cpp:161
void setup()
setup operations after the creation of the model space.
Definition: resourceunit.cpp:95
SpeciesSet * speciesSet() const
get SpeciesSet this RU links to.
Definition: resourceunit.h:62
int svdPreviousTime() const
the number of years that the RU was in the previous state svdPreviousStateId()
Definition: resourceunit.h:107
double stockableArea() const
total stockable area in m2
Definition: resourceunit.h:90
void cleanTreeList()
remove dead trees from the tree storage.
Definition: resourceunit.cpp:264
void createStandStatistics()
helping function to create an initial state for stand statistics
Definition: resourceunit.cpp:518
double leafAreaIndex() const
Total Leaf Area Index (m2/m2) of trees>4m.
Definition: resourceunit.h:93
const double & LRImodifier() const
Definition: resourceunit.h:96
void setBoundingBox(const QRectF &bb)
Definition: resourceunit.cpp:144
The class contains data available at ResourceUnit x Species scale.
Definition: resourceunitspecies.h:34
SVDIndicatorOut saves (compressed) indicator data for SVD.
Definition: svdout.h:63
SVDStateOut saves state changes for SVD.
Definition: svdout.h:35
Definition: svdstate.h:49
Snag deals with carbon / nitrogen fluxes from the forest until the reach soil pools.
Definition: snag.h:79
void newYear()
to be executed at the beginning of a simulation year. This cleans up the transfer pools.
Definition: snag.cpp:184
implementation of the ICBM/2N soil carbon and nitrogen dynamics model.
Definition: soil.h:29
The behavior and general properties of tree species.
Definition: species.h:75
A SpeciesSet acts as a container for individual Species objects.
Definition: speciesset.h:30
Collects information on stand level for each tree species.
Definition: standstatistics.h:28
A tree is the basic simulation entity of iLand and represents a single tree.
Definition: tree.h:44
simulates the water cycle on a ResourceUnit.
Definition: watercycle.h:106
Definition: resourceunit.h:38
double cumCarbonUptake
NPP (kg C/ha)
Definition: resourceunit.h:41
double carbonUptake
Definition: resourceunit.h:44
double carbonToAtm
Definition: resourceunit.h:44
double cumNEP
cumulative ecosystem productivity (kg C/ha), i.e. cumulative(NPP-losses(atm,harvest)
Definition: resourceunit.h:43
double NEP
values of the current year (NPP, flux to atmosphere, net ecosystem prod., all values in kgC/ha)
Definition: resourceunit.h:44
static double nitrogenAvailableDelta
delta which is added to nitrogenAvailable every year (and can be changed via Time Events)
Definition: resourceunit.h:45
ResourceUnitVariables()
Definition: resourceunit.h:39
double nitrogenAvailable
nitrogen content (kg/m2/year)
Definition: resourceunit.h:40
double cumCarbonToAtm
total flux of carbon to atmosphere (kg C/ha)
Definition: resourceunit.h:42
Definition: saplings.h:53