Subversion Repositories public iLand

Rev

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

Rev 270 Rev 274
Line 88... Line 88...
88
    mCO2comp = co2.valueDouble("compensationPoint");
88
    mCO2comp = co2.valueDouble("compensationPoint");
89
    mCO2beta0 = co2.valueDouble("beta0");
89
    mCO2beta0 = co2.valueDouble("beta0");
90
    mCO2p0 = co2.valueDouble("p0");
90
    mCO2p0 = co2.valueDouble("p0");
91
    if (mCO2base*mCO2comp*(mCO2base-mCO2comp)*mCO2beta0*mCO2p0==0)
91
    if (mCO2base*mCO2comp*(mCO2base-mCO2comp)*mCO2beta0*mCO2p0==0)
92
        throw IException("at least one parameter of model.species.CO2Response is not valid!");
92
        throw IException("at least one parameter of model.species.CO2Response is not valid!");
-
 
93
-
 
94
    // setup Light responses
-
 
95
    XmlHelper light(xml.node("model.species.lightResponse"));
-
 
96
    mLightResponseTolerant.setAndParse(light.value("shadeTolerant"));
-
 
97
    mLightResponseIntolerant.setAndParse(light.value("shadeIntolerant"));
-
 
98
    if (mLightResponseTolerant.expression().isEmpty() || mLightResponseIntolerant.expression().isEmpty())
-
 
99
        throw IException("at least one parameter of model.species.lightResponse is empty!");
93
100
94
    return mSpecies.count();
101
    return mSpecies.count();
95
102
96
}
103
}
97
104
Line 165... Line 172...
165
172
166
    double response = mCO2p0 * K1*(ambientCO2 - mCO2comp) / (1 + K2*(ambientCO2-mCO2comp)); // Eq. 16
173
    double response = mCO2p0 * K1*(ambientCO2 - mCO2comp) / (1 + K2*(ambientCO2-mCO2comp)); // Eq. 16
167
    return response;
174
    return response;
168
175
169
}
176
}
-
 
177
-
 
178
/** calculates the lightResponse based on a value for LRI and the species lightResponseClass.
-
 
179
    LightResponse is classified from 1 (very shade inolerant) and 5 (very shade tolerant) and interpolated for values between 1 and 5.
-
 
180
    Returns a value between 0..1 */
-
 
181
double SpeciesSet::lightResponse(const double lightResourceIndex, const double lightResponseClass)
-
 
182
{
-
 
183
    QMutexLocker l(&mMutex); // serialize access to calculations
-
 
184
    double low = mLightResponseIntolerant.calculate(lightResourceIndex);
-
 
185
    double high = mLightResponseTolerant.calculate(lightResourceIndex);
-
 
186
    double result = low + 0.25*(lightResponseClass-1.)*(high-low);
-
 
187
    return limit(result, 0., 1.);
-
 
188
-
 
189
}
-
 
190
170
191
171
192