Skip to content

Commit acaa17d

Browse files
author
Joe Hamman
committed
Merge branch 'hotfix.4.1.2.m'
2 parents a925fe8 + a3155f8 commit acaa17d

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

src/ChangeLog

+25
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,31 @@ Usage:
2525

2626

2727

28+
--------------------------------------------------------------------------------
29+
***** Description of changes from VIC 4.1.2.l to VIC 4.1.2.m *****
30+
--------------------------------------------------------------------------------
31+
32+
33+
Bug Fixes:
34+
----------
35+
36+
Fixed negative liquid soil moisture for bare soil conditions
37+
38+
Files Affected:
39+
40+
runoff.c
41+
42+
Description:
43+
44+
Previously, runoff() only checked whether total (liquid+ice) soil
45+
moisture was > residual moisture, but not whether liquid soil moisture
46+
was positive. In some cases, in the bare soil tile, liquid soil moisture
47+
could occasionally go negative. This has been fixed by adding a check on
48+
liquid soil moisture to runoff().
49+
50+
51+
52+
2853
--------------------------------------------------------------------------------
2954
***** Description of changes from VIC 4.1.2.k to VIC 4.1.2.l *****
3055
--------------------------------------------------------------------------------

src/global.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
characteristics of bare soil. TJB
2121
2012-Jan-16 Removed LINK_DEBUG code BN
2222
**********************************************************************/
23-
char *version = "4.1.2.l bug fix update 2014-Apr-03";
23+
char *version = "4.1.2.m bug fix update 2014-May-30";
2424

2525
char *optstring = "g:vo";
2626

src/runoff.c

+6
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ int runoff(cell_data_struct *cell_wet,
166166
2011-Jun-03 Added options.ORGANIC_FRACT. Soil properties now take
167167
organic fraction into account. TJB
168168
2012-Jan-16 Removed LINK_DEBUG code BN
169+
2014-May-09 Added check on liquid soil moisture to ensure always >= 0. TJB
169170
**********************************************************************/
170171
{
171172
extern option_struct options;
@@ -593,6 +594,11 @@ int runoff(cell_data_struct *cell_wet,
593594
firstlayer=FALSE;
594595

595596
/** verify that current layer moisture is greater than minimum **/
597+
if (liq[lindex] < 0) {
598+
/** liquid cannot fall below 0 **/
599+
Q12[lindex] += liq[lindex];
600+
liq[lindex] = 0;
601+
}
596602
if ((liq[lindex]+ice[lindex]) < resid_moist[lindex]) {
597603
/** moisture cannot fall below minimum **/
598604
Q12[lindex] += (liq[lindex]+ice[lindex]) - resid_moist[lindex];

0 commit comments

Comments
 (0)