#Get the latest model run
model.date <- Sys.time()
#Get the forecast 6 hours from now - addition is defined in seconds
fcst.date <- model.date + 6 * 3600
#Figure out what model files to download
model.params <- GetModelRunHour(model.date = model.date, fcst.date = fcst.date)
print(model.params$model.hour) #When the GFS model was run last
print(model.params$fcst.back) #The forecast hour before the requested forecast date
print(model.params$fcst.fore) #The forecast hour after the requested forecast date
Run the code above in your browser using DataLab