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

estimate_PotNatVeg_composition() does not apply correction for C4 grasses as documented #218

Closed
dschlaep opened this issue Nov 10, 2022 · 1 comment

Comments

@dschlaep
Copy link
Member

dschlaep commented Nov 10, 2022

@N1ckP3rsl3y identified that the C4 grass cover estimate does not behave according to documentation.

Documentation states that C4 grass cover is estimated from Paruelo & Lauenroth 1996; if the equation by Teeri & Stowe 1976 suggests, however, absence of any C4 species, then C4 grass cover is set to 0% as well.

The bug resulted that the Teeri & Stowe 1976 equation was not considered, i.e., the truncation to 0% C4 grass cover when no C4 species should occur was not applied. This bug potentially leads to a larger geographic area with >0% C4 grass cover than the documentation suggested.

  • The current code uses if (is.list(dailyC4vars)) ... to check if argument "dailyC4vars" contains appropriate values for applying the Teeri & Stowe 1976 correction; however, this is incorrect as it always yields FALSE because argument dailyC4vars is a named vector (and not a list)
  • Current code with bug since Oct 27, 2018 (bd70622); function was originally in rSFSW2 but without this bug (DrylandEcology/rSFSW2@v3.1.5...v4.0.0; DrylandEcology/rSFSW2@7376a0c)

Correct code seems to be if (!is.null(dailyC4vars)) ...

@dschlaep dschlaep added the bug label Nov 10, 2022
@dschlaep dschlaep changed the title estimate_PotNatVeg_composition() has several bugs estimate_PotNatVeg_composition() does not apply correction for C4 grasses as documented Nov 10, 2022
dschlaep added a commit that referenced this issue Nov 10, 2022
…tion to C4 grasses

- addressing #218:
* Documentation states that C4 grass cover is estimated from Paruelo & Lauenroth 1996; if the equation by Teeri & Stowe 1976 suggests, however, absence of any C4 species, then C4 grass cover is set to 0% as well.
* The bug resulted that the Teeri & Stowe 1976 equation was not considered, i.e., the truncation to 0% C4 grass cover when no C4 species should occur was not applied. This bug potentially leads to a larger geographic area with >0% C4 grass cover than the documentation suggested.
dschlaep added a commit that referenced this issue Nov 10, 2022
- new tests that #218 and #219 are resolved

- current new version of `estimate_PotNatVeg_composition()` does not show #218 but fails with test for #219
dschlaep added a commit that referenced this issue Nov 15, 2022
- include fixes for #218 and #219 in comparison
- provide example output before/after #218 and #219
@dschlaep
Copy link
Member Author

dschlaep commented Jun 9, 2023

closed by #214 (v6.0.0)

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

No branches or pull requests

2 participants