Subversion Repositories public iLand

Rev

Rev 298 | Rev 367 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 298 Rev 331
Line 25... Line 25...
25
25
26
ResourceUnit::ResourceUnit(const int index)
26
ResourceUnit::ResourceUnit(const int index)
27
{
27
{
28
    mSpeciesSet = 0;
28
    mSpeciesSet = 0;
29
    mClimate = 0;
29
    mClimate = 0;
-
 
30
    mPixelCount=0;
30
    mIndex = index;
31
    mIndex = index;
31
    mWater = new WaterCycle();
32
    mWater = new WaterCycle();
32
33
33
    mTrees.reserve(100); // start with space for 100 trees.
34
    mTrees.reserve(100); // start with space for 100 trees.
34
}
35
}
Line 124... Line 125...
124
    // clear statistics global and per species...
125
    // clear statistics global and per species...
125
    ResourceUnitSpecies *i;
126
    ResourceUnitSpecies *i;
126
    QVector<ResourceUnitSpecies>::iterator iend = mRUSpecies.end();
127
    QVector<ResourceUnitSpecies>::iterator iend = mRUSpecies.end();
127
    mStatistics.clear();
128
    mStatistics.clear();
128
    for (i=mRUSpecies.begin(); i!=iend; ++i) {
129
    for (i=mRUSpecies.begin(); i!=iend; ++i) {
129
        i->statistics().clear();
-
 
130
        i->statisticsDead().clear();
130
        i->statisticsDead().clear();
131
        i->statisticsMgmt().clear();
131
        i->statisticsMgmt().clear();
132
    }
132
    }
133
133
134
}
134
}
135
135
136
/** production() is the "stand-level" part of the biomass production (3PG).
136
/** production() is the "stand-level" part of the biomass production (3PG).
137
    - The amount of radiation intercepted by the stand is calculated
137
    - The amount of radiation intercepted by the stand is calculated
138
    - The 3PG production for each species and ressource unit is invoked
-
 
-
 
138
    - the water cycle is calculated
-
 
139
    - statistics for each species are cleared
-
 
140
    - The 3PG production for each species and ressource unit is called (calculates species-responses and NPP production)
139
    see also: http://iland.boku.ac.at/individual+tree+light+availability */
141
    see also: http://iland.boku.ac.at/individual+tree+light+availability */
140
void ResourceUnit::production()
142
void ResourceUnit::production()
141
{
143
{
142
144
143
    if (mAggregatedWLA==0 || mPixelCount==0) {
145
    if (mAggregatedWLA==0 || mPixelCount==0) {
Line 176... Line 178...
176
    // invoke species specific calculation (3PG)
178
    // invoke species specific calculation (3PG)
177
    ResourceUnitSpecies *i;
179
    ResourceUnitSpecies *i;
178
    QVector<ResourceUnitSpecies>::iterator iend = mRUSpecies.end();
180
    QVector<ResourceUnitSpecies>::iterator iend = mRUSpecies.end();
179
181
180
    for (i=mRUSpecies.begin(); i!=iend; ++i) {
182
    for (i=mRUSpecies.begin(); i!=iend; ++i) {
-
 
183
        i->statistics().clear();
181
        i->calculate();
184
        i->calculate();
182
        qDebug() << "species" << (*i).species()->id() << "raw_gpp_m2" << i->prod3PG().GPPperArea() << "area:" << productiveArea() << "gpp:" << productiveArea()*i->prod3PG().GPPperArea();
185
        qDebug() << "species" << (*i).species()->id() << "raw_gpp_m2" << i->prod3PG().GPPperArea() << "area:" << productiveArea() << "gpp:" << productiveArea()*i->prod3PG().GPPperArea();
183
    }
186
    }
184
}
187
}
185
188
Line 227... Line 230...
227
    // summarize statistics for the whole resource unit
230
    // summarize statistics for the whole resource unit
228
    for (int i=0;i<mRUSpecies.count();i++) {
231
    for (int i=0;i<mRUSpecies.count();i++) {
229
        mRUSpecies[i].statistics().calculate();
232
        mRUSpecies[i].statistics().calculate();
230
        mStatistics.add(mRUSpecies[i].statistics());
233
        mStatistics.add(mRUSpecies[i].statistics());
231
    }
234
    }
-
 
235
    mStatistics.calculate();
232
}
236
}