Subversion Repositories public iLand

Rev

Rev 863 | Rev 1005 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 863 Rev 936
Line 48... Line 48...
48
}
48
}
49
49
50
50
51
void ResourceUnitSpecies::calculate(const bool fromEstablishment)
51
void ResourceUnitSpecies::calculate(const bool fromEstablishment)
52
{
52
{
-
 
53
53
    if (mLastYear == GlobalSettings::instance()->currentYear())
54
    if (mLastYear == GlobalSettings::instance()->currentYear())
54
        return;
55
        return;
55
56
56
    // the call *not* from establishment
57
    // if *not* called from establishment, clear the species-level-stats
57
    if (!fromEstablishment)
58
    if (!fromEstablishment)
58
        statistics().clear();
59
        statistics().clear();
59
60
60
    if (mLAIfactor>0 || fromEstablishment==true) {
61
    if (mLAIfactor>0. || fromEstablishment==true) {
61
        // execute the water calculation...
62
        // execute the water calculation...
62
        if (fromEstablishment)
63
        if (fromEstablishment)
63
            const_cast<WaterCycle*>(mRU->waterCycle())->run(); // run the water sub model (only if this has not be done already)
64
            const_cast<WaterCycle*>(mRU->waterCycle())->run(); // run the water sub model (only if this has not be done already)
64
        DebugTimer rst("response+3pg");
65
        DebugTimer rst("response+3pg");
65
        mResponse.calculate();// calculate environmental responses per species (vpd, temperature, ...)
66
        mResponse.calculate();// calculate environmental responses per species (vpd, temperature, ...)
Line 75... Line 76...
75
76
76
void ResourceUnitSpecies::updateGWL()
77
void ResourceUnitSpecies::updateGWL()
77
{
78
{
78
    // removed growth is the running sum of all removed
79
    // removed growth is the running sum of all removed
79
    // tree volume. the current "GWL" therefore is current volume (standing) + mRemovedGrowth.
80
    // tree volume. the current "GWL" therefore is current volume (standing) + mRemovedGrowth.
-
 
81
    // important: statisticsDead() and statisticsMgmt() need to calculate() before -> volume() is already scaled to ha
80
    mRemovedGrowth+=statisticsDead().volume() + statisticsMgmt().volume();
82
    mRemovedGrowth+=statisticsDead().volume() + statisticsMgmt().volume();
81
}
83
}
82
84
83
void ResourceUnitSpecies::calculateEstablishment()
85
void ResourceUnitSpecies::calculateEstablishment()
84
{
86
{