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
78 changes: 39 additions & 39 deletions docs/user-guide/model-outputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,52 +9,52 @@ There are two main output files generated by SIPNET:

The `sipnet.out` file contains a time series of state variables and fluxes from the simulation.

| # | Symbol | Output Name | Definition / Notes | Units |
|----|-----------------------------|---------------------|------------------------------------------------------------------------------|--------------|
| 1 | | year | Year of start of timestep | (integer) |
| 2 | | day | Day-of-year of start of timestep | (integer) |
| 3 | | time | Hour-of-day (fractional) at start of timestep | hours |
| 4 | | plantWoodC | Woody plant carbon | g C m$^{-2}$ |
| 5 | | plantLeafC | Leaf carbon | g C m$^{-2}$ |
| 6 | | woodCreation | Carbon allocated to wood during timestep | g C m$^{-2}$ |
| 7 | | soil | (Single) soil organic carbon (or mineral soil C pool) | g C m$^{-2}$ |
| 8 | | coarseRootC | Coarse root carbon | g C m$^{-2}$ |
| 9 | | fineRootC | Fine root carbon | g C m$^{-2}$ |
| 10 | | litter | Litter carbon (0 if litter pool disabled) | g C m$^{-2}$ |
| 11 | | soilWater | Soil water content | cm |
| 12 | $\overline{f}_{\text{WHC}}$ | soilWetnessFrac | Mean soil wetness as fraction of water holding capacity over timestep [^1] | unitless |
| 13 | | snow | Snow water equivalent | cm |
| 14 | | npp | Net primary production for timestep | g C m$^{-2}$ |
| 15 | | nee | Net ecosystem exchange (sign convention per code: - (NPP - RH)) | g C m$^{-2}$ |
| 16 | | cumNEE | Cumulative NEE since simulation start | g C m$^{-2}$ |
| 17 | $GPP$ | gpp | Gross primary production | g C m$^{-2}$ |
| 18 | | rAboveground | Aboveground autotrophic respiration (leaves + wood) | g C m$^{-2}$ |
| 19 | $R_H$ | rSoil | Heterotrophic respiration | g C m$^{-2}$ |
| 20 | | rRoot | Root (autotrophic) respiration | g C m$^{-2}$ |
| 21 | | ra | Total autotrophic respiration (rAboveground + rRoot) | g C m$^{-2}$ |
| 22 | | rh | Total heterotrophic respiration (litter + soil components) | g C m$^{-2}$ |
| 23 | $R$ | rtot | Total ecosystem respiration (ra + rh) | g C m$^{-2}$ |
| 24 | | evapotranspiration | ET (transpiration + immedEvap + evaporation + sublimation) for timestep | cm |
| 25 | | fluxestranspiration | Transpiration component only | cm |
| 27 | $N_\textrm{min}$ | minN | Soil mineral nitrogen | g N m$^{-2}$ |
<!-- Not yet implemented
| 24 | $F^N_\text{vol}$ | fluxesn2o | Nitrous Oxide flux | g N/m$^2$ / timestep |
| 25 | $F^C_{\text{CH}_4}$ | fluxesch4 | Methane Flux | g C/m$^2$ / timestep |
| 26 | $F^N_\text{vol}$ | fluxesn2o | Nitrous Oxide flux | g N/m$^2$ / timestep |
| 27 | $F^C_{\text{CH}_4}$ | fluxesch4 | Methane Flux | g C/m$^2$ / timestep |
-->
| # | Symbol | Output Name | Definition / Notes | Units |
|----|-----------------------------|---------------------|----------------------------------------------------------------------------|---------------|
| 1 | | year | Year of start of timestep | (integer) |
| 2 | | day | Day-of-year of start of timestep | (integer) |
| 3 | | time | Hour-of-day (fractional) at start of timestep | hours |
| 4 | | plantWoodC | Woody plant carbon | g C m$^{-2}$ |
| 5 | | plantLeafC | Leaf carbon | g C m$^{-2}$ |
| 6 | | woodCreation | Carbon allocated to wood during timestep | g C m$^{-2}$ |
| 7 | | soil | (Single) soil organic carbon (or mineral soil C pool) | g C m$^{-2}$ |
| 8 | | coarseRootC | Coarse root carbon | g C m$^{-2}$ |
| 9 | | fineRootC | Fine root carbon | g C m$^{-2}$ |
| 10 | | litter | Litter carbon (0 if litter pool disabled) | g C m$^{-2}$ |
| 11 | | soilWater | Soil water content | cm |
| 12 | $\overline{f}_{\text{WHC}}$ | soilWetnessFrac | Mean soil wetness as fraction of water holding capacity over timestep [^1] | unitless |
| 13 | | snow | Snow water equivalent | cm |
| 14 | | npp | Net primary production for timestep | g C m$^{-2}$ |
| 15 | | nee | Net ecosystem exchange (sign convention per code: - (NPP - RH)) | g C m$^{-2}$ |
| 16 | | cumNEE | Cumulative NEE since simulation start | g C m$^{-2}$ |
| 17 | $GPP$ | gpp | Gross primary production | g C m$^{-2}$ |
| 18 | | rAboveground | Aboveground autotrophic respiration (leaves + wood) | g C m$^{-2}$ |
| 19 | $R_H$ | rSoil | Heterotrophic respiration | g C m$^{-2}$ |
| 20 | | rRoot | Root (autotrophic) respiration | g C m$^{-2}$ |
| 21 | | ra | Total autotrophic respiration (rAboveground + rRoot) | g C m$^{-2}$ |
| 22 | | rh | Total heterotrophic respiration (litter + soil components) | g C m$^{-2}$ |
| 23 | $R$ | rtot | Total ecosystem respiration (ra + rh) | g C m$^{-2}$ |
| 24 | | evapotranspiration | ET (transpiration + immedEvap + evaporation + sublimation) for timestep | cm |
| 25 | | fluxestranspiration | Transpiration component only (as a flux) | cm day$^{-1}$ |
| 27 | $N_\textrm{min}$ | minN | Soil mineral nitrogen | g N m$^{-2}$ |
| | | soilOrgN | Soil organic nitrogen | g N m$^{-2}$ |
| | | litterN | Litter nitrogen | g N m$^{-2}$ |
| | | n2o | Nitrous oxide production | g N m$^{-2}$ |
| | | nLeaching | Nitrogen lost to leaching | g N m$^{-2}$ |
| | | nFixation | Nitrogen demand met by fixation | g N m$^{-2}$ |
| | | nUptake | Nitrogen demand met by uptake from soil | g N m$^{-2}$ |
| | | ch4 | Methane production | g C m$^{-2}$ |

