Nothing
# Author: Robert J. Hijmans
# License GPL3
# Version 0.1 January 2009
diurnalTemp <- function(lat, date, tmin, tmax) {
TC<-4.0
P<-1.5
dayl <- daylength(lat, doyFromDate(date))
nigthl <- 24-dayl
sunris <- 12 - 0.5 * dayl
sunset <- 12 + 0.5 * dayl
hrtemp <- vector(length=24)
for (hr in 1:24) {
# period a: dhour between midnight and sunrise;
if ( hr < sunris) {
tsunst <- tmin+(tmax-tmin)*sin(pi*(dayl/(dayl+2*P)))
hrtemp[hr] <- (tmin-tsunst*exp(-nigthl/TC)+(tsunst-tmin)*exp(-(hr+24-sunset)/TC))/(1-exp(-nigthl/TC))
} else if ( hr < (12+P) ) {
# period b: dhour between sunrise and normal time that tmax is reached (after noon)
hrtemp[hr] <- tmin+(tmax-tmin)*sin(pi*(hr-sunris)/(dayl+2*P))
} else if (hr < sunset) {
# period c: dhour between time of tmax and sunset;
hrtemp[hr] <- tmin+(tmax-tmin)*sin(pi*(hr-sunris)/(dayl+2*P))
} else {
# period d: dhour between sunset and midnight;
tsunst <- tmin+(tmax-tmin)*sin(pi*(dayl/(dayl+2*P)))
hrtemp[hr] <- (tmin-tsunst*exp(-nigthl/TC)+(tsunst-tmin)*exp(-(hr-sunset)/TC))/(1-exp(-nigthl/TC))
}
}
return(hrtemp)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.