Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/check nveg #788

Merged
merged 4 commits into from
Apr 24, 2018
Merged

Feature/check nveg #788

merged 4 commits into from
Apr 24, 2018

Conversation

tbohn
Copy link
Contributor

@tbohn tbohn commented Mar 10, 2018

Just added a minor check to vic_init() that for each cell, nNonzero <= nveg, where nNnonzero is the number of veg tiles with Cv > 0. nveg is allowed to be greater than this number due to potentially adding extra tiles for bare soil and above treeline vegetation. But nveg from the parameter file should never be less than nNonzero.

Also modified warning messages for when either Cv or root_frac don't sum to what we want them to. These messages now use format .16f to show the user more precisely what the sum comes to.

The motivation for this new check is that the logic for the mapping between veg_con_map and veg_con relies only on Cv to decide if a veg tile is valid. Yet elsewhere in the code, nveg is used. It's possible that these two quantities could get out of sync for a variety of reasons, which would result in assignment of unintended parameter values (from invalid tiles) to the veg_con structure. This check avoids that and ensures internal consistency.

@bartnijssen bartnijssen merged commit 7d9b6c8 into UW-Hydro:develop Apr 24, 2018
@tbohn tbohn deleted the feature/check_nveg branch September 28, 2018 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants