Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/sipnet/sipnet.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/* SiPnET: Simplified PnET

Author: Bill Sacks wsacks@wisc.edu
Expand Down Expand Up @@ -398,7 +398,7 @@
void outputHeader(FILE *out) {
fprintf(out, "Notes: (PlantWoodC, PlantLeafC, Soil and Litter in g C/m^2; "
"Water and Snow in cm; SoilWetness is fraction of WHC;\n");
fprintf(out, "year day time plantWoodC plantLeafC ");
fprintf(out, "year day time plantWoodC plantLeafC woodCreation ");
fprintf(out, "soil microbeC coarseRootC fineRootC ");
fprintf(out, "litter soilWater soilWetnessFrac snow ");
fprintf(out, "npp nee cumNEE gpp rAboveground rSoil rRoot ra rh rtot "
Expand All @@ -414,8 +414,8 @@
*/
void outputState(FILE *out, int year, int day, double time) {

fprintf(out, "%4d %3d %5.2f %8.2f %8.2f ", year, day, time, envi.plantWoodC,
envi.plantLeafC);
fprintf(out, "%4d %3d %5.2f %8.2f %8.2f %8.2f ", year, day, time, envi.plantWoodC,
envi.plantLeafC, trackers.woodCreation);
fprintf(out, "%8.2f ", envi.soil);
fprintf(out, "%8.2f ", envi.microbeC);
fprintf(out, "%8.2f %8.2f", envi.coarseRootC, envi.fineRootC);
Expand Down Expand Up @@ -998,7 +998,7 @@
// This is in addition to [1], source not yet determined (controlled by
// ctx.growthResp)
void vegResp2(double *folResp, double *woodResp, double *growthResp,
double baseFolResp, double /*gpp*/) {
double baseFolResp, double gpp) {
// [TAG:UNKNOWN_PROVENANCE] growthResp
*folResp = baseFolResp *
pow(params.vegRespQ10, (climate->tair - params.psnTOpt) / 10.0);
Expand Down Expand Up @@ -1292,6 +1292,7 @@
trackers.evapotranspiration = 0.0;
trackers.soilWetnessFrac = envi.soilWater / params.soilWHC;
trackers.rSoil = 0.0;
trackers.woodCreation = 0.0;

trackers.rRoot = 0.0;

Expand Down Expand Up @@ -1389,6 +1390,7 @@
trackers.totRtot += trackers.rtot;
trackers.totNpp += trackers.npp;
trackers.totNee += trackers.nee;
trackers.woodCreation = fluxes.woodCreation * climate->length;

// evapotranspiration includes water lost to evaporation from canopy
// irrigation (fluxes.eventEvap)
Expand Down
4 changes: 4 additions & 0 deletions src/sipnet/state.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#ifndef SIPNET_STATE_H
#define SIPNET_STATE_H

Expand Down Expand Up @@ -576,6 +576,10 @@
double rAboveground;
// g C * m^-2 litterfall, year to date: SUM litter
double yearlyLitter;

// g C * m^-2 wood creation
double woodCreation;

} Trackers;

// Global var
Expand Down
Loading
Loading