Subversion Repositories public iLand

Rev

Rev 273 | Rev 300 | 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)
273 werner 27
    // multiplicative approach: responses are averaged one by one and multiplied on a monthly basis
28
//    double response = mResponse->absorbedRadiation()[month] *
29
//                      mResponse->vpdResponse()[month] *
30
//                      mResponse->soilWaterResponse()[month] *
31
//                      mResponse->tempResponse()[month];
32
    // minimum approach: for each day the minimum aof vpd, temp, soilwater is calculated, then averaged for each month
226 werner 33
    double response = mResponse->absorbedRadiation()[month] *
273 werner 34
                      mResponse->minimumResponses()[month];
35
 
226 werner 36
    return response;
37
}
38
/** calculate the alphac (=photosynthetic efficiency) for the given month.
39
   this is based on a global efficiency, and modified per species.
227 werner 40
   epsilon is in gC/MJ Radiation
226 werner 41
  */
227 werner 42
inline double Production3PG::calculateEpsilon(const int month) const
226 werner 43
{
44
    double epsilon = Model::settings().epsilon; // maximum radiation use efficiency
45
    epsilon *= mResponse->nitrogenResponse() *
46
               mResponse->co2Response();
47
    return epsilon;
48
}
49
 
227 werner 50
inline double Production3PG::abovegroundFraction() const
51
{
52
    double harsh =  1 - 0.8/(1 + 2.5 * mResponse->nitrogenResponse());
53
    return harsh;
54
}
55
 
226 werner 56
/** calculate the alphac (=photosynthetic efficiency) for given month.
57
  @sa http://iland.boku.ac.at/primary+production */
115 Werner 58
double Production3PG::calculate()
113 Werner 59
{
226 werner 60
    Q_ASSERT(mResponse!=0);
61
    // Radiation: sum over all days of each month with foliage
230 werner 62
    double year_raw_gpp = 0.;
113 Werner 63
    for (int i=0;i<12;i++) {
228 werner 64
        mGPP[i] = 0.; mUPAR[i]=0.;
226 werner 65
    }
66
    double utilizable_rad, epsilon;
230 werner 67
    // conversion from gC to kg Biomass: C/Biomass=0.5
68
    const double gC_to_kg_biomass = 2. / 1000.;
226 werner 69
    for (int i=0;i<12;i++) {
230 werner 70
        utilizable_rad = calculateUtilizablePAR(i); // utilizable radiation of the month times ...
226 werner 71
        epsilon = calculateEpsilon(i); // ... photosynthetic efficiency ...
230 werner 72
        mUPAR[i] = utilizable_rad ;
73
        mGPP[i] =utilizable_rad * epsilon * gC_to_kg_biomass; // ... results in GPP of the month kg Biomass/m2 (converted from gC/m2)
251 werner 74
        year_raw_gpp += mGPP[i]; // kg Biomass/m2
113 Werner 75
    }
227 werner 76
    // calculate fac
77
    mRootFraction = 1. - abovegroundFraction();
137 Werner 78
 
79
    // global value set?
215 werner 80
    double dbg = GlobalSettings::instance()->settings().paramValue("gpp_per_year",0);
227 werner 81
    if (dbg) {
280 werner 82
        year_raw_gpp = dbg;
227 werner 83
        mRootFraction = 0.4;
84
    }
137 Werner 85
 
230 werner 86
    // year GPP/rad: kg Biomass/m2
87
    mGPPperArea = year_raw_gpp;
88
    return mGPPperArea; // yearly GPP in kg Biomass/m2
113 Werner 89
}