Subversion Repositories public iLand

Rev

Rev 639 | Rev 779 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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