Subversion Repositories public iLand

Rev

Rev 113 | Rev 133 | 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
 
5
#include "ressourceunit.h"
6
#include "species.h"
7
 
8
Production3PG::Production3PG()
9
{
10
}
11
 
12
// fake: monthly radiation (sum month MJ/m2)
13
const double radMonth[] = {30., 80., 200., 350., 450., 500., 550., 400., 300., 150., 100.,30. };
14
// fake: aggregated response values per month
15
const double totalResponses[] = {0., 0.05, 0.4, 0.6, 0.4, 0.4, 0.6, 0.3, 0.2, 0.1, 0. ,0. };
16
const double radYear = 3140.; // the sum of radMonth [MJ/m2]
17
 
115 Werner 18
double Production3PG::calculate()
113 Werner 19
{
20
    double month_gpp[12];
21
    double year_raw_gpp = 0.;
22
    for (int i=0;i<12;i++) {
23
        month_gpp[i] = radMonth[i] * 0.5 * totalResponses[i];
24
        year_raw_gpp += month_gpp[i];
25
    }
115 Werner 26
    // calculate harshness factor
27
    mHarshness = 0.5; // fake
113 Werner 28
    // PARutilized - fraction:.... to GPP:
29
    // year GPP/rad: gC / (yearly MJ/m2)
115 Werner 30
    mGPPperRad = year_raw_gpp / radYear;
31
 
32
    return mGPPperRad;
113 Werner 33
}