Subversion Repositories public iLand

Rev

Rev 1221 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1221 Rev 1222
1
Redirecting to URL 'https://iland.boku.ac.at/svn/iland/tags/release_1.0/src/core/resourceunitspecies.h':
1
Redirecting to URL 'https://iland.boku.ac.at/svn/iland/tags/release_1.0/src/core/resourceunitspecies.h':
2
/********************************************************************************************
2
/********************************************************************************************
3
**    iLand - an individual based forest landscape and disturbance model
3
**    iLand - an individual based forest landscape and disturbance model
4
**    http://iland.boku.ac.at
4
**    http://iland.boku.ac.at
5
**    Copyright (C) 2009-  Werner Rammer, Rupert Seidl
5
**    Copyright (C) 2009-  Werner Rammer, Rupert Seidl
6
**
6
**
7
**    This program is free software: you can redistribute it and/or modify
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
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
9
**    the Free Software Foundation, either version 3 of the License, or
10
**    (at your option) any later version.
10
**    (at your option) any later version.
11
**
11
**
12
**    This program is distributed in the hope that it will be useful,
12
**    This program is distributed in the hope that it will be useful,
13
**    but WITHOUT ANY WARRANTY; without even the implied warranty of
13
**    but WITHOUT ANY WARRANTY; without even the implied warranty of
14
**    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
**    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
**    GNU General Public License for more details.
15
**    GNU General Public License for more details.
16
**
16
**
17
**    You should have received a copy of the GNU General Public License
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/>.
18
**    along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
********************************************************************************************/
19
********************************************************************************************/
20
20
21
#ifndef RESOURCEUNITSPECIES_H
21
#ifndef RESOURCEUNITSPECIES_H
22
#define RESOURCEUNITSPECIES_H
22
#define RESOURCEUNITSPECIES_H
23
#include "production3pg.h"
23
#include "production3pg.h"
24
#include "standstatistics.h"
24
#include "standstatistics.h"
25
#include "speciesresponse.h"
25
#include "speciesresponse.h"
26
#include "establishment.h"
26
#include "establishment.h"
27
#include "saplings.h"
27
#include "saplings.h"
28
#include "grid.h"
28
#include "grid.h"
29
#include "snag.h"
29
#include "snag.h"
30
class Species;
30
class Species;
31
class ResourceUnit;
31
class ResourceUnit;
32
32
33
33
34
class ResourceUnitSpecies
34
class ResourceUnitSpecies
35
{
35
{
36
public:
36
public:
37
    ResourceUnitSpecies() : mLAIfactor(0.), mSpecies(0), mRU(0) {}
37
    ResourceUnitSpecies() : mLAIfactor(0.), mSpecies(0), mRU(0) {}
38
    ~ResourceUnitSpecies();
38
    ~ResourceUnitSpecies();
39
    void setup(Species *species, ResourceUnit *ru);
39
    void setup(Species *species, ResourceUnit *ru);
40
40
41
    // access
41
    // access
42
    const SpeciesResponse *speciesResponse() const { return &mResponse; }
42
    const SpeciesResponse *speciesResponse() const { return &mResponse; }
43
    const Species *species() const { return mSpecies; } ///< return pointer to species
43
    const Species *species() const { return mSpecies; } ///< return pointer to species
44
    const ResourceUnit *ru() const { return mRU; } ///< return pointer to resource unit
44
    const ResourceUnit *ru() const { return mRU; } ///< return pointer to resource unit
45
    const Production3PG &prod3PG() const { return m3PG; } ///< the 3pg production model of this speies x resourceunit
45
    const Production3PG &prod3PG() const { return m3PG; } ///< the 3pg production model of this speies x resourceunit
46
46
47
    SaplingStat &saplingStat() { return mSaplingStat; } ///< statistics for the sapling sub module
47
    SaplingStat &saplingStat() { return mSaplingStat; } ///< statistics for the sapling sub module
48
    const SaplingStat &constSaplingStat() const { return mSaplingStat; } ///< statistics for the sapling sub module
48
    const SaplingStat &constSaplingStat() const { return mSaplingStat; } ///< statistics for the sapling sub module
49
49
50
    Establishment &establishment() { return mEstablishment; } ///< establishment submodel
50
    Establishment &establishment() { return mEstablishment; } ///< establishment submodel
51
    StandStatistics &statistics() { return mStatistics; } ///< statistics of this species on the resourceunit
51
    StandStatistics &statistics() { return mStatistics; } ///< statistics of this species on the resourceunit
52
    StandStatistics &statisticsDead() { return mStatisticsDead; } ///< statistics of died trees
52
    StandStatistics &statisticsDead() { return mStatisticsDead; } ///< statistics of died trees
53
    StandStatistics &statisticsMgmt() { return mStatisticsMgmt; } ///< statistics of removed trees
53
    StandStatistics &statisticsMgmt() { return mStatisticsMgmt; } ///< statistics of removed trees
54
    const StandStatistics &constStatistics() const { return mStatistics; } ///< const accessor
54
    const StandStatistics &constStatistics() const { return mStatistics; } ///< const accessor
55
    const StandStatistics &constStatisticsDead() const { return mStatisticsDead; } ///< const accessor
55
    const StandStatistics &constStatisticsDead() const { return mStatisticsDead; } ///< const accessor
56
    const StandStatistics &constStatisticsMgmt() const { return mStatisticsMgmt; } ///< const accessor
56
    const StandStatistics &constStatisticsMgmt() const { return mStatisticsMgmt; } ///< const accessor
57
57
58
   // actions
58
   // actions
59
    void updateGWL();
59
    void updateGWL();
60
    double removedVolume() const { return mRemovedGrowth; } ///< sum of volume with was remvoved because of death/management (m3/ha)
60
    double removedVolume() const { return mRemovedGrowth; } ///< sum of volume with was remvoved because of death/management (m3/ha)
61
    /// relative fraction of LAI of this species (0..1) (if total LAI on resource unit is >= 1, then the sum of all LAIfactors of all species = 1)
61
    /// relative fraction of LAI of this species (0..1) (if total LAI on resource unit is >= 1, then the sum of all LAIfactors of all species = 1)
62
    double LAIfactor() const { return mLAIfactor; }
62
    double LAIfactor() const { return mLAIfactor; }
63
    void setLAIfactor(const double newLAIfraction) { mLAIfactor=newLAIfraction;
63
    void setLAIfactor(const double newLAIfraction) { mLAIfactor=newLAIfraction;
64
                                                     if (mLAIfactor<0 || mLAIfactor>1.00001)
64
                                                     if (mLAIfactor<0 || mLAIfactor>1.00001)
65
                                                           qDebug() << "invalid LAIfactor"<<mLAIfactor; }
65
                                                           qDebug() << "invalid LAIfactor"<<mLAIfactor; }
66
    // properties
66
    // properties
67
    double leafArea() const; ///< total leaf area of the species on the RU (m2).
67
    double leafArea() const; ///< total leaf area of the species on the RU (m2).
68
    // action
68
    // action
69
    void calculate(const bool fromEstablishment=false); ///< calculate response for species, calculate actual 3PG production
69
    void calculate(const bool fromEstablishment=false); ///< calculate response for species, calculate actual 3PG production
70
70
71
private:
71
private:
72
    ResourceUnitSpecies(const ResourceUnitSpecies &); // no copy
72
    ResourceUnitSpecies(const ResourceUnitSpecies &); // no copy
73
    ResourceUnitSpecies &operator=(const ResourceUnitSpecies &); // no copy
73
    ResourceUnitSpecies &operator=(const ResourceUnitSpecies &); // no copy
74
    double mLAIfactor; ///< relative amount of this species' LAI on this resource unit (0..1). Is calculated once a year.
74
    double mLAIfactor; ///< relative amount of this species' LAI on this resource unit (0..1). Is calculated once a year.
75
    double mRemovedGrowth; ///< m3 volume of trees removed/managed (to calculate GWL) (m3/ha)
75
    double mRemovedGrowth; ///< m3 volume of trees removed/managed (to calculate GWL) (m3/ha)
76
    StandStatistics mStatistics; ///< statistics of a species on this resource unit
76
    StandStatistics mStatistics; ///< statistics of a species on this resource unit
77
    StandStatistics mStatisticsDead; ///< statistics of died trees (this year) of a species on this resource unit
77
    StandStatistics mStatisticsDead; ///< statistics of died trees (this year) of a species on this resource unit
78
    StandStatistics mStatisticsMgmt; ///< statistics of removed trees (this year) of a species on this resource unit
78
    StandStatistics mStatisticsMgmt; ///< statistics of removed trees (this year) of a species on this resource unit
79
    Production3PG m3PG; ///< NPP prodution unit of this species
79
    Production3PG m3PG; ///< NPP prodution unit of this species
80
    SpeciesResponse mResponse; ///< calculation and storage of species specific respones on this resource unit
80
    SpeciesResponse mResponse; ///< calculation and storage of species specific respones on this resource unit
81
    Establishment mEstablishment; ///< establishment for seedlings and sapling growth
81
    Establishment mEstablishment; ///< establishment for seedlings and sapling growth
82
    SaplingStat mSaplingStat; ///< statistics on saplings
82
    SaplingStat mSaplingStat; ///< statistics on saplings
83
    Species *mSpecies; ///< link to speices
83
    Species *mSpecies; ///< link to speices
84
    ResourceUnit *mRU; ///< link to resource unit
84
    ResourceUnit *mRU; ///< link to resource unit
85
    int mLastYear;
85
    int mLastYear;
86
};
86
};
87
87
88
#endif // RESSOURCEUNITSPECIES_H
88
#endif // RESSOURCEUNITSPECIES_H
89
 
89