-
Notifications
You must be signed in to change notification settings - Fork 92
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
Incorrect (?) calculation of per-age-class outputs #1205
Comments
I'm realizing now that my code doesn't have the fix to |
Progress on this is blocked until #1207 is resolved. |
Now that I know I can work around #1207, I can proceed on this. |
Actually... I think #1174 didn't fully fix the LAI averaging problem. It looks fine after 12 months, which I think is why I told @rgknox that #1174 fixed things, but it turns out there's only one age class at that point. After 24 months (3 age classes): That second map—the cross-ageclass mean of LAI with weights from |
@samsrabin my hunch here is that this gets to the issue with averaging ratios rather than taking the ratio of averages? So properties that are conserved, like biomass, behave well when averaging over time, in the sense that the sum of the age-resolved variable equals the total-ecosystem variable. This isn't the case for variables like LAI, that have a ratio in them where both the numerator (leaf area) and denominator (patch area) change in time, and so the ratio isn't conserved. So perhaps a solution is to get rid of a patch-age-resolved LAI variable entirely, and replace it with a patch-age-resolved leaf area variable, which a user could use to calculate LAI by dividing it by |
@samsrabin , sorry if this is a dumb question, but are you weighting you sum of the _AP variables by patch area? It seems to do this comparison, you would need that, looks like it would be FATES_PATCHAREA_AP. |
oh, nevermind, I see you do use it here |
@ckoven I think you're right, thanks! And your solution sounds smart to me. |
There are (at least) two different ways that per-age-class (
_AP
) outputs are be calculated inupdate_history_dyn()
.When I look at such a variable, I expect the value in each age class to be the mean across all patches in that age class, weighted by patch area. This is how it's done for LAI (
FATES_LAI_AP
), requiring two steps. First, inpatchloop
:Then you need to divide by the total age class area. Since that's accumulated during
patchloop
, this happens after that loop:However, for
FATES_FUEL_AMOUNT_AP
, it's all done in one step withinpatchloop
:There's never a division by the total age class area, so this doesn't give the average fuel load in each patch age class (kg/m2) as the units of
FATES_FUEL_AMOUNT_AP
state. Instead, it gives each age class's contribution to the total (not per-m2) fuel load. So if you do an unweighted sum across all age classes, you'll get the total fuel load. And it turns out,FATES_FUEL_AMOUNT
also gives the total fuel load, in contrast to its units of kg/m2. :As expected, this isn't the case for LAI:
I don't know if this is intended behavior for
FATES_FUEL_AMOUNT_AP
, but as I mentioned it's certainly not what I would expect as a user of the output. Of outputs withfates_levage
dimension (I haven't checked outputs with age class crossed by something else, like PFT), the following outputs (in addition toFATES_FUEL_AMOUNT_AP
) appear to follow the same behavior:FATES_ZSTAR_AP
FATES_SECONDAREA_ANTHRODIST_AP
FATES_SECONDAREA_DIST_AP
FATES_BURNFRAC_AP
FATES_CANOPYAREA_AP
FATES_VEGC_AP
The text was updated successfully, but these errors were encountered: