-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: uninitialised variables in cable_canopy.F90 (#352)
# CABLE Thank you for submitting a pull request to the CABLE Project. ## Description Fixes #351. Move the definition of sum_rad_gradis and sum_rad_rniso out of the NITER loop in `define_canopy()` since these variables do not change in the loop. Having a quick comparison between the outputs before and after this commit [the effect is negligeable](#352 (comment)). Use `sum_rad_gradis` and `sum_rad_rniso` as calculated in define_canopy() everywhere in define_canopy(), dryLeaf() and wetLeaf(), instead of recalculating them sometimes. Move the initialisation of `canopy%DvLitt` and `canopy%kthLitt` to the top of `define_canopy()` since these variables are constant throughout the run. We also want these variables to be defined in all cases to avoid errors in function calls, but only used with `cable_user%litter` turned on. ## Type of change Please delete options that are not relevant. - [X] Bug fix ## Testing benchcab/me.org analysis: https://modelevaluation.org/analyses/anywhere/BPLvifw3DyARokYdg/s6k22L3WajmiS9uGv/CJGXP5GQWhGf3nH28/all Tested in benchcab the changes for DvLitt and kthLitt on their own. benchcab showed bitwise identical results when moving the initialisation compared to the previous implementation with the litter option on. Please add a reviewer when ready for review. <!-- readthedocs-preview cable start --> ---- 📚 Documentation preview 📚: https://cable--352.org.readthedocs.build/en/352/ <!-- readthedocs-preview cable end -->
- Loading branch information
Showing
2 changed files
with
31 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters