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