# Growing Degree Day

Plants grow in a cumulative stepwise manner which is strongly influenced by ambient temperature. 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. Since growth depends on the accumulation of specific quantities of heat, by accumulating Growing Degree Days it is possible to predict when events such as bud break (nectar flows) will occur during a growing season regardless of differences in temperatures from year to year.

where:
T = current temperature
Tbase = temperature below which plant growth is zero.

In addition to Tbase, each plant species has its own upper air temperature threshold, Tcap. At temperatures above Tcap the plant does not grow any faster. Tcap varies for each species.

One method of approximating GDD is the average of the daily maximum and minimum temperatures above Tbase.

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 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
```