iLand
Classes | Public Member Functions | Friends | List of all members
ResourceUnit Class Reference

ResourceUnit is the spatial unit that encapsulates a forest stand and links to several environmental components (Climate, Soil, Water, ...). More...

#include <resourceunit.h>

Public Member Functions

 ResourceUnit (const int index)
 
 ~ResourceUnit ()
 
void setup ()
 setup operations after the creation of the model space. More...
 
void setSpeciesSet (SpeciesSet *set)
 set species and setup the species-per-RU-data More...
 
void setClimate (Climate *climate)
 
void setBoundingBox (const QRectF &bb)
 
void setID (const int id)
 
const Climateclimate () const
 link to the climate on this resource unit More...
 
SpeciesSetspeciesSet () const
 get SpeciesSet this RU links to. More...
 
const WaterCyclewaterCycle () const
 water model of the unit More...
 
Snagsnag () const
 access the snag object More...
 
Soilsoil () const
 access the soil model More...
 
SaplingCellsaplingCellArray () const
 access the array of sapling-cells More...
 
SaplingCellsaplingCell (const QPoint &lifCoords) const
 return a pointer to the 2x2m SaplingCell located at 'lif' More...
 
double saplingCoveredArea (bool below130cm) const
 return the area (m2) which is covered by saplings (cells >0 saplings) if below130cm is false, then only pixels with saplings >1.3m are counted; otherwise pixel are counted when saplings < 1.3m are present or when grass cover is present More...
 
ResourceUnitSpeciesresourceUnitSpecies (const Species *species)
 get RU-Species-container of species from the RU More...
 
const ResourceUnitSpeciesconstResourceUnitSpecies (const Species *species) const
 get RU-Species-container of species from the RU More...
 
ResourceUnitSpeciesresourceUnitSpecies (const int species_index) const
 get RU-Species-container with index 'species_index' from the RU More...
 
const QList< ResourceUnitSpecies * > & ruSpecies () const
 
QVector< Tree > & trees ()
 reference to the tree list. More...
 
const QVector< Tree > & constTrees () const
 reference to the (const) tree list. More...
 
Treetree (const int index)
 get pointer to a tree More...
 
const ResourceUnitVariablesresouceUnitVariables () const
 access to variables that are specific to resourceUnit (e.g. nitrogenAvailable) More...
 
const StandStatisticsstatistics () const
 
int index () const
 
int id () const
 
const QRectF & boundingBox () const
 
const QPoint & cornerPointOffset () const
 coordinates on the LIF grid of the upper left corner of the RU More...
 
double area () const
 get the resource unit area in m2 More...
 
double stockedArea () const
 get the stocked area in m2 More...
 
double stockableArea () const
 total stockable area in m2 More...
 
double productiveArea () const
 TotalArea - Unstocked Area - loss due to BeerLambert (m2) More...
 
double leafAreaIndex () const
 Total Leaf Area Index (m2/m2) of trees>4m. More...
 
double leafArea () const
 total leaf area of resource unit (m2) More...
 
double interceptedArea (const double LA, const double LightResponse)
 
const double & LRImodifier () const
 
double averageAging () const
 leaf area weighted average aging More...
 
double topHeight (bool &rIrregular) const
 calculate the top tree height (as 90th percentile of the top heights on the 10m pixels), 'rIrregular' is set to true when 50% of the area < 50% of topheight More...
 
int svdStateId () const
 the Id of the state the resource unit is in More...
 
int svdPreviousStateId () const
 the Id of the state the resource unit was previously in More...
 
int svdStateTime () const
 the number of years the RU is already in the current state svdStateId() More...
 
int svdPreviousTime () const
 the number of years that the RU was in the previous state svdPreviousStateId() More...
 
TreenewTree ()
 returns a modifiable reference to a free space inside the tree-vector. should be used for tree-init. More...
 
int newTreeIndex ()
 returns the index of a newly inserted tree More...
 
void cleanTreeList ()
 remove dead trees from the tree storage. More...
 
