iLand
phenology.h
Go to the documentation of this file.
1/********************************************************************************************
2** iLand - an individual based forest landscape and disturbance model
3** http://iland-model.org
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
20#ifndef PHENOLOGY_H
21#define PHENOLOGY_H
22class Climate;
23
25{
26public:
27 Phenology(const Climate* climate) {mClimate=climate; mId=0; mMinVpd=mMaxVpd=mMinDayLength=mMaxDayLength=mMinTemp=mMaxTemp=0.; mDayStart=0;mDayEnd=365;mChillDaysBefore=-1; mChillDaysAfter=0;mChillDaysAfterLastYear=0;}
28 Phenology(const int id, const Climate* climate, const double minVpd, const double maxVpd,
29 const double minDayLength, const double maxDayLength,
30 const double minTemp, const double maxTemp): mId(id), mClimate(climate), mMinVpd(minVpd), mMaxVpd(maxVpd),
31 mMinDayLength(minDayLength), mMaxDayLength(maxDayLength), mMinTemp(minTemp), mMaxTemp(maxTemp),mChillDaysAfter(0),mChillDaysAfterLastYear(0) {}
32 // access
33 int id() const { return mId; }
35 void calculate();
37 const double *month() const { return mPhenoFraction; }
38 int vegetationPeriodLength() const { return mDayEnd - mDayStart; }
39 int vegetationPeriodStart() const { return mDayStart; }
40 int vegetationPeriodEnd() const { return mDayEnd; }
41 // chilling days
43 int chillingDays() const { return mChillDaysBefore + mChillDaysAfterLastYear; }
44 int chillingDaysLastYear() const { return mChillDaysAfterLastYear; }
45
46
47private:
48 int mId;
49 const Climate *mClimate;
50 double mMinVpd;
51 double mMaxVpd;
52 double mMinDayLength;
53 double mMaxDayLength;
54 double mMinTemp;
55 double mMaxTemp;
56 double mPhenoFraction[12];
57 int mDayStart;
58 int mDayEnd;
59 // some special calculations used for establishment
60 void calculateChillDays(const int end_of_season=-1);
61 int mChillDaysBefore, mChillDaysAfter;
62 int mChillDaysAfterLastYear;
63};
64
65#endif // PHENOLOGY_H
Climate handles climate input data and performs some basic related calculations on that data.
Definition: climate.h:66
Definition: phenology.h:25
Phenology(const int id, const Climate *climate, const double minVpd, const double maxVpd, const double minDayLength, const double maxDayLength, const double minTemp, const double maxTemp)
Definition: phenology.h:28
int vegetationPeriodLength() const
length of vegetation period in days, returs 365 for evergreens
Definition: phenology.h:38
int chillingDaysLastYear() const
Definition: phenology.h:44
const double * month() const
get result of phenology calcualtion for this year (a pointer to a array of 12 values between 0....
Definition: phenology.h:37
int vegetationPeriodEnd() const
day of year when vegeation period stops
Definition: phenology.h:40
Phenology(const Climate *climate)
Definition: phenology.h:27
void calculate()
calculate the phenology for the current year
Definition: phenology.cpp:46
int id() const
Definition: phenology.h:33
int vegetationPeriodStart() const
day of year when vegeation period starts
Definition: phenology.h:39
int chillingDays() const
get days of year that meet chilling requirements: the days in the autumn of the last year + the days ...
Definition: phenology.h:43