Skip to content

Commit

Permalink
Fixed errors in passing SensibleHeat to func_atmos_energy_bal.
Browse files Browse the repository at this point in the history
  • Loading branch information
vicadmin committed Jan 11, 2013
1 parent b3dd41e commit cf69e6a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
24 changes: 24 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,30 @@ Usage:




--------------------------------------------------------------------------------
***** Description of changes from VIC 4.1.2.g to VIC 4.1.2.f *****
--------------------------------------------------------------------------------


Bug Fixes:
----------

Fixed error in passing SensibleHeat to func_atmos_energy_bal.

Files Affected:

calc_atmos_energy_bal.c

Description:

Replaced (*SensibleHeat) with SensibleHeat in argument lists
of root_brent, error_print_atmos_energy_bal and
solve_atmos_energy_bal.




--------------------------------------------------------------------------------
***** Description of changes from VIC 4.1.2.f to VIC 4.1.2.e *****
--------------------------------------------------------------------------------
Expand Down
9 changes: 6 additions & 3 deletions calc_atmos_energy_bal.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ double calc_atmos_energy_bal(double InOverSensible,
Tcanopy iteration is only performed if CLOSE_ENERGY is TRUE; else
Tcanopy is set to Tair. Also fixed bug in passing SensibleHeat
between this function and root_brent, etc. CL via TJB
2013-Jan-11 Replaced (*SensibleHeat) with SensibleHeat in argument lists
of root_brent, error_print_atmos_energy_bal and
solve_atmos_energy_bal. TJB
************************************************************************/

extern option_struct options;
Expand Down Expand Up @@ -115,7 +118,7 @@ double calc_atmos_energy_bal(double InOverSensible,
Tcanopy = root_brent(T_lower, T_upper, ErrorString, func_atmos_energy_bal,
(*LatentHeat) + (*LatentHeatSub),
NetRadiation, Ra, Tair, atmos_density, InSensible,
(*SensibleHeat) );
SensibleHeat);

if ( Tcanopy <= -998 ) {
if (options.TFALLBACK) {
Expand All @@ -129,7 +132,7 @@ double calc_atmos_energy_bal(double InOverSensible,
+ (*LatentHeatSub),
NetRadiation, Ra, Tair,
atmos_density, InSensible,
(*SensibleHeat), ErrorString);
SensibleHeat, ErrorString);
return ( ERROR );
}
}
Expand All @@ -143,7 +146,7 @@ double calc_atmos_energy_bal(double InOverSensible,
// compute variables based on final temperature
(*Error) = solve_atmos_energy_bal(Tcanopy, (*LatentHeat) + (*LatentHeatSub),
NetRadiation, Ra, Tair, atmos_density,
InSensible, (*SensibleHeat));
InSensible, SensibleHeat);

/*****************************
Find Canopy Vapor Pressure
Expand Down
2 changes: 1 addition & 1 deletion global.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
characteristics of bare soil. TJB
2012-Jan-16 Removed LINK_DEBUG code BN
**********************************************************************/
char *version = "4.1.2.f bug fix update 2013-Jan-08";
char *version = "4.1.2.g bug fix update 2013-Feb-01";

char *optstring = "g:vo";

Expand Down

0 comments on commit cf69e6a

Please sign in to comment.