No slot of name "MonthlyProductionValues_grass"
Closed this issue · 0 comments
All rSFSW2 simulations are failing due to recent commits to rSOILWAT2's master branch.
[1] "Datafile 'sw_input_climscen_values' contains zero rows. 'Label's of the master input file 'SWRunInformation' are used to populate rows and 'Label's of the datafile."
Error in slot(prod_default, paste0("MonthlyProductionValues_", tolower(fg))) :
no slot of name "MonthlyProductionValues_grass" for this object of class "swProd"
The rSFSW2 automated builds did not catch this, because the last run on master was before the commits that caused this failure. I restarted rSFSW2's automated build on master and replicated the error, along with the other two pull requests open on rSFSW2.
The issue is very simple: the function update_biomass
in Vegetation.R
needs to be updated to match the new slot layout in swProd
.
I tried changing it from this:
temp <- slot(prod_default, paste0("MonthlyProductionValues_", tolower(fg)))
To this:
if (fg == "Grass") temp <- rSOILWAT2::swProd_MonProd_grass(prod_default)
else if (fg == "Shrub") temp <- rSOILWAT2::swProd_MonProd_shrub(prod_default)
else if (fg == "Tree") temp <- rSOILWAT2::swProd_MonProd_tree(prod_default)
else if (fg == "Forb") temp <- rSOILWAT2::swProd_MonProd_forb(prod_default)
But it was unsuccessful:
Error in object@MonthlyVeg[[rSW2_glovars[["kSOILWAT2"]][["VegTypes"]][["SW_TREES"]]]] :
attempt to select less than one element in integerOneIndex
So, I am going to continue working on what I was assigned to and am instead assigning @dschlaep because he made the changes to rSOILWAT2. In the meantime, commit e0fa1acd62c2d17c961e58ff2a1eed982a347937
on rSOILWAT2 does not have this issue.