This function interpolates 12 forcing adjustment factors (1 per month) by placing them at the 15th of the month then interpolating between the previous and next months values for every time step in between.
Examples
d1 <- as.POSIXct("2001-01-01 00:00:00", tz = "UTC")
d2 <- as.POSIXct("2001-12-31 18:00:00", tz = "UTC")
dates <- seq.POSIXt(d1, d2, by = "6 hours")
month <- as.integer(format(dates, "%m"))
day <- as.integer(format(dates, "%d"))
hour <- as.integer(format(dates, "%H"))
factors <- c(.5, 2, 1, 1.5, 2, .5, 1, 2.5, 3, -1.5, 0, 1)
ifa <- interp_fa(factors, month, day, hour)
plot(dates, ifa, t = "l")
points(as.POSIXct(paste0("2001-", 1:12, "-15"), tz = "UTC"), factors, col = "red")