@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)
@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.
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 yieldsFALSE
because argumentdailyC4vars
is a named vector (and not a list)rSFSW2
but without this bug (https://github.com/DrylandEcology/rSFSW2/compare/v3.1.5...v4.0.0; https://github.com/DrylandEcology/rSFSW2/commit/7376a0c5fd2e7853bfb3559ca862b9e4fd6df4a8)Correct code seems to be
if (!is.null(dailyC4vars)) ...