This function calculates growing degree days (GDD) using the average of the daily maximum and minimum temperatures, a base temperature and a maximum base temperature

gdd(tmax, tmin, tbase, tbase_max, type = "C")

Arguments

tmax

daily maximum temperature

tmin

daily minimum temperature

tbase

base temperature

tbase_max

maximum base temperature

type

either "B", "C", or "D". The default is "C". Type "B" - The heat units are calculated based on the difference between the mean daily temperature and the threshold (`tbase`). In the case when the value of `tmin` is lower than `tbase`, then it is replaced by `tbase`. Type `"C"` - same as type `"B"` and when the value of `tmax` is larger than `tbase_max`, then it is replaced by `tbase_max`. Type `"D"`- same as type `"B"` and when the value of `tmax` is larger than `tbase_max`, then no heat units are added.

Value

a numeric vector with GDD values

References

Baskerville, G., & Emin, P. (1969). Rapid Estimation of Heat Accumulation from Maximum and Minimum Temperatures. Ecology, 50(3), 514-517. doi:10.2307/1933912

See also

[base_temp()] for determining a base temperature

Examples

set.seed(25)
df <- data.frame(tmax = runif(100, 6, 10), tmin = runif(100, 4, 6))

gdd(tmax = df$tmax, tmin = df$tmin, tbase = 5, tbase_max = 30)
#>   [1]   1.392985   3.282512   4.259733   6.554503   7.303287   9.810031
#>   [7]  11.562224  12.765263  13.878573  15.000558  16.156492  17.383517
#>  [13]  19.800607  21.478356  23.369211  24.164222  26.150454  28.305062
#>  [19]  29.758898  31.717690  32.299061  33.700871  34.404637  35.213010
#>  [25]  36.296748  37.764013  38.409299  40.410950  42.352622  43.437435
#>  [31]  45.583809  46.898344  47.871860  48.918490  51.504291  52.812050
#>  [37]  55.232033  56.759521  57.572129  58.319572  60.705153  62.204334
#>  [43]  63.838365  65.826710  67.450093  68.534809  71.016913  73.127310
#>  [49]  74.131668  76.074927  76.844723  78.817516  80.960568  82.446401
#>  [55]  84.000869  84.975839  85.778519  87.371530  88.238972  89.469210
#>  [61]  90.638672  91.785048  92.894984  94.750790  96.491373  98.958947
#>  [67] 100.404830 102.695104 104.531536 105.704549 108.122525 108.897840
#>  [73] 109.647810 112.055520 113.011545 114.644393 115.422643 118.031517
#>  [79] 118.893385 119.761111 121.831796 123.021970 125.019018 125.635943
#>  [85] 127.751313 129.805915 130.925935 132.390394 134.460273 136.077224
#>  [91] 137.989401 138.928684 140.986772 142.896909 143.415940 144.949065
#>  [97] 146.758733 149.065694 150.026993 151.204477