Subversion Repositories public iLand

Rev

Rev 1221 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
671 werner 1
/********************************************************************************************
2
**    iLand - an individual based forest landscape and disturbance model
3
**    http://iland.boku.ac.at
4
**    Copyright (C) 2009-  Werner Rammer, Rupert Seidl
5
**
6
**    This program is free software: you can redistribute it and/or modify
7
**    it under the terms of the GNU General Public License as published by
8
**    the Free Software Foundation, either version 3 of the License, or
9
**    (at your option) any later version.
10
**
11
**    This program is distributed in the hope that it will be useful,
12
**    but WITHOUT ANY WARRANTY; without even the implied warranty of
13
**    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
**    GNU General Public License for more details.
15
**
16
**    You should have received a copy of the GNU General Public License
17
**    along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
********************************************************************************************/
19
 
193 werner 20
#ifndef SPECIESRESPONSE_H
21
#define SPECIESRESPONSE_H
22
class ResourceUnit;
23
class ResourceUnitSpecies;
24
class Species;
25
 
26
class SpeciesResponse
27
{
28
public:
29
    SpeciesResponse();
30
    // actions
31
    void setup(ResourceUnitSpecies *rus);
209 werner 32
    /// calculate the species specific environmental response values for the resource unit.
33
    /// this function called before the 3pg production.
369 werner 34
    void calculate(); ///< calculate responses for current year
35
    void clear(); ///< set all responses to 0
467 werner 36
    // access components
37
    const Species *species() const { return mSpecies; }
38
    const ResourceUnit *resourceUnit() const { return mRu; }
193 werner 39
    // access responses
40
    const double *tempResponse() const { return mTempResponse; }
41
    const double *soilWaterResponse() const { return mSoilWaterResponse; }
436 werner 42
    const double *globalRadiation() const { return mRadiation; } ///< radiation sum in MJ/m2
328 werner 43
    const double *utilizableRadiation() const {return mUtilizableRadiation; } ///< utilizable radiation (rad*responses)
44
    const double *vpdResponse() const {return mVpdResponse; }
300 werner 45
    const double *co2Response() const { return mCO2Response; }
193 werner 46
    double nitrogenResponse() const { return mNitrogenResponse; }
436 werner 47
    double yearlyRadiation() const { return mTotalRadiation; }
802 werner 48
    double totalUtilizeableRadiation() const { return mTotalUtilizeableRadiation; }
367 werner 49
    /// response calculation called during water cycle
50
    /// calculates minimum-response of vpd-response and soilwater response
51
    void soilAtmosphereResponses(const double psi_kPa, const double vpd, double &rMinResponse) const;
52
 
193 werner 53
private:
54
    const ResourceUnit *mRu;
55
    const Species *mSpecies;
327 werner 56
 
802 werner 57
    double mRadiation[12]; ///<  radiation sums per month (MJ/m2)
436 werner 58
    double mUtilizableRadiation[12]; ///< sum of daily radiation*minResponse (MJ/m2)
327 werner 59
    double mTempResponse[12]; ///< average of temperature response
60
    double mSoilWaterResponse[12]; ///< average of soilwater response
328 werner 61
    double mVpdResponse[12]; ///< mean of vpd-response
193 werner 62
    double mNitrogenResponse;
300 werner 63
    double mCO2Response[12];
485 werner 64
    double mTotalRadiation;  ///< total radiation of the year (MJ/m2)
802 werner 65
    double mTotalUtilizeableRadiation; ///< yearly sum of utilized radiation (MJ/m2)
193 werner 66
};
67
 
68
#endif // SPECIESRESPONSE_H