Skip to content

Commit 235e1a3

Browse files
author
Joe Hamman
committed
Merge pull request #322 from UW-Hydro/hotfix/4.2.c
4.2.c hotfix release
2 parents 92ac8b2 + 7b10b7f commit 235e1a3

14 files changed

+280
-189
lines changed

docs/Documentation/VICDisagg.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ Create a [global parameter file](GlobalParam.md). Because VIC will not actually
1515
* `STARTYEAR`,` STARTMONTH`, `STARTDAY`, `STARTHOUR`: Set these to the start date for your disaggregated forcings
1616
* `ENDYEAR`, `ENDMONTH`, `ENDDAY`: Set these to the end date for your disaggregated forcings
1717
* All the variables in the forcing section should be the same as before, i.e. these describe the **input** (daily) forcings that you are **reading**: `FORCING1`, `FORCING2` (if applicable), `FORCE_FORMAT`, `FORCE_ENDIAN`, `N_TYPES`, `FORCE_TYPE` (there must be one of these for each input variable, e.g. PREC, TMAX, TMIN, WIND), `FORCE_DT`, `FORCEYEAR`, `FORCEMONTH`, `FORCEDAY`, `FORCEHOUR`, `GRID_DECIMAL`, `WIND_H`, `MEASURE_H`, and `ALMA_INPUT`
18+
* `VEGLIB`,`VEGLIB_VEGCOVER`,`VEGPARAM`,`ROOT_ZONES`,`VEGPARAM_LAI`,`VEGPARAM_VEGCOVER`,`VEGPARAM_ALB`: Set to the same values as you would for a full VIC simulation
1819
* `RESULT_DIR`: Set to the name of the directory where the disaggregated forcings should be written
1920
* `OUT_STEP`: Set to 0
2021
* `ALMA_OUTPUT`: For standard VIC forcings, set to FALSE; for ALMA-compliant forcings (often required by other models) set to TRUE
2122
* `BINARY_OUTPUT`: Set this to FALSE to produce ASCII forcings, TRUE to produce BINARY forcings
2223
* `SKIPYEAR`: We recommend setting this to 0
2324
* `OUTPUT_FORCE`: This must be set to TRUE
24-
* `N_OUTFILES`, `OUTFILE`, `OUTVAR`: These can be omitted; by default, VIC will produce 1 output file per grid cell, names "full_data__lat___lon_," where lat, lon = latitude and longitude of te grid cell's center. These default output files will contain the following variables:
25+
* `N_OUTFILES`, `OUTFILE`, `OUTVAR`: These can be omitted; by default, VIC will produce 1 output file per grid cell, names "full_data_lat_lon_," where lat, lon = latitude and longitude of te grid cell's center. These default output files will contain the following variables:
2526

2627
| Name | Units (ALMA_OUTPUT FALSE) | Units (ALMA_OUTPUT TRUE) |
2728
|----------- |--------------------------- |-------------------------- |

src/ChangeLog

+12-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ Usage:
2424

2525

2626

