Skip to content

Commit 3b9bd9f

Browse files
authored
SIP137 Fix missing tsoil check in soilBreakdown (#140)
1 parent a29bc26 commit 3b9bd9f

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

docs/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,15 @@ sections to include in release notes:
3333
- Utility `tools/trim_first_chars.sh` to trim the first n characters from every row in a file, useful for updating old input files to remove location column
3434
- Expanded smoke test cases to better cover SIPNET modeling options (#109, #114)
3535
- Converted all compile-time switches not removed or hard-coded to be on into switches to run-time options (#114)
36+
- Added extensive documentation in code listing the source(s) that the code implements (#135)
3637

3738
### Fixed
3839

3940
- Fixed OOM issue when reading bad data (#38, #45)
4041
- Event order checks no longer only compare to first record (#74, #77)
4142
- Fixed long-standing bug wherein microbePulseEff was not set to 0 when MICROBES was off (#114)
43+
- Fixed long-standing bug with missing rSoil flux calc when LITTER_POOL is on (#139)
44+
- Fixed long-standing bug with missing frozen soil check in soilBreakdown when LITTER_POOL is on (#140)
4245

4346
### Changed
4447

src/sipnet/sipnet.c

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,10 +1138,14 @@ void calcMaintenanceRespiration(double tsoil, double water, double whc) {
11381138
// if soil moisture affects heterotrophic respiration
11391139

11401140
// :: from [1], first part of eq (A20), with added exponent
1141+
// Original formulation from [1], based on PnET is:
1142+
// moistEffect = water / whc
1143+
// which matches here with params.soilRespMoistEffect=1 (the default
1144+
// value)
11411145
//
11421146
// [TAG:UNKNOWN_PROVENANCE] soilRespMoistEffect
11431147
// Note: older versions of sipnet note this as "using PnET formulation",
1144-
// but we have been unable to verify that this comes from PnET
1148+
// but we have been unable to verify that the exponent comes from PnET
11451149
moistEffect = pow((water / whc), params.soilRespMoistEffect);
11461150

11471151
// :: from [2], snowpack addition
@@ -1305,22 +1309,21 @@ double soilBreakdown(double poolC, double baseRate, double water, double whc,
13051309
double moistEffect;
13061310

13071311
if (ctx.waterHResp) {
1308-
// As in calcMaintenanceRespiration, provenance of soilRespMoistEffect
1309-
// is unknown
1310-
moistEffect = pow((water / whc), params.soilRespMoistEffect);
1311-
1312-
// TBD Should we be checking if tsoil < 0, as in
1313-
// calcMaintenanceRespiration()?
1314-
//
1315-
// Here's the code that should be here, will turn on in a later change
1316-
// Note, the tsoil check could just be combined into the if expression
1317-
// above
13181312
// :: from [2], snowpack addition
1319-
// if (climate->tsoil < 0) {
1320-
// moistEffect = 1; // Ignore moisture effects in frozen soils
1321-
// }
1313+
if (climate->tsoil < 0) {
1314+
moistEffect = 1; // Ignore moisture effects in frozen soils
1315+
} else {
1316+
// As in calcMaintenanceRespiration, provenance of soilRespMoistEffect
1317+
// is unknown
1318+
// Original formulation from [1], based on PnET is:
1319+
// moistEffect = water / whc
1320+
// which matches here with params.soilRespMoistEffect=1 (the default
1321+
// value)
1322+
moistEffect = pow((water / whc), params.soilRespMoistEffect);
1323+
}
13221324
} else {
13231325
// :: from [2], fifth modification described on pg 247
1326+
// :: that is, moisture-independent R_h
13241327
moistEffect = 1;
13251328
}
13261329

0 commit comments

Comments
 (0)