calc_GISSM: The germination and individual seedling survival model GISSM

View source: R/GISSM.R

calc_GISSMR Documentation

The germination and individual seedling survival model GISSM

Description

GISSM represents the frequency of years when big sagebrush seeds germinate and seedlings survive in undisturbed natural vegetation (Schlaepfer et al. 2014).

Usage

calc_GISSM(
  x,
  soillayer_depths_cm,
  params = parameters_GISSM_bigsagebrush(),
  site_latitude = NULL,
  has_soil_temperature = NULL,
  years = NULL,
  simTime1 = NULL,
  simTime2 = NULL,
  debug_output = 0L,
  path = NULL,
  filename_tag = "GISSM"
)

Arguments

x

A named list or an object of rSOILWAT2 class swOutput with daily output. If x is a named list, then it must contain appropriate content for SWP_MPa, Snowpack_SWE_mm, air_Tmin_C, air_Tmax_C, air_Tmean_C, shallowsoil_Tmin_C, shallowsoil_Tmean_C, shallowsoil_Tmax_C. See examples.

soillayer_depths_cm

A numeric vector. The lower bounds of simulated soil layers.

params

A named list. See parameters_GISSM_bigsagebrush.

site_latitude

A numeric value. Required if simTime2 is NULL.

has_soil_temperature

A logical value or NULL. Optional information whether or not object x contains (good) soil temperature values.

years

A numeric vector or NULL. The sequence of simulated calendar years. extracted from x if rSOILWAT2 class swOutput; otherwise, required if simTime1 is NULL.

simTime1

A named list or NULL. See setup_time_simulation_run. If NULL, then derived from years; otherwise, must be consistent with years.

simTime2

A named list or NULL. See simTiming_ForEachUsedTimeUnit. If NULL, then derived from simTime1; otherwise, must be consistent with simTime1.

debug_output

An integer value. Level of additional outputs. If 0, then standard variables are returned. If 1 or 2, then additional elements are included in the returned item; see Value. If 2, then additional output for debugging purposes is written to a csv spreadsheet and a pdf figure is created.

path

A character string. The path to the directory where additional output should be written to disk.

filename_tag

A character string. File name without extension used for writing additional output.

Value

A named list with one element:

outcome

A data.frame tabulating success/failure for Germination_Emergence and for SeedlingSurvival_1stSeason for each regeneration year.

If debug_output is 2, then seven additional elements are provided for debugging purposes:

successes_days

Number of days per year with positive outcomes.

success_mostfrequent_doy

Seasonal timing of most frequent positive outcomes.

time_to_germinate_days

Time to germinate.

nogermination_days

Days without germination.

nogermination_periods_yrs

Consecutive years without germination.

noseedlings_periods_yrs

Consecutive years without seedling recruitment.

mortality_causes

Causes of seedling mortality.

Notes

Time information is checked for consistency only minimally; unexpected output may be produced if x, years, simTime1, or simeTim2 contain inconsistent time content.

References

Schlaepfer, D.R., Lauenroth, W.K. & Bradford, J.B. (2014). Modeling regeneration responses of big sagebrush (Artemisia tridentata) to abiotic conditions. Ecol Model, 286, 66-77.

Examples

sw_in <- rSOILWAT2::sw_exampleData
res <- rSOILWAT2::sw_exec(inputData = sw_in)

# Example 1: use rSOILWAT2 output directly to run GISSM
GISSM_r1 <- calc_GISSM(
  x = res,
  soillayer_depths_cm = rSOILWAT2::swSoils_Layers(sw_in)[, 1],
  site_latitude = rSOILWAT2::swSite_IntrinsicSiteParams(sw_in)[["Latitude"]],
  has_soil_temperature =
    rSOILWAT2::swSite_SoilTemperatureFlag(sw_in) &&
    !rSOILWAT2::has_soilTemp_failed()
)


# Example 2: use list of daily values to run GISSM
#   populate daily values from rSOILWAT2 output as here or from other model
dt <- "Day"
tmp_swp <- slot(slot(res, "SWPMATRIC"), dt)
tmp_snow <- slot(slot(res, "SNOWPACK"), dt)
tmp_airtemp <- slot(slot(res, "TEMP"), dt)
tmp_soiltemp <- slot(slot(res, "SOILTEMP"), dt)

has_sl_minmeanmax <- grepl(
  "Lyr_1_avg_C",
  colnames(tmp_soiltemp),
  fixed = TRUE
)
cns_sl <- if (any(has_sl_minmeanmax)) {
  # rSOILWAT2 since v5.3.0
  paste0("Lyr_1_", c("min", "avg", "max"), "_C")
} else {
  # rSOILWAT2 before v5.3.0
  # Daily mean soil temperature in the absence of daily min/max
  rep("Lyr_1", 3)
}

GISSM_r2 <- calc_GISSM(
  x = list(
    SWP_MPa = -1 / 10 * tmp_swp[, -(1:2), drop = FALSE],
    Snowpack_SWE_mm = 10 * tmp_snow[, "snowpackWaterEquivalent_cm"],
    air_Tmin_C = tmp_airtemp[, "min_C"],
    air_Tmean_C = tmp_airtemp[, "avg_C"],
    air_Tmax_C = tmp_airtemp[, "max_C"],
    shallowsoil_Tmin_C = tmp_soiltemp[, cns_sl[[1]]],
    shallowsoil_Tmean_C = tmp_soiltemp[, cns_sl[[2]]],
    shallowsoil_Tmax_C = tmp_soiltemp[, cns_sl[[3]]]
  ),
  soillayer_depths_cm = rSOILWAT2::swSoils_Layers(sw_in)[, 1],
  site_latitude = rSOILWAT2::swSite_IntrinsicSiteParams(sw_in)[["Latitude"]],
  years =
    rSOILWAT2::swYears_StartYear(sw_in):rSOILWAT2::swYears_EndYear(sw_in)
)

all.equal(GISSM_r1, GISSM_r2)

# Calculate the frequency of years when big sagebrush seeds germinate
# and seedlings survive in undisturbed natural vegetation
# (Schlaepfer et al. 2014)
colMeans(GISSM_r1[["outcome"]][, -1])


DrylandEcology/rSW2funs documentation built on June 28, 2023, 2:51 a.m.