[^1]: Mean soilWetnessFrac (ratio of soil water / water holding capacity) calculated as average between previous and current time step. Reported for diagnostics only.
Internal moisture dependency functions use instantaneous $W_{soil}/W_{WHC}$ (not this average), and clip that ratio to [0,1] where those dependency functions are defined.

An example output file can be found in [tests/smoke/sipnet.out](https://github.com/PecanProject/sipnet/blob/master/tests/smoke/niwot/sipnet.out).

```
Notes: (PlantWoodC, PlantLeafC, Soil and Litter in g C/m^2; Water and Snow in cm; SoilWetness is fraction of WHC;
year day time plantWoodC plantLeafC woodCreation soil coarseRootC fineRootC litter soilWater soilWetnessFrac snow npp nee cumNEE gpp rAboveground rSoil rRoot ra rh rtot evapotranspiration fluxestranspiration minN
2016 1 0.00 1313.62 0.00 0.00 2688.14 437.87 437.86 279.98 3.34 0.270 0.80 -0.03 0.08 0.08 0.00 0.023 0.057 0.003 0.026 0.054 0.079 0.00157021 0.0000 1.000
2016 1 3.00 1313.59 0.00 0.00 2688.14 437.86 437.84 279.96 3.46 0.283 0.68 -0.02 0.08 0.16 0.00 0.019 0.060 0.003 0.022 0.057 0.079 0.00411191 0.0000 1.000
2016 1 6.00 1313.57 0.00 0.00 2688.14 437.84 437.82 279.93 3.52 0.291 0.61 -0.02 0.08 0.24 0.00 0.017 0.062 0.003 0.020 0.059 0.079 0.00442997 0.0000 1.000
year day time plantWoodC plantLeafC woodCreation soil coarseRootC fineRootC litter soilWater soilWetnessFrac snow npp nee cumNEE gpp rAboveground rSoil rRoot ra rh rtot evapotranspiration fluxestranspiration minN soilOrgN litterN n2o nLeaching nFixation nUptake ch4
2016 1 0.00 1313.6134 0.0000 0.0000 2688.1376 437.8735 437.8621 279.9748 3.3419 0.2701 0.7981 -0.0258 0.0871 0.0871 0.0000 0.0226 0.0645 0.0032 0.0258 0.0612 0.0871 0.00157021 0.0000 1.0014 134.9991 13.9985 0.013744 0.0000 0.0000 0.0000 0.0000
2016 1 3.00 1313.5850 0.0000 0.0000 2688.1342 437.8651 437.8423 279.9475 3.4565 0.2833 0.6794 -0.0221 0.0872 0.1743 0.0000 0.0189 0.0683 0.0032 0.0221 0.0651 0.0872 0.00411191 0.0000 1.0029 134.9981 13.9969 0.013748 0.0000 0.0000 0.0000 0.0000
2016 1 6.00 1313.5586 0.0000 0.0000 2688.1296 437.8567 437.8225 279.9191 3.5189 0.2906 0.6125 -0.0201 0.0877 0.2619 0.0000 0.0169 0.0708 0.0033 0.0201 0.0675 0.0877 0.00442997 0.0000 1.0046 134.9970 13.9952 0.013810 0.0000 0.0000 0.0000 0.0000
```

## Events output
Expand Down
12 changes: 6 additions & 6 deletions src/sipnet/sipnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ void readParamData(ModelParams **modelParamsPtr, const char *paramFile) {
* @param out File pointer for output
*/
void outputHeader(FILE *out) {
fprintf(out, "year day time plantWoodC plantLeafC woodCreation ");
fprintf(out, "year day time plantWoodC plantLeafC woodCreation ");
fprintf(out, "soil coarseRootC fineRootC ");
fprintf(out, "litter soilWater soilWetnessFrac snow ");
fprintf(out, "npp nee cumNEE gpp rAboveground rSoil "
Expand All @@ -447,16 +447,16 @@ void outputHeader(FILE *out) {
*/
void outputState(FILE *out, int year, int day, double time) {

fprintf(out, "%4d %3d %5.2f %10.2f %10.2f %12.2f ", year, day, time,
fprintf(out, "%4d %3d %5.2f %10.4f %10.4f %12.4f ", year, day, time,
(envi.plantWoodC + envi.plantWoodCStorageDelta), envi.plantLeafC,
trackers.woodCreation);
fprintf(out, "%8.2f ", envi.soilC);
fprintf(out, "%11.2f %9.2f", envi.coarseRootC, envi.fineRootC);
fprintf(out, " %8.2f %10.2f %15.3f %8.2f ", envi.litterC, envi.soilWater,
fprintf(out, "%8.4f ", envi.soilC);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the one I'll nitpick: I doubt we need more decimal places for soil C. Given it's always greater than zero (usually thousands of g/m2, sometimes hundreds, hardly ever tens) and highly variable, differences smaller than a gram aren't usually meaningful.

Suggested change
fprintf(out, "%8.4f ", envi.soilC);
fprintf(out, "%8.2f ", envi.soilC);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible the same argument applies to other C pools, but I'm less sure which ones. Keeping higher precision for trackers/fluxes than for pools does make sense to me, to avoid truncation at short timesteps.

fprintf(out, "%11.4f %9.4f ", envi.coarseRootC, envi.fineRootC);
fprintf(out, "%8.4f %10.4f %15.4f %8.4f ", envi.litterC, envi.soilWater,
trackers.soilWetnessFrac, envi.snow);
fprintf(
out,
"%8.2f %8.2f %8.2f %8.2f %12.3f %8.3f %8.3f %8.3f %8.3f %8.3f %18.8f ",
"%8.4f %8.4f %8.4f %8.4f %12.4f %8.4f %8.4f %8.4f %8.4f %8.4f %18.8f ",
trackers.npp, trackers.nee, trackers.totNee, trackers.gpp,
trackers.rAboveground, trackers.rSoil, trackers.rRoot, trackers.ra,
trackers.rh, trackers.rtot, trackers.evapotranspiration);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ int checkOutput(void) {
return status;
}

void init(void) { initTrackers(); }
void init(void) {
initTrackers();
// soilC is often 4 digits
envi.soilC = 5555;
}

void genOutput(FILE *out) {
init();
Expand Down
Loading
Loading