Subversion Repositories public iLand

Rev

Rev 115 | Go to most recent revision | Details | 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
 
18
double Production3PG::calculate(RessourceUnitSpecies &rus)
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
    }
26
    // PARutilized - fraction:.... to GPP:
27
    // year GPP/rad: gC / (yearly MJ/m2)
28
    double year_gpp_per_rad = year_raw_gpp / radYear;
29
    return year_gpp_per_rad;
30
}