Subversion Repositories public iLand

Rev

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

Rev Author Line No. Line
1
 
113 Werner 2
#include "global.h"
3
#include "production3pg.h"
4
 
189 iland 5
#include "resourceunit.h"
113 Werner 6
#include "species.h"
226 werner 7
#include "speciesresponse.h"
8
#include "model.h"
113 Werner 9
 
10
Production3PG::Production3PG()
11
{
226 werner 12
    mResponse=0;
113 Werner 13
}
14
 
226 werner 15
/**
16
  This is based on the utilizable photosynthetic active radiation.
17
  @sa http://iland.boku.ac.at/primary+production
227 werner 18
  The resulting radiation is MJ/m2       */
19
inline double Production3PG::calculateUtilizablePAR(const int month) const
226 werner 20
{
21
    // calculate the available radiation
22
 
23
    // there is no production outside of the vegetation period
24
    if (mResponse->absorbedRadiation()[month]==0.)
25
        return 0.;
26
    // see Equation (3)
27
    double response = mResponse->absorbedRadiation()[month] *
28
                      mResponse->vpdResponse()[month] *
29
                      mResponse->soilWaterResponse()[month] *
30
                      mResponse->tempResponse()[month];
31
    return response;
32
}
33
/** calculate the alphac (=photosynthetic efficiency) for the given month.
34
   this is based on a global efficiency, and modified per species.
227 werner 35
   epsilon is in gC/MJ Radiation
226 werner 36
  */
227 werner 37
inline double Production3PG::calculateEpsilon(const int month) const
226 werner 38
{
39
    double epsilon = Model::settings().epsilon; // maximum radiation use efficiency
40
    epsilon *= mResponse->nitrogenResponse() *
41
               mResponse->co2Response();
42
    return epsilon;
43
}
44
 
227 werner 45
inline double Production3PG::abovegroundFraction() const
46
{
47
    double harsh =  1 - 0.8/(1 + 2.5 * mResponse->nitrogenResponse());
48
    return harsh;
49
}
50
 
226 werner 51
/** calculate the alphac (=photosynthetic efficiency) for given month.
52
  @sa http://iland.boku.ac.at/primary+production */
115 Werner 53
double Production3PG::calculate()
113 Werner 54
{
226 werner 55
    Q_ASSERT(mResponse!=0);
56
    // Radiation: sum over all days of each month with foliage
230 werner 57
    double year_raw_gpp = 0.;
113 Werner 58
    for (int i=0;i<12;i++) {
228 werner 59
        mGPP[i] = 0.; mUPAR[i]=0.;
226 werner 60
    }
61
    double utilizable_rad, epsilon;
230 werner 62
    // conversion from gC to kg Biomass: C/Biomass=0.5
63
    const double gC_to_kg_biomass = 2. / 1000.;
226 werner 64
    for (int i=0;i<12;i++) {
230 werner 65
        utilizable_rad = calculateUtilizablePAR(i); // utilizable radiation of the month times ...
226 werner 66
        epsilon = calculateEpsilon(i); // ... photosynthetic efficiency ...
230 werner 67
        mUPAR[i] = utilizable_rad ;
68
        mGPP[i] =utilizable_rad * epsilon * gC_to_kg_biomass; // ... results in GPP of the month kg Biomass/m2 (converted from gC/m2)
251 werner 69
        year_raw_gpp += mGPP[i]; // kg Biomass/m2
113 Werner 70
    }
227 werner 71
    // calculate fac
72
    mRootFraction = 1. - abovegroundFraction();
137 Werner 73
 
74
    // global value set?
215 werner 75
    double dbg = GlobalSettings::instance()->settings().paramValue("gpp_per_year",0);
227 werner 76
    if (dbg) {
230 werner 77
        year_raw_gpp = dbg ;
227 werner 78
        mRootFraction = 0.4;
79
    }
137 Werner 80
 
230 werner 81
    // year GPP/rad: kg Biomass/m2
82
    mGPPperArea = year_raw_gpp;
83
    return mGPPperArea; // yearly GPP in kg Biomass/m2
113 Werner 84
}