fix bug with looping over bands
@@ -142,8 +142,11 @@ generate_default_state(all_vars_struct *all_vars,
for (veg = 0; veg <= Nveg; veg++) {
Cv = veg_con[veg].Cv;
if (Cv > 0) {
+ for (band = 0; band < options.SNOW_BAND; band++) {
+ if (soil_con->AreaFract[band] > 0.) {
// TO-DO: account for treeline and lake factors
- AreaFactor = Cv * TreeAdjustFactor * lakefactor;
+ AreaFactor = (Cv * soil_con->AreaFract[band] *
+ TreeAdjustFactor * lakefactor);
// cold start, so assuming bare (free of snow) albedo
if (veg != Nveg) {
albedo_sum += AreaFactor * veg_var[veg][band].albedo;
@@ -154,6 +157,8 @@ generate_default_state(all_vars_struct *all_vars,
}
}
}
+ }
+ }
gc_avg.avg_albedo = albedo_sum;
/************************************************************************
