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

Cleanup: miscellaneous cleanup of vic_run #722

Closed
3 tasks
tbohn opened this issue Jul 11, 2017 · 1 comment
Closed
3 tasks

Cleanup: miscellaneous cleanup of vic_run #722

tbohn opened this issue Jul 11, 2017 · 1 comment
Labels

Comments

@tbohn
Copy link
Contributor

tbohn commented Jul 11, 2017

  • Description of feature
    Clean up miscellaneous unnecessary/messy code in vic_run().

  • Description of the problem the feature addresses
    vic_run() contains some unnecessary/messy code that could be cleaned up without impacting the physics. Here's a running list:

  • the local arrays out_prec, out_rain, out_snow, and Melt are defined with twice the length they need, and a factor of 2 is included when indexing them - these are holdovers from the distributed_precip code that no longer exists.

  • the initialization and "preparation" stage before the call to surface_fluxes() is a mix of operations, some of which are only performed once per veg tile and others of which are performed once per veg/band combination. This leads to a few different loops over bands, as well as a loop over bands stuck inside prepare_full_energy() (see next task). The order of these tasks appears flexible, so that once-per-veg tile operations could be grouped together outside the loop over bands. Minimizing the number of loops over bands would shorten the code and make it easier to modify in the future (e.g., the local pointers to the cell, veg_var, etc data structures could be defined inside the loop over bands and we could eliminate a lot of [indexes][indexes]).

  • prepare_full_energy() operates on a single veg tile, but loops over all bands; the entire all_vars struct is passed into it, along with iveg, so that it can single out the veg tile. Either prepare_full_energy() should be modified to loop over both veg and band dimensions, or loop over neither.

  • Will the proposed feature be backward compatible?
    Yes.

  • Will the proposed feature change the science results of VIC?
    No.

@tbohn tbohn mentioned this issue Dec 18, 2017
10 tasks
@tbohn tbohn changed the title miscellaneous cleanup of vic_run Cleanup: miscellaneous cleanup of vic_run Dec 19, 2017
@jhamman jhamman added the cleanup label Jan 2, 2018
@tbohn
Copy link
Contributor Author

tbohn commented Feb 9, 2018

Closed by PR #723

@tbohn tbohn closed this as completed Feb 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants