Rev 278 | Rev 376 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | |||
247 | werner | 2 | /** @class ResourceUnitSpecies |
3 | The class contains data available at ResourceUnit x Species scale. |
||
111 | Werner | 4 | Data stored is either statistical (i.e. number of trees per species) or used |
5 | within the model (e.g. fraction of utilizable Radiation) |
||
6 | */ |
||
7 | #include "global.h" |
||
189 | iland | 8 | #include "resourceunitspecies.h" |
111 | Werner | 9 | |
10 | #include "species.h" |
||
189 | iland | 11 | #include "resourceunit.h" |
235 | werner | 12 | void ResourceUnitSpecies::setup(Species *species, ResourceUnit *ru) |
13 | { |
||
14 | mSpecies = species; |
||
15 | mRU = ru; |
||
16 | mResponse.setup(this); |
||
17 | m3PG.setResponse(&mResponse); |
||
18 | mStatistics.setResourceUnitSpecies(this); |
||
277 | werner | 19 | mStatisticsDead.setResourceUnitSpecies(this); |
278 | werner | 20 | mStatisticsMgmt.setResourceUnitSpecies(this); |
277 | werner | 21 | mRemovedGrowth = 0.; |
235 | werner | 22 | } |
111 | Werner | 23 | |
24 | |||
226 | werner | 25 | void ResourceUnitSpecies::calculate() |
26 | { |
||
369 | werner | 27 | if (mLAIfactor>0) { |
28 | mResponse.calculate();///< calculate environmental responses per species (vpd, temperature, ...) |
||
29 | m3PG.calculate();///< production of NPP |
||
30 | } else { |
||
31 | // if no LAI is present, then just clear the respones. |
||
32 | // note: must be changed when regeneration is added... |
||
33 | mResponse.clear(); |
||
34 | m3PG.clear(); |
||
35 | } |
||
226 | werner | 36 | } |
277 | werner | 37 | |
38 | |||
39 | void ResourceUnitSpecies::updateGWL() |
||
40 | { |
||
41 | // removed growth is the running sum of all removed |
||
42 | // tree volume. the current "GWL" therefore is current volume (standing) + mRemovedGrowth. |
||
278 | werner | 43 | mRemovedGrowth+=statisticsDead().volume() + statisticsMgmt().volume(); |
277 | werner | 44 | } |