Added check that number of nonzero area tiles is consistent with nveg.
@@ -1136,6 +1136,13 @@ vic_init(void)
veg_con_map[i].vidx[j] = NODATA_VEG;
}
}
+ // check the number of nonzero veg tiles
+ if (k > local_domain.locations[i].nveg) {
+ sprint_location(locstr, &(local_domain.locations[i]));
+ log_err("Number of veg tiles with nonzero area (%zu) > nveg "
+ "(%zu).\n%s", k, local_domain.locations[i].nveg,
+ locstr);
+ }
}
// zone_depth: root zone depths
@@ -1242,10 +1249,12 @@ vic_init(void)
"...\n%s", Cv_sum[i], i, locstr);
for (j = 0; j < options.NVEGTYPES; j++) {
vidx = veg_con_map[i].vidx[j];
+ if (vidx != NODATA_VEG) {
veg_con[i][vidx].Cv /= Cv_sum[i];
}
}
}
+ }
// read blowing snow parameters
if (options.BLOWING) {
