# NOT RUN {
daystop <- 240
lat <- 35.476 # latitude for OKC
daylen <- daylength(daystop=daystop,lat=lat)
tmax <- rep(65,daystop)
tmin <- rep(42,daystop)
bt <- 31
gdh <- c()
for(i in 1:daystop){
gdh[i] <- growdh(tmax[i],tmin[i],daylen[i],bt)
}
idx <- 60
lagidx <- idx - 1:7
laggdh <- gdh[lagidx]
result <- synval(gdh[idx],laggdh,type="leaf")
# }
Run the code above in your browser using DataLab