% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/model_frost_heat_damage.R
\name{frost_heat_damage}
\alias{frost_heat_damage}
\alias{default_frost_heat_params}
\alias{stage_sens_frost}
\alias{stage_sens_heat}
\alias{temp_damage_frost}
\alias{temp_damage_heat}
\alias{daily_damage_frost}
\alias{daily_damage_heat}
\alias{daily_damage_frost_heat}
\alias{cum_damage_frost}
\alias{cum_damage_heat}
\alias{cum_damage_frost_heat}
\alias{calc_daily_damage_frost_heat}
\alias{calc_cum_damage_frost_heat}
\title{Frost and Heat Damage Functions}
\usage{
default_frost_heat_params()

stage_sens_frost(growth_stage, params)

stage_sens_heat(growth_stage, params)

temp_damage_frost(mint, params)

temp_damage_heat(maxt, params)

daily_damage_frost(mint, growth_stage, params)

daily_damage_heat(maxt, growth_stage, params)

daily_damage_frost_heat(mint, maxt, growth_stage, params)

cum_damage_frost(mint, growth_stage, params)

cum_damage_heat(maxt, growth_stage, params)

cum_damage_frost_heat(mint, maxt, growth_stage, params)

calc_daily_damage_frost_heat(
  mint,
  maxt,
  growth_stage,
  crop = c("Wheat", "Canola"),
  params = NULL
)

calc_cum_damage_frost_heat(
  mint,
  maxt,
  growth_stage,
  crop = c("Wheat", "Canola"),
  params = NULL
)
}
\arguments{
\item{growth_stage}{Numeric vector of daily growth stage.}

\item{params}{A crop parameter list. If provided, it will override the \code{crop} argument.}

\item{mint}{Numeric vector of daily minimum temperature.}

\item{maxt}{Numeric vector of daily maximum temperature.}

\item{crop}{Crop name to use from \code{default_frost_heat_params()}.}
}
\value{
A named list with crop-specific parameter lists.

A numeric vector of frost stage sensitivity (0-1).

A numeric vector of heat stage sensitivity (0-1).

A numeric vector of frost damage contribution from temperature.

A numeric vector of heat damage contribution from temperature.

A numeric vector of daily frost damage.

A numeric vector of daily heat damage.

A numeric vector of combined daily frost and heat damage.

A scalar cumulative frost damage.

A scalar cumulative heat damage.

A scalar cumulative frost and heat damage.

A tibble with daily stage sensitivity, temperature damage, and daily
frost/heat/combined damage.

A tibble with cumulative frost damage, cumulative heat damage, and
cumulative combined frost-heat damage.
}
\description{
Helper and wrapper functions to calculate frost and heat damage from
temperature and growth stage.
}
\details{
The damage functions are based on the APSIM NG Model \href{https://github.com/APSIMInitiative/ApsimX/blob/3787815684da28c13467942b9d886fa04f54d4c6/Models/Functions/FrostHeatDamageFunctions.cs}{FrostHeatDamageFunctions}. See full documentation \href{https://notes.apsimng.bangyou.me/docs/Models/Functions/FrostHeatDamageFunctions.html}{here}.
}
\examples{
default_frost_heat_params()
calc_daily_damage_frost_heat(
  mint = c(-2, 0, 4),
  maxt = c(29, 33, 36),
  growth_stage = c(7.0, 8.0, 9.0),
  crop = "Wheat"
)
calc_cum_damage_frost_heat(
  mint = c(-2, 0, 4),
  maxt = c(29, 33, 36),
  growth_stage = c(7.0, 8.0, 9.0),
  crop = "Wheat"
)
}
