You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: