Skip to content

Commit

Permalink
Close #16
Browse files Browse the repository at this point in the history
Apply biomass multiplier to tree's fraction live biomass, not total biomass. Note that the output column name still needs to be changed in rSFSW2/rSOILWAT2.
  • Loading branch information
Zachary-Kramer committed Jul 1, 2017
1 parent 050dfbb commit 0649b9f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions SW_Output.c
Original file line number Diff line number Diff line change
Expand Up @@ -1353,11 +1353,11 @@ void get_co2effects(void) {
month = (SW_Model.month) - tOffset;
grass = SW_VegProd.grass.CO2_biomass[month];
shrub = SW_VegProd.shrub.CO2_biomass[month];
tree = SW_VegProd.tree.CO2_biomass[month];
tree = SW_VegProd.tree.CO2_pct_live[month]; // Only pct live is affected
forb = SW_VegProd.forb.CO2_biomass[month];
BIO_mult = c->co2_biomass_mult;
WUE_mult = c->co2_wue_mult;
total = grass + shrub + tree + forb;
total = grass + shrub + forb;

#ifdef RSOILWAT
p_Rco2effects_mo[SW_Output[eSW_CO2Effects].mo_row + mo_nrow * 0] = SW_Model.year;
Expand All @@ -1382,14 +1382,14 @@ void get_co2effects(void) {
for (i = 0; i < 12; i++) {
grass += SW_VegProd.grass.CO2_biomass[i];
shrub += SW_VegProd.shrub.CO2_biomass[i];
tree += SW_VegProd.tree.CO2_biomass[i];
tree += SW_VegProd.tree.CO2_pct_live[i]; // Only pct live is affected
forb += SW_VegProd.forb.CO2_biomass[i];
}
grass /= 12;
shrub /= 12;
tree /= 12;
forb /= 12;
total = grass + shrub + tree + forb;
total = grass + shrub + forb;
BIO_mult = c->co2_biomass_mult;
WUE_mult = c->co2_wue_mult;

Expand Down
6 changes: 3 additions & 3 deletions SW_VegProd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1233,10 +1233,10 @@ void SW_VPD_init(void) {
}

if (GT(v->fractionTree, 0.)) {
apply_CO2(v->tree.CO2_biomass, v->tree.biomass);
apply_CO2(v->tree.CO2_pct_live, v->tree.pct_live);
interpolate_monthlyValues(v->tree.litter, v->tree.litter_daily);
interpolate_monthlyValues(v->tree.CO2_biomass, v->tree.biomass_daily);
interpolate_monthlyValues(v->tree.pct_live, v->tree.pct_live_daily);
interpolate_monthlyValues(v->tree.biomass, v->tree.biomass_daily);
interpolate_monthlyValues(v->tree.CO2_pct_live, v->tree.pct_live_daily);
interpolate_monthlyValues(v->tree.lai_conv, v->tree.lai_conv_daily);
}

Expand Down
1 change: 1 addition & 0 deletions SW_VegProd.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ typedef struct {
biomass[MAX_MONTHS], /* monthly aboveground biomass (g/m**2) */
CO2_biomass[MAX_MONTHS], /* monthly aboveground biomass after CO2 effects */
pct_live[MAX_MONTHS], /* monthly live biomass in percent */
CO2_pct_live[MAX_MONTHS], /* monthly live biomass in percent after CO2 effects */
lai_conv[MAX_MONTHS]; /* monthly amount of biomass needed to produce lai=1 (g/m**2) */

RealD litter_daily[MAX_DAYS + 1], /* daily interpolation of monthly litter values (g/m**2) */
Expand Down

0 comments on commit 0649b9f

Please sign in to comment.