Rev 1196 | Rev 1203 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1196 | Rev 1202 | ||
---|---|---|---|
Line 468... | Line 468... | ||
468 | /** recreate statistics. This is necessary after events that changed the structure
|
468 | /** recreate statistics. This is necessary after events that changed the structure
|
469 | of the stand *after* the growth of trees (where stand statistics are updated).
|
469 | of the stand *after* the growth of trees (where stand statistics are updated).
|
470 | An example is after disturbances. */
|
470 | An example is after disturbances. */
|
471 | void ResourceUnit::recreateStandStatistics(bool recalculate_stats) |
471 | void ResourceUnit::recreateStandStatistics(bool recalculate_stats) |
472 | {
|
472 | {
|
- | 473 | // when called after disturbances (recalculate_stats=false), we
|
|
- | 474 | // clear only the tree-specific variables in the stats (i.e. we keep NPP, and regen carbon),
|
|
- | 475 | // and then re-add all trees (since TreeGrowthData is NULL no NPP is available).
|
|
- | 476 | // The statistics are not summarised here, because this happens for all resource units
|
|
- | 477 | // in the yearEnd function of RU.
|
|
473 | for (int i=0;i<mRUSpecies.count();i++) { |
478 | for (int i=0;i<mRUSpecies.count();i++) { |
474 | mRUSpecies[i]->statistics().clear(); |
- | |
- | 479 | if (recalculate_stats) |
|
- | 480 | mRUSpecies[i]->statistics().clear(); |
|
- | 481 | else
|
|
- | 482 | mRUSpecies[i]->statistics().clearOnlyTrees(); |
|
475 | }
|
483 | }
|
476 | foreach(const Tree &t, mTrees) { |
484 | foreach(const Tree &t, mTrees) { |
477 | resourceUnitSpecies(t.species()).statistics().add(&t, 0); |
485 | resourceUnitSpecies(t.species()).statistics().add(&t, 0); |
478 | }
|
486 | }
|
479 | 487 |