# Growing Degree Day

Growing Degree Days (GDD), also called Growing Degree Units (GDU) or Heat Units (HU), are based on the observation that within limits, plants grow faster when warm and more slowly when cold. Below a base temperature (Tbase), the plant is dormant and little growth occurs. At temperatures above an upper limit, (Tmax), the plant does not grow any faster. Plants grow in a cumulative stepwise manner which is strongly influenced by the ambient temperature. Since growth depends on the accumulation of specific quantities of heat, it is possible to predict when these events should occur during a growing season regardless of differences in temperatures from year to year.

Each plant species has its own lower air temperature threshold and upper air temperature threshold. This temperature range varies for each plant.

Different methods exist for calculating heat units depending on a) the crop or biological organism of interest and b) the whim or personal preference of the researcher. Growing degree day units are calculated by using the maximum daily air temperature, the minimum daily air temperature and the crop’s lower temperature threshold.

The base temperature is that temperature below which plant growth is zero.

The method most commonly used in the U.S. for determining heat unit accumulation relative to corn phenology is the formula first suggested by the National Oceanic and Atmospheric Administration. The “modified growing degree day formula” calculates daily accumulation of GDD’s as the average daily temperature minus 50° F.

Calculate Growing Degree Day (GDD) for each hive and add to database.

```Centigrade
Tbase = 10
Tmax  = 30
```

```SET @gdd_total:=0;
SELECT
q1.doy,
q1.gdd,
round(@gdd_total := @gdd_total + q1.gdd) as gdd_tot
FROM
(SELECT DAYOFYEAR(DATE_FORMAT(`hive_observation_time_local`, '%Y-%m-%d')) AS doy,
(least(greatest(max(wx_temp_c),10),30) - least(greatest(min(wx_temp_c),10),30))/2 AS gdd
from HIVE_DATA
where hive_id=10 group by DATE_FORMAT(`hive_observation_time_local`, '%Y-%m-%d') ) AS q1
```

```SELECT hive_id, DAYOFYEAR(DATE_FORMAT(`hive_observation_time_local`, '%Y-%m-%d')) AS doy,
(least(greatest(max(wx_temp_c),10),30) - least(greatest(min(wx_temp_c),10),30))/2 AS gdd
from HIVE_DATA group by DATE_FORMAT(`hive_observation_time_local`, '%Y-%m-%d'), hive_id
```