DrylandEcology/rSOILWAT2

`estimate_PotNatVeg_composition()` produces negative cover values

Closed this issue · 1 comments

@N1ckP3rsl3y identified that it incorrectly returns negative cover values if fixed cover inputs that include "SumGrasses_Fraction" sum up > 1.
* Correct code so that it includes a fixed SumGrasses_Fraction in the check that fixed input cover adds up to <= 1
* For instance:

clim2 <- calc_SiteClimate(weatherList = rSOILWAT2::weatherData, do_C4vars = TRUE)

estimate_PotNatVeg_composition(
  MAP_mm = 10 * clim2[["MAP_cm"]],
  MAT_C = clim2[["MAT_C"]],
  mean_monthly_ppt_mm = 10 * clim2[["meanMonthlyPPTcm"]],
  mean_monthly_Temp_C = clim2[["meanMonthlyTempC"]],
  dailyC4vars = clim2[["dailyC4vars"]],
  fix_shrubs = TRUE,
  Shrubs_Fraction = 0.5,
  fix_sumgrasses = TRUE,
  SumGrasses_Fraction = 0.7
)

with output (note negative forb cover!)

$Rel_Abundance_L0
     Succulents           Forbs      Grasses_C3 
            0.0            -0.2             0.7 
     Grasses_C4 Grasses_Annuals          Shrubs 
            0.0             0.0             0.5 
          Trees      BareGround 
            0.0             0.0 

closed by #214 (v6.0.0)