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