Skip to content

Commit 4dadf09

Browse files
authored
[N/A] Update sipnet.output precision and doc (#281)
* Update outputs * Update output precision * Updates for changes in output precision * Reduce precision changes * Update after sipnet precision changes * Tweaks for output format
1 parent 469b8b8 commit 4dadf09

8 files changed

Lines changed: 22829 additions & 22825 deletions

File tree

docs/user-guide/model-outputs.md

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,52 +9,52 @@ There are two main output files generated by SIPNET:
99

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

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

4748
[^1]: Mean soilWetnessFrac (ratio of soil water / water holding capacity) calculated as average between previous and current time step. Reported for diagnostics only.
4849
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.
4950

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

5253
```
53-
Notes: (PlantWoodC, PlantLeafC, Soil and Litter in g C/m^2; Water and Snow in cm; SoilWetness is fraction of WHC;
54-
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
55-
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
56-
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
57-
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
54+
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
55+
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
56+
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
57+
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
5858
```
5959

6060
## Events output

src/sipnet/sipnet.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,12 +451,12 @@ void outputState(FILE *out, int year, int day, double time) {
451451
(envi.plantWoodC + envi.plantWoodCStorageDelta), envi.plantLeafC,
452452
trackers.woodCreation);
453453
fprintf(out, "%8.2f ", envi.soilC);
454-
fprintf(out, "%11.2f %9.2f", envi.coarseRootC, envi.fineRootC);
455-
fprintf(out, " %8.2f %10.2f %15.3f %8.2f ", envi.litterC, envi.soilWater,
454+
fprintf(out, "%11.2f %9.2f ", envi.coarseRootC, envi.fineRootC);
455+
fprintf(out, "%8.2f %10.3f %15.3f %8.2f ", envi.litterC, envi.soilWater,
456456
trackers.soilWetnessFrac, envi.snow);
457457
fprintf(
458458
out,
459-
"%8.2f %8.2f %8.2f %8.2f %12.3f %8.3f %8.3f %8.3f %8.3f %8.3f %18.8f ",
459+
"%8.3f %8.3f %8.3f %8.3f %12.3f %8.3f %8.3f %8.3f %8.3f %8.3f %18.8f ",
460460
trackers.npp, trackers.nee, trackers.totNee, trackers.gpp,
461461
trackers.rAboveground, trackers.rSoil, trackers.rRoot, trackers.ra,
462462
trackers.rh, trackers.rtot, trackers.evapotranspiration);

tests/sipnet/test_sipnet_infrastructure/testOutputHeader.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ int checkOutput(void) {
8282
return status;
8383
}
8484

85-
void init(void) { initTrackers(); }
85+
void init(void) {
86+
initTrackers();
87+
// soilC is often 4 digits
88+
envi.soilC = 5555;
89+
}
8690

8791
void genOutput(FILE *out) {
8892
init();

0 commit comments

Comments
 (0)