27+
-------------------------------------------------------------------------------
28+
***** Description of changes between VIC 4.2.b and VIC 4.2.c *****
29+
-------------------------------------------------------------------------------
30+
31+
Bug Fixes:
32+
----------
33+
34+
Fixed water balance errors in lake model (Github Issues: #308, #316)
35+
Fixed OUTPUT_FORCE behavior related to veg_hist features (Github Issues: #305, #307)
36+
Updated bare soil evaporation behavior related to veg_hist update from 4.2 (Github Issues: #306, #315)
37+
2738

2839
-------------------------------------------------------------------------------
2940
***** Description of changes between VIC 4.2.a and VIC 4.2.b *****
@@ -781,7 +792,7 @@ Incorrect handling of user-supplied tskc (cloud fraction) for LW_CLOUD==LW_CLOUD
781792
Previous versions of VIC (before 4.1.2) used a full-sky longwave
782793
formulation taken from two formulas in the Bras hydrology text. For
783794
the new Deardorff full-sky longwave formulation, the dependence on
784-
cloud fraction is different from the old Bras formulation. In
795+
cloud fraction is different from the old Bras formulation. In
785796
4.1.2 (and 4.1.2.a-b), the new Deardorff formulation did not account
786797
for the possibility of user-supplied cloud fraction; if the user
787798
supplied cloud fraction as an input forcing, the resulting longwave
@@ -6235,4 +6246,3 @@ soils in the upper Mississippi River basin, J. Geophys. Res., 104(D16),
62356246
Thornton, P.E. and S.W. Running, An improved algorithm for estimating
62366247
incident daily solar radiation from measurements of temperature, humidity,
62376248
and precipitation, Ag. For. Met., 93, 211-228, 1999.
6238-

src/arno_evap.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ double arno_evap(layer_data_struct *layer,
9797

9898
/* Calculate the potential bare soil evaporation (mm/time step) */
9999

100-
Epot = penman(air_temp, elevation, rad, vpd, ra, 0.0, 0.0) * delta_t / SEC_PER_DAY;
100+
Epot = penman(air_temp, elevation, rad, vpd, ra, 0.0, RARC_SOIL) * delta_t / SEC_PER_DAY;
101101

102102
/**********************************************************************/
103103
/* Compute temporary infiltration rate based on given soil_moist. */

src/calc_veg_params.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ double calc_veg_displacement(double height) {
1515

1616
double value;
1717

18-
value = 0.67 * height;
18+
value = RATIO_DH_HEIGHT_VEG * height;
1919

2020
return (value);
2121

@@ -31,7 +31,7 @@ double calc_veg_height(double displacement) {
3131

3232
double value;
3333

34-
value = displacement / 0.67;
34+
value = displacement / RATIO_DH_HEIGHT_VEG;
3535

3636
return (value);
3737

@@ -48,7 +48,7 @@ double calc_veg_roughness(double height) {
4848

4949
double value;
5050

51-
value = 0.123 * height;
51+
value = RATIO_RL_HEIGHT_VEG * height;
5252

5353
return (value);
5454

src/check_files.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ void check_files(filep_struct *filep,
2323
extern FILE *open_file(char string[], char type[]);
2424

2525
filep->soilparam = open_file(fnames->soil, "r");
26+
filep->veglib = open_file(fnames->veglib, "r");
27+
filep->vegparam = open_file(fnames->veg, "r");
2628
if (!options.OUTPUT_FORCE) {
27-
filep->veglib = open_file(fnames->veglib, "r");
28-
filep->vegparam = open_file(fnames->veg, "r");
2929
if(options.SNOW_BAND>1)
3030
filep->snowband = open_file(fnames->snowband, "r");
3131
if ( options.LAKES )

src/full_energy.c

+8-6
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ int full_energy(int gridcell,
330330

331331
/* Initialize wind speeds */
332332
tmp_wind[0] = atmos->wind[NR];
333-
tmp_wind[1] = -999.;
334-
tmp_wind[2] = -999.;
333+
tmp_wind[1] = ERROR;
334+
tmp_wind[2] = ERROR;
335335

336336
/* Set surface descriptive variables */
337337
if (p < N_PET_TYPES_NON_NAT) {
@@ -388,7 +388,7 @@ int full_energy(int gridcell,
388388
if (dmy->hour == 0) {
389389
calc_Nscale_factors(veg_lib[veg_class].NscaleFlag,
390390
veg_con[iveg].CanopLayerBnd,
391-
veg_lib[veg_class].LAI[dmy[rec].month-1],
391+
veg_con[iveg].LAI[dmy[rec].month-1],
392392
soil_con->lat,
393393
soil_con->lng,
394394
soil_con->time_zone_lng,
@@ -543,9 +543,11 @@ int full_energy(int gridcell,
543543
oldsnow = lake_var->snow.swq;
544544
snowprec = gauge_correction[SNOW] * (atmos->prec[NR] - rainonly);
545545
rainprec = gauge_correction[SNOW] * rainonly;
546-
atmos->out_prec += (snowprec + rainprec) * lake_con->Cl[0] * lakefrac;
547-
atmos->out_rain += rainprec * lake_con->Cl[0] * lakefrac;
548-
atmos->out_snow += snowprec * lake_con->Cl[0] * lakefrac;
546+
Cv = veg_con[iveg].Cv;
547+
Cv *= lakefrac;
548+
atmos->out_prec += (snowprec + rainprec) * Cv;
549+
atmos->out_rain += rainprec * Cv;
550+
atmos->out_snow += snowprec * Cv;
549551

550552
ErrorFlag = solve_lake(snowprec, rainprec, atmos->air_temp[NR],
551553
atmos->wind[NR], atmos->vp[NR] / 1000.,

src/func_surf_energy_bal.c

+64-13
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,15 @@ double func_surf_energy_bal(double Ts, va_list ap)
295295
double D1_plus;
296296
double *transp;
297297
double Ra_bare[3];
298+
double Ra_veg[3];
298299
double tmp_wind[3];
299300
double tmp_height;
300301
double tmp_displacement[3];
301302
double tmp_roughness[3];
302303
double tmp_ref_height[3];
304+
double ga_veg;
305+
double ga_bare;
306+
double ga_average;
303307

304308
/************************************
305309
Read variables from variable list
@@ -687,15 +691,71 @@ double func_surf_energy_bal(double Ts, va_list ap)
687691
TMean, Tair, wind[UnderStory], roughness[UnderStory]);
688692
else
689693
Ra_used[0] = HUGE_RESIST;
690-
694+
695+
/*************************************************
696+
Compute aerodynamic resistance for the case of exposed soil between
697+
plants (or gaps in canopy). Assume plants and exposed soil are well-
698+
mixed, i.e., exposed soil is neither as disconnected from the
699+
atmosphere as soil under veg or canopy, nor as exposed as a large
700+
area of exposed soil. Rather, it is subject to some wind attenuation
701+
from the surrounding plants. Thus, compute as the area-weighted
702+
average of "pure" understory and "pure" exposed conditions.
703+
704+
NOTE: can't average the resistances; must convert to conductances,
705+
average the conductances, and then convert the average conductance
706+
to a resistance.
707+
708+
NOTE 2: since a resistance of 0 corresponds to an infinite conductance,
709+
if either Ra_veg (resistance under veg) or Ra_bare (resistance over
710+
exposed soil) are 0, then Ra_used must necessarily be 0 as well.
711+
*************************************************/
712+
if (veg_var->vegcover < 1) {
713+
Ra_veg[0] = Ra_used[0];
714+
Ra_veg[1] = Ra_used[1];
715+
Ra_veg[2] = Ra_used[2];
716+
/** If Ra_veg is non-zero, use it to compute area-weighted average **/
717+
if (Ra_veg[0] > 0) {
718+
/** aerodynamic conductance under vegetation **/
719+
ga_veg = 1/Ra_veg[0];
720+
/** compute aerodynamic resistance over exposed soil (Ra_bare) **/
721+
tmp_wind[0] = wind[0];
722+
tmp_wind[1] = ERROR; // unused
723+
tmp_wind[2] = ERROR; // unused
724+
tmp_height = soil_con->rough/RATIO_RL_HEIGHT_VEG;
725+
tmp_displacement[0] = calc_veg_displacement(tmp_height);
726+
tmp_roughness[0] = soil_con->rough;
727+
tmp_ref_height[0] = WINDH_SOIL; // wind measurement height over bare soil
728+
Error = CalcAerodynamic(0,0,0,soil_con->snow_rough,soil_con->rough,0,Ra_bare,tmp_wind,tmp_displacement,tmp_ref_height,tmp_roughness);
729+
Ra_bare[0] /= StabilityCorrection(tmp_ref_height[0], tmp_displacement[0], TMean, Tair, tmp_wind[0], tmp_roughness[0]);
730+
/** if Ra_bare is non-zero, compute area-weighted average
731+
aerodynamic conductance **/
732+
if (Ra_bare[0] > 0) {
733+
/** aerodynamic conductance over exposed soil **/
734+
ga_bare = 1/Ra_bare[0];
735+
/** area-weighted average aerodynamic conductance **/
736+
ga_average = veg_var->vegcover*ga_veg + (1-veg_var->vegcover)*ga_bare;
737+
/** aerodynamic resistance is inverse of conductance **/
738+
Ra_used[0] = 1/ga_average;
739+
}
740+
/** else aerodynamic resistance is zero **/
741+
else {
742+
Ra_used[0] = 0;
743+
}
744+
}
745+
/** else aerodynamic resistance is zero **/
746+
else {
747+
Ra_used[0] = 0;
748+
}
749+
}
750+
691751
/*************************************************
692752
Compute Evapotranspiration if not snow covered
693753
694754
Should evapotranspiration be active when the
695755
ground is only partially covered with snow????
696756
697-
Use Arno Evap if LAI is set to zero (e.g. no
698-
winter crop planted).
757+
Use Arno Evap in the exposed soil portion, and/or
758+
if LAI is zero.
699759
*************************************************/
700760
if ( VEG && !SNOWING && veg_var->vegcover > 0 ) {
701761
Evap = canopy_evap(layer, veg_var, TRUE,
@@ -709,20 +769,11 @@ double func_surf_energy_bal(double Ts, va_list ap)
709769
transp[i] = layer[i].evap;
710770
layer[i].evap = 0;
711771
}
712-
tmp_wind[0] = wind[0];
713-
tmp_wind[1] = -999.;
714-
tmp_wind[2] = -999.;
715-
tmp_height = soil_con->rough/0.123;
716-
tmp_displacement[0] = calc_veg_displacement(tmp_height);
717-
tmp_roughness[0] = soil_con->rough;
718-
tmp_ref_height[0] = 10;
719-
Error = CalcAerodynamic(0,0,0,soil_con->snow_rough,soil_con->rough,0,Ra_bare,tmp_wind,tmp_displacement,tmp_ref_height,tmp_roughness);
720-
Ra_bare[0] /= StabilityCorrection(tmp_ref_height[0], tmp_displacement[0], TMean, Tair, tmp_wind[0], tmp_roughness[0]);
721772
Evap *= veg_var->vegcover;
722773
Evap += (1-veg_var->vegcover)
723774
* arno_evap(layer, surf_atten*NetBareRad, Tair, vpd,
724775
depth[0], max_moist * depth[0] * 1000.,
725-
elevation, b_infilt, Ra_bare[0], delta_t,
776+
elevation, b_infilt, Ra_used[0], delta_t,
726777
resid_moist[0], frost_fract);
727778
for (i=0; i<options.Nlayer; i++) {
728779
layer[i].evap = veg_var->vegcover*transp[i] + (1-veg_var->vegcover)*layer[i].evap;

src/global.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
2013-Dec-27 Removed QUICK_FS option. TJB
2323
2014-May-20 Added ref_veg_vegcover. TJB
2424
**********************************************************************/
25-
char *version = "4.2.b 2015-January-22";
25+
char *version = "4.2.c 2015-December-12";
2626
char *optstring = "g:vo";
2727
int flag;
2828

@@ -65,4 +65,3 @@ param_set_struct param_set;
6565
double ref_veg_trunk_ratio[] = { 0.0, 0.0, 0.0, 0.0 };
6666
/* One element for each PET type (non-natural or natural) */
6767
char ref_veg_ref_crop[] = { FALSE, FALSE, TRUE, TRUE, FALSE, FALSE };
68-

0 commit comments

Comments
 (0)