Subversion Repositories public iLand

Rev

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

Rev Author Line No. Line
1
 
1033 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
 
187 iland 21
#ifndef RESOURCEUNITSPECIES_H
22
#define RESOURCEUNITSPECIES_H
115 Werner 23
#include "production3pg.h"
180 werner 24
#include "standstatistics.h"
193 werner 25
#include "speciesresponse.h"
440 werner 26
#include "establishment.h"
1113 werner 27
#include "saplings.h"
453 werner 28
#include "grid.h"
475 werner 29
#include "snag.h"
111 Werner 30
class Species;
187 iland 31
class ResourceUnit;
111 Werner 32
 
1113 werner 33
 
187 iland 34
class ResourceUnitSpecies
111 Werner 35
{
36
public:
521 werner 37
    ResourceUnitSpecies() : mLAIfactor(0.), mSpecies(0), mRU(0) {}
468 werner 38
    ~ResourceUnitSpecies();
234 werner 39
    void setup(Species *species, ResourceUnit *ru);
115 Werner 40
 
449 werner 41
    // access
209 werner 42
    const SpeciesResponse *speciesResponse() const { return &mResponse; }
208 werner 43
    const Species *species() const { return mSpecies; } ///< return pointer to species
44
    const ResourceUnit *ru() const { return mRU; } ///< return pointer to resource unit
228 werner 45
    const Production3PG &prod3PG() const { return m3PG; } ///< the 3pg production model of this speies x resourceunit
1113 werner 46
 
47
    SaplingStat &saplingStat() { return mSaplingStat; } ///< statistics for the sapling sub module
1174 werner 48
    const SaplingStat &constSaplingStat() const { return mSaplingStat; } ///< statistics for the sapling sub module
1113 werner 49
 
1111 werner 50
    Establishment &establishment() { return mEstablishment; } ///< establishment submodel
208 werner 51
    StandStatistics &statistics() { return mStatistics; } ///< statistics of this species on the resourceunit
278 werner 52
    StandStatistics &statisticsDead() { return mStatisticsDead; } ///< statistics of died trees
53
    StandStatistics &statisticsMgmt() { return mStatisticsMgmt; } ///< statistics of removed trees
262 werner 54
    const StandStatistics &constStatistics() const { return mStatistics; } ///< const accessor
55
    const StandStatistics &constStatisticsDead() const { return mStatisticsDead; } ///< const accessor
278 werner 56
    const StandStatistics &constStatisticsMgmt() const { return mStatisticsMgmt; } ///< const accessor
57
 
449 werner 58
   // actions
277 werner 59
    void updateGWL();
936 werner 60
    double removedVolume() const { return mRemovedGrowth; } ///< sum of volume with was remvoved because of death/management (m3/ha)
720 werner 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; }
937 werner 63
    void setLAIfactor(const double newLAIfraction) { mLAIfactor=newLAIfraction;
64
                                                     if (mLAIfactor<0 || mLAIfactor>1.00001)
65
                                                           qDebug() << "invalid LAIfactor"<<mLAIfactor; }
376 werner 66
    // properties
67
    double leafArea() const; ///< total leaf area of the species on the RU (m2).
115 Werner 68
    // action
440 werner 69
    void calculate(const bool fromEstablishment=false); ///< calculate response for species, calculate actual 3PG production
115 Werner 70
 
111 Werner 71
private:
454 werner 72
    ResourceUnitSpecies(const ResourceUnitSpecies &); // no copy
73
    ResourceUnitSpecies &operator=(const ResourceUnitSpecies &); // no copy
376 werner 74
    double mLAIfactor; ///< relative amount of this species' LAI on this resource unit (0..1). Is calculated once a year.
936 werner 75
    double mRemovedGrowth; ///< m3 volume of trees removed/managed (to calculate GWL) (m3/ha)
262 werner 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
278 werner 78
    StandStatistics mStatisticsMgmt; ///< statistics of removed trees (this year) of a species on this resource unit
234 werner 79
    Production3PG m3PG; ///< NPP prodution unit of this species
80
    SpeciesResponse mResponse; ///< calculation and storage of species specific respones on this resource unit
440 werner 81
    Establishment mEstablishment; ///< establishment for seedlings and sapling growth
1113 werner 82
    SaplingStat mSaplingStat; ///< statistics on saplings
468 werner 83
    Species *mSpecies; ///< link to speices
84
    ResourceUnit *mRU; ///< link to resource unit
438 werner 85
    int mLastYear;
111 Werner 86
};
87
 
88
#endif // RESSOURCEUNITSPECIES_H