Subversion Repositories public iLand

Rev

Rev 1176 | Rev 1217 | 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
 
434 werner 21
#ifndef ESTABLISHMENT_H
22
#define ESTABLISHMENT_H
439 werner 23
#include <QtCore/QPoint>
434 werner 24
class Climate;
25
class ResourceUnitSpecies;
443 werner 26
 
434 werner 27
class Establishment
28
{
29
public:
440 werner 30
    Establishment();
434 werner 31
    Establishment(const Climate *climate, const ResourceUnitSpecies *rus);
440 werner 32
    /// setup function that links to a climate and the resource unit / species
33
    void setup(const Climate *climate, const ResourceUnitSpecies *rus);
1168 werner 34
    void clear();
1111 werner 35
    void calculateAbioticEnvironment(); ///< calculate the abiotic environment (TACA model)
1168 werner 36
    void writeDebugOutputs();
440 werner 37
    // some informations after execution
38
    double avgSeedDensity() const { return mPxDensity;} ///< average seed density on the RU
39
    double abioticEnvironment() const {return mPAbiotic; } ///< integrated value of abiotic environment (i.e.: TACA-climate + total iLand environment)
40
    int numberEstablished() const { return mNumberEstablished; } ///< return number of newly established trees in the current year
442 werner 41
    bool TACAminTemp() const { return mTACA_min_temp;} ///< TACA flag for minimum temperature
42
    bool TACAchill() const { return mTACA_chill;} ///< TACA flag chilling requirement
43
    bool TACgdd() const { return mTACA_gdd;} ///< TACA flag for growing degree days
44
    bool TACAfrostFree() const { return mTACA_frostfree;} ///< TACA flag for number of frost free days
45
    int TACAfrostDaysAfterBudBirst() const { return mTACA_frostAfterBuds; } ///< number of frost days after bud birst
46
    double avgLIFValue() const { return mLIFcount>0?mSumLIFvalue/double(mLIFcount):0.; } ///< average LIF value of LIF pixels where establishment is tested
1168 werner 47
    double waterLimitation() const { return mWaterLimitation; } ///< scalar value between 0 and 1 (1: no limitation, 0: no establishment)
440 werner 48
 
434 werner 49
private:
50
    double mPAbiotic; ///< abiotic probability for establishment (climate)
1160 werner 51
    double calculateWaterLimitation(const int veg_period_start, const int veg_period_end); ///< calculate effect of water limitation on establishment, returns scalar [0..1]
434 werner 52
    const Climate *mClimate; ///< link to the current climate
53
    const ResourceUnitSpecies *mRUS; ///< link to the resource unit species (links to production data and species respones)
440 werner 54
    // some statistics
55
    double mPxDensity;
442 werner 56
    int mNumberEstablished; // number of established trees in the current year
57
    // TACA switches
58
    bool mTACA_min_temp; // minimum temperature threshold
59
    bool mTACA_chill;  // (total) chilling requirement
60
    bool mTACA_gdd;   // gdd-thresholds
61
    bool mTACA_frostfree; // frost free days in vegetation period
62
    int mTACA_frostAfterBuds; // frost days after bud birst
63
    double mSumLIFvalue;
1168 werner 64
    double mWaterLimitation; // scalar 0..1 signifying the drought limitation of establishment
442 werner 65
    int mLIFcount;
66
 
434 werner 67
};
68
 
69
#endif // ESTABLISHMENT_H