void treeDied ()
 sets the flag that indicates that the resource unit contains dead trees More...
 
bool hasDiedTrees () const
 if true, the resource unit has dead trees and needs maybe some cleanup More...
 
void addWLA (const float LA, const float LRI)
 addWLA() is called by each tree to aggregate the total weighted leaf area on a unit More...
 
void addLR (const float LA, const float LightResponse)
 
void calculateInterceptedArea ()
 function that distributes effective interception area according to the weight of Light response and LeafArea of the indivudal ( More...
 
void addTreeAging (const double leaf_area, const double aging_factor)
 aggregate the tree aging values (weighted by leaf area) More...
 
void addTreeAgingForAllTrees ()
 calculate average tree aging for all trees of a RU. Used directly after stand initialization. More...
 
void countStockedPixel (bool pixelIsStocked)
 
void createStandStatistics ()
 helping function to create an initial state for stand statistics More...
 
void recreateStandStatistics (bool recalculate_stats)
 re-build stand statistics after some change happened to the resource unit More...
 
void setStockableArea (const double area)
 set stockable area (m2) More...
 
void setCreateDebugOutput (const bool do_dbg)
 enable/disable output generation for RU More...
 
bool shouldCreateDebugOutput () const
 is debug output enabled for the RU? More...
 
void snagNewYear ()
 clean transfer pools More...
 
void calculateCarbonCycle ()
 calculate snag dynamics at the end of a year More...
 
void newYear ()
 reset values for a new simulation year More...
 
void production ()
 called after the LIP/LIF calc, before growth of individual trees. Production (3PG), Water-cycle More...
 
void beforeGrow ()
 called before growth of individuals More...
 
void afterGrow ()
 called after the growth of individuals More...
 
void yearEnd ()
 called at the end of a year (after regeneration??) More...
 

Friends

class RUWrapper
 
class SVDStates
 
class SVDStateOut
 
class SVDIndicatorOut
 

Detailed Description

ResourceUnit is the spatial unit that encapsulates a forest stand and links to several environmental components (Climate, Soil, Water, ...).

A resource unit has a size of (currently) 100x100m. Many processes in iLand operate on the level of a ResourceUnit. Each resource unit has the same Climate and other properties (e.g. available nitrogen). Proceses on this level are, inter alia, NPP Production (see Production3PG), water calculations (WaterCycle), the modeling of dead trees (Snag) and soil processes (Soil).

Constructor & Destructor Documentation

◆ ResourceUnit()

ResourceUnit::ResourceUnit ( const int  index)

◆ ~ResourceUnit()

ResourceUnit::~ResourceUnit ( )

Member Function Documentation

◆ addLR()

void ResourceUnit::addLR ( const float  LA,
const float  LightResponse 
)
inline

◆ addTreeAging()

void ResourceUnit::addTreeAging ( const double  leaf_area,
const double  aging_factor 
)
inline

aggregate the tree aging values (weighted by leaf area)

◆ addTreeAgingForAllTrees()

void ResourceUnit::addTreeAgingForAllTrees ( )

calculate average tree aging for all trees of a RU. Used directly after stand initialization.

◆ addWLA()

void ResourceUnit::addWLA ( const float  LA,
const float  LRI 
)
inline

addWLA() is called by each tree to aggregate the total weighted leaf area on a unit

◆ afterGrow()

void ResourceUnit::afterGrow ( )

called after the growth of individuals

◆ area()

double ResourceUnit::area ( ) const
inline

get the resource unit area in m2

◆ averageAging()

double ResourceUnit::averageAging ( ) const
inline

leaf area weighted average aging

◆ beforeGrow()

void ResourceUnit::beforeGrow ( )

called before growth of individuals

◆ boundingBox()

const QRectF & ResourceUnit::boundingBox ( ) const
inline

◆ calculateCarbonCycle()

void ResourceUnit::calculateCarbonCycle ( )

calculate snag dynamics at the end of a year

◆ calculateInterceptedArea()

void ResourceUnit::calculateInterceptedArea ( )

function that distributes effective interception area according to the weight of Light response and LeafArea of the indivudal (

See also
production())

◆ cleanTreeList()

void ResourceUnit::cleanTreeList ( )

remove dead trees from the tree storage.

remove dead trees from tree list reduce size of vector if lots of space is free tests showed that this way of cleanup is very fast, because no memory allocations are performed (simple memmove()) when trees are moved.

◆ climate()

const Climate * ResourceUnit::climate ( ) const
inline

link to the climate on this resource unit

◆ constResourceUnitSpecies()

const ResourceUnitSpecies * ResourceUnit::constResourceUnitSpecies ( const Species species) const

get RU-Species-container of species from the RU

◆ constTrees()

const QVector< Tree > & ResourceUnit::constTrees ( ) const
inline

reference to the (const) tree list.

◆ cornerPointOffset()

const QPoint & ResourceUnit::cornerPointOffset ( ) const
inline

coordinates on the LIF grid of the upper left corner of the RU

◆ countStockedPixel()

void ResourceUnit::countStockedPixel ( bool  pixelIsStocked)
inline

◆ createStandStatistics()

void ResourceUnit::createStandStatistics ( )

helping function to create an initial state for stand statistics

refresh of tree based statistics.

WARNING: this function is only called once (during startup). see function "yearEnd()" above!!!

◆ hasDiedTrees()

bool ResourceUnit::hasDiedTrees ( ) const
inline

if true, the resource unit has dead trees and needs maybe some cleanup

◆ id()

int ResourceUnit::id ( ) const
inline

◆ index()

int ResourceUnit::index ( ) const
inline

◆ interceptedArea()

double ResourceUnit::interceptedArea ( const double  LA,
const double  LightResponse 
)
inline

◆ leafArea()

double ResourceUnit::leafArea ( ) const
inline

total leaf area of resource unit (m2)

◆ leafAreaIndex()

double ResourceUnit::leafAreaIndex ( ) const
inline

Total Leaf Area Index (m2/m2) of trees>4m.

◆ LRImodifier()

const double & ResourceUnit::LRImodifier ( ) const
inline

◆ newTree()

Tree & ResourceUnit::newTree ( )

returns a modifiable reference to a free space inside the tree-vector. should be used for tree-init.

◆ newTreeIndex()

int ResourceUnit::newTreeIndex ( )

returns the index of a newly inserted tree

◆ newYear()

void ResourceUnit::newYear ( )

reset values for a new simulation year

◆ production()

void ResourceUnit::production ( )

called after the LIP/LIF calc, before growth of individual trees. Production (3PG), Water-cycle

production() is the "stand-level" part of the biomass production (3PG).

  • The amount of radiation intercepted by the stand is calculated
  • the water cycle is calculated
  • statistics for each species are cleared
  • The 3PG production for each species and ressource unit is called (calculates species-responses and NPP production) see also: http://iland-model.org/individual+tree+light+availability

◆ productiveArea()

double ResourceUnit::productiveArea ( ) const
inline

TotalArea - Unstocked Area - loss due to BeerLambert (m2)

◆ recreateStandStatistics()

void ResourceUnit::recreateStandStatistics ( bool  recalculate_stats)

re-build stand statistics after some change happened to the resource unit

recreate statistics.

This is necessary after events that changed the structure of the stand after the growth of trees (where stand statistics are updated). An example is after disturbances.

◆ resouceUnitVariables()

const ResourceUnitVariables & ResourceUnit::resouceUnitVariables ( ) const
inline

access to variables that are specific to resourceUnit (e.g. nitrogenAvailable)

◆ resourceUnitSpecies() [1/2]

ResourceUnitSpecies * ResourceUnit::resourceUnitSpecies ( const int  species_index) const
inline

get RU-Species-container with index 'species_index' from the RU

◆ resourceUnitSpecies() [2/2]

ResourceUnitSpecies & ResourceUnit::resourceUnitSpecies ( const Species species)

get RU-Species-container of species from the RU

◆ ruSpecies()

const QList< ResourceUnitSpecies * > & ResourceUnit::ruSpecies ( ) const
inline

◆ saplingCell()

SaplingCell * ResourceUnit::saplingCell ( const QPoint &  lifCoords) const

return a pointer to the 2x2m SaplingCell located at 'lif'

return the sapling cell at given LIF-coordinates

◆ saplingCellArray()

SaplingCell * ResourceUnit::saplingCellArray ( ) const
inline

access the array of sapling-cells

◆ saplingCoveredArea()

double ResourceUnit::saplingCoveredArea ( bool  below130cm) const

return the area (m2) which is covered by saplings (cells >0 saplings) if below130cm is false, then only pixels with saplings >1.3m are counted; otherwise pixel are counted when saplings < 1.3m are present or when grass cover is present

◆ setBoundingBox()

void ResourceUnit::setBoundingBox ( const QRectF &  bb)

◆ setClimate()

void ResourceUnit::setClimate ( Climate climate)
inline

◆ setCreateDebugOutput()

void ResourceUnit::setCreateDebugOutput ( const bool  do_dbg)
inline

enable/disable output generation for RU

◆ setID()

void ResourceUnit::setID ( const int  id)
inline

◆ setSpeciesSet()

void ResourceUnit::setSpeciesSet ( SpeciesSet set)

set species and setup the species-per-RU-data

◆ setStockableArea()

void ResourceUnit::setStockableArea ( const double  area)
inline

set stockable area (m2)

◆ setup()

void ResourceUnit::setup ( )

setup operations after the creation of the model space.

◆ shouldCreateDebugOutput()

bool ResourceUnit::shouldCreateDebugOutput ( ) const
inline

is debug output enabled for the RU?

◆ snag()

Snag * ResourceUnit::snag ( ) const
inline

access the snag object

◆ snagNewYear()

void ResourceUnit::snagNewYear ( )
inline

clean transfer pools

◆ soil()

Soil * ResourceUnit::soil ( ) const
inline

access the soil model

◆ speciesSet()

SpeciesSet * ResourceUnit::speciesSet ( ) const
inline

get SpeciesSet this RU links to.

◆ statistics()

const StandStatistics & ResourceUnit::statistics ( ) const
inline

◆ stockableArea()

double ResourceUnit::stockableArea ( ) const
inline

total stockable area in m2

◆ stockedArea()

double ResourceUnit::stockedArea ( ) const
inline

get the stocked area in m2

◆ svdPreviousStateId()

int ResourceUnit::svdPreviousStateId ( ) const
inline

the Id of the state the resource unit was previously in

◆ svdPreviousTime()

int ResourceUnit::svdPreviousTime ( ) const
inline

the number of years that the RU was in the previous state svdPreviousStateId()

◆ svdStateId()

int ResourceUnit::svdStateId ( ) const
inline

the Id of the state the resource unit is in

◆ svdStateTime()

int ResourceUnit::svdStateTime ( ) const
inline

the number of years the RU is already in the current state svdStateId()

◆ topHeight()

double ResourceUnit::topHeight ( bool &  rIrregular) const

calculate the top tree height (as 90th percentile of the top heights on the 10m pixels), 'rIrregular' is set to true when 50% of the area < 50% of topheight

◆ tree()

Tree * ResourceUnit::tree ( const int  index)
inline

get pointer to a tree

◆ treeDied()

void ResourceUnit::treeDied ( )
inline

sets the flag that indicates that the resource unit contains dead trees

◆ trees()

QVector< Tree > & ResourceUnit::trees ( )
inline

reference to the tree list.

◆ waterCycle()

const WaterCycle * ResourceUnit::waterCycle ( ) const
inline

water model of the unit

◆ yearEnd()

void ResourceUnit::yearEnd ( )

called at the end of a year (after regeneration??)

Friends And Related Function Documentation

◆ RUWrapper

friend class RUWrapper
friend

◆ SVDIndicatorOut

friend class SVDIndicatorOut
friend

◆ SVDStateOut

friend class SVDStateOut
friend

◆ SVDStates

friend class SVDStates
friend

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