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
Essentially, its the fraction of leaf to total stem and leaf in a cohort.
However in PR #887@glemieux and I noticed that the calculation of fleaf was strangely sensitive, in that we get different results if we use lai/(lai+sai) versus tree_lai / (tree_lai + tree_sai). Note that the difference between lai and tree_lai is that the former the leaf area per canopy area (of the patch), and the latter is the the leaf area per crown area (of the cohort).
IE lai = tree_lai *crown_area/canopy_area
However, what makes this really strange, is that the term crown_area/canopy_area term is in both the numerator and denominator of fleaf (when based on lai), and should cancel out. Thus:
However, in the testing of #887, we found that this is not so. In this commit you can see we were testing the two methods. And eventually decided to stay with using the lai formulation, to maintain b4b results with the base.
This issue is to serve a reminder that there is a difference, which is probably related to numerical imprecision. My personal take is that we should use tree_lai to form the ratio. The differences could be due to small crown_area values, perhaps as a result of very small number densities, and since tree_lai and tree_sai is independant of number density, there is less chance for numerical weirdness when calculating a ratio. Plus, we test if we should do the math on tree_lai and tree_sai, not lai and sai.
The text was updated successfully, but these errors were encountered:
rgknox
changed the title
fleaf is sensitive to compiler math imprecisionss
fleaf is sensitive to compiler math imprecision
Sep 13, 2022
When determining the leaf and stem area profiles, we use an intermediate variable called "fleaf" to parse out total area to the leaves and stems in each layer. See its usage here: https://github.com/NGEET/fates/blob/sci.1.59.5_api.24.1.0/biogeochem/EDCanopyStructureMod.F90#L1710-L1729
Essentially, its the fraction of leaf to total stem and leaf in a cohort.
However in PR #887 @glemieux and I noticed that the calculation of fleaf was strangely sensitive, in that we get different results if we use lai/(lai+sai) versus tree_lai / (tree_lai + tree_sai). Note that the difference between lai and tree_lai is that the former the leaf area per canopy area (of the patch), and the latter is the the leaf area per crown area (of the cohort).
IE lai = tree_lai *crown_area/canopy_area
However, what makes this really strange, is that the term crown_area/canopy_area term is in both the numerator and denominator of fleaf (when based on lai), and should cancel out. Thus:
tree_lai / (tree_lai + tree_sai) == lai / (lai + sai)
However, in the testing of #887, we found that this is not so. In this commit you can see we were testing the two methods. And eventually decided to stay with using the lai formulation, to maintain b4b results with the base.
bf99a0b
This issue is to serve a reminder that there is a difference, which is probably related to numerical imprecision. My personal take is that we should use tree_lai to form the ratio. The differences could be due to small crown_area values, perhaps as a result of very small number densities, and since tree_lai and tree_sai is independant of number density, there is less chance for numerical weirdness when calculating a ratio. Plus, we test if we should do the math on tree_lai and tree_sai, not lai and sai.
The text was updated successfully, but these errors were encountered: