Skip to content

Commit

Permalink
add overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
achubaty committed Nov 14, 2018
1 parent 33a9951 commit 5e18641
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Boreal_LBMRDataPrep.R
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ estimateParameters <- function(sim) {

## adjust some species-specific values
speciesTable[species == "Pice_gla", seeddistance_max := 2000] ## (see LandWeb#96)
#speciesTable[species == "Popu_tre", longevity := 80] ## (see LandWeb#67)

message("10: ", Sys.time())

Expand Down Expand Up @@ -484,7 +483,7 @@ Save <- function(sim) {
}

# Layers provided by David Andison sometimes have LTHRC, sometimes LTHFC ... chose whichever
LTHxC <- grep("(LTH.+C)",names(sim$shpStudyAreaLarge), value= TRUE)
LTHxC <- grep("(LTH.+C)",names(sim$shpStudyAreaLarge), value = TRUE)
fieldName <- if (length(LTHxC)) {
LTHxC
} else {
Expand Down Expand Up @@ -640,10 +639,20 @@ Save <- function(sim) {
sim$studyArea <- sim$shpStudyAreaLarge
}


if (!suppliedElsewhere("speciesThreshold", sim = sim)) {
sim$speciesThreshold <- 50
}

if (!is.null(sim$override.Boreal_LBMRDataPrep.inputObjects))
sim <- sim$override.Boreal_LBMRDataPrep.inputObjects(sim)

return(invisible(sim))
}

override.Boreal_LBMRDataPrep.inputObjects <- function(sim) {
if (grepl("aspen80", sim$runName)) {
speciesTable[species == "Popu_tre", longevity := 80] ## (see LandWeb#67)
sim$speciesTable[species == "Popu_tre", longevity := 80] ## (see LandWeb#67)
}
sim
}

0 comments on commit 5e18641

Please sign in to comment.