Skip to content

Commit 414cd66

Browse files
committed
Merge pull request UW-Hydro#144 from jhamman/fix_max_unfrozen_bug
fix bug in soil_conduction.c UW-Hydro#128
2 parents 3d928c2 + bc09d07 commit 414cd66

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/soil_conduction.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -797,13 +797,10 @@ double maximum_unfrozen_water(double T,
797797

798798
double unfrozen;
799799

800-
if ( T <= 0 ) {
801-
unfrozen = max_moist * pow((-Lf * T) / 273.16 / (9.81 * bubble / 100.), -(2.0 / (expt - 3.0)));
802-
//INCORRECT: unfrozen = max_moist * pow((-Lf * T) / (T + 273.16) / (9.81 *
803-
//bubble / 100.), -(2.0 / (expt - 3.0)));
804-
800+
if ( T < 0. ) {
801+
unfrozen = max_moist * pow((-Lf * T) / 273.16 / (9.81 * bubble / 100.), -(2.0 / (expt - 3.0)));
805802
if(unfrozen > max_moist) unfrozen = max_moist;
806-
if(unfrozen < 0) unfrozen = 0;
803+
if(unfrozen < 0.) unfrozen = 0.;
807804

808805
}
809806
else unfrozen = max_moist;

0 commit comments

Comments
 (0)