Rev 436 | Rev 485 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | |||
193 | werner | 2 | #ifndef SPECIESRESPONSE_H |
3 | #define SPECIESRESPONSE_H |
||
4 | class ResourceUnit; |
||
5 | class ResourceUnitSpecies; |
||
6 | class Species; |
||
7 | |||
8 | class SpeciesResponse |
||
9 | { |
||
10 | public: |
||
11 | SpeciesResponse(); |
||
12 | // actions |
||
13 | void setup(ResourceUnitSpecies *rus); |
||
209 | werner | 14 | /// calculate the species specific environmental response values for the resource unit. |
15 | /// this function called before the 3pg production. |
||
369 | werner | 16 | void calculate(); ///< calculate responses for current year |
17 | void clear(); ///< set all responses to 0 |
||
467 | werner | 18 | // access components |
19 | const Species *species() const { return mSpecies; } |
||
20 | const ResourceUnit *resourceUnit() const { return mRu; } |
||
193 | werner | 21 | // access responses |
22 | const double *tempResponse() const { return mTempResponse; } |
||
23 | const double *soilWaterResponse() const { return mSoilWaterResponse; } |
||
436 | werner | 24 | const double *globalRadiation() const { return mRadiation; } ///< radiation sum in MJ/m2 |
328 | werner | 25 | const double *utilizableRadiation() const {return mUtilizableRadiation; } ///< utilizable radiation (rad*responses) |
26 | const double *vpdResponse() const {return mVpdResponse; } |
||
300 | werner | 27 | const double *co2Response() const { return mCO2Response; } |
193 | werner | 28 | double nitrogenResponse() const { return mNitrogenResponse; } |
436 | werner | 29 | double yearlyRadiation() const { return mTotalRadiation; } |
367 | werner | 30 | /// response calculation called during water cycle |
31 | /// calculates minimum-response of vpd-response and soilwater response |
||
32 | void soilAtmosphereResponses(const double psi_kPa, const double vpd, double &rMinResponse) const; |
||
33 | |||
193 | werner | 34 | private: |
35 | const ResourceUnit *mRu; |
||
36 | const Species *mSpecies; |
||
327 | werner | 37 | |
436 | werner | 38 | double mRadiation[12]; ///< radiation sums per month (within vegetation period, MJ/m2) |
39 | double mUtilizableRadiation[12]; ///< sum of daily radiation*minResponse (MJ/m2) |
||
327 | werner | 40 | double mTempResponse[12]; ///< average of temperature response |
41 | double mSoilWaterResponse[12]; ///< average of soilwater response |
||
328 | werner | 42 | double mVpdResponse[12]; ///< mean of vpd-response |
193 | werner | 43 | double mNitrogenResponse; |
300 | werner | 44 | double mCO2Response[12]; |
436 | werner | 45 | double mTotalRadiation; ///< total radiation of the year (MJ/day) |
193 | werner | 46 | }; |
47 | |||
48 | #endif // SPECIESRESPONSE_H |