Subversion Repositories public iLand

Rev

Rev 170 | Rev 215 | 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"
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. };
146 werner 14
// fake: aggregated response values per month GO to webbrowser!!
133 Werner 15
const double totalResponses[] = {0., 0.05, 0.4, 0.6, 0.8, 0.8, 0.8, 0.5, 0.5, 0.1, 0. ,0. };
113 Werner 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++) {
134 Werner 23
        month_gpp[i] = radMonth[i] * 2 * totalResponses[i];
113 Werner 24
        year_raw_gpp += month_gpp[i];
25
    }
115 Werner 26
    // calculate harshness factor
170 werner 27
    mHarshness = 0.4; // fake
137 Werner 28
 
29
    // global value set?
30
    double dbg = GlobalSettings::instance()->settings().paramValue("npp_per_year",0);
31
    if (dbg)
32
        year_raw_gpp = dbg;
33
 
34
 
113 Werner 35
    // PARutilized - fraction:.... to GPP:
36
    // year GPP/rad: gC / (yearly MJ/m2)
115 Werner 37
    mGPPperRad = year_raw_gpp / radYear;
38
    return mGPPperRad;
113 Werner 39
}