New updates to the rNOMADS package and big changes in the GFS model

I rolled out a big update to the rNOMADS package in R about two weeks ago.  Now, the list of real time weather, ocean, and sea ice models available through rNOMADS updates automatically by scraping the NOMADS web site.  This way, changes in model inventories will be instantly reflected in rNOMADS without the need for a new version release.

Keep abreast of future updates to rNOMADS by subscribing to the mailing list here.  Feel free to ask for help or make comments on this list as well.

In other news, NOAA just updated the Global Forecast System to provide 0.25 x 0.25 degree output – doubling the resolution of the model!  Check out this crystal clear views of surface temperatures across the planet (source code below the image):

World temperature at 2 m above ground using the 0.25 x 0.25 degree output of the Global Forecast System model.

World temperature at 2 m above ground using the 0.25 x 0.25 degree output of the Global Forecast System model.



#Get dates of model output
model.urls <- GetDODSDates(“gfs_0p25”)

#Find day of most recent model run
latest.model <- tail(model.urls$url, 1)

#Find most recent model run on that day
model.runs <- GetDODSModelRuns(latest.model)

#Get the most recent model (excluding analysis only) <- tail(model.runs$[which(grepl(“z$”, model.runs$], 1)

#Define model domain
time <- c(0,0) #Analysis model
lon <- c(0, 1439) #All longitude points
lat <- c(0, 720) #All latitude points
variables <- c(“tmp2m”) #Temperature 2 m above ground

#Get data from NOMADS real time server <- DODSGrab(latest.model,,
variables, time, lon, lat, display.url = FALSE)

#Reformat it
tmp.grid <- ModelGrid(, c(0.25, 0.25))

#Define color scale
colormap <- rev(rainbow(500, start = 0 , end = 5/6))

#Plot it
image(x = tmp.grid$x, y = sort(tmp.grid$y), z = tmp.grid$z[1,1,,], col = colormap,
xlab = “Longitude”, ylab = “Latitude”,
main = paste(“World Temperature at Ground Level:”,

plotGEOmap(coastmap, border = “black”, add = TRUE,
MAPcol = NA)

17 thoughts on “New updates to the rNOMADS package and big changes in the GFS model

  1. Hi,

    I’m trying to test rNOMADS 2.1.3 on windows with your script of january (with RCurl 1.95-4.6 installed), but I’m getting an error when fetching data from the nomads website :

    The line :

    model.urls <- GetDODSDates("gfs_0p25")

    results in :

    * Hostname was NOT found in DNS cache
    * Trying…
    * connect to port 9090 failed: Timed out
    * Failed to connect to port 9090: Timed out
    * Closing connection 0
    Error in GetDODSDates("gfs_0p25") :
    The specified URL does not exist! Make sure your model information is correct. It is also possible the NOMADS server is down.
    Details: Attempted to access but did not succeed..

    Any ideas what might have gone wrong ?


  2. I get an error right when first contacting the NOMADS site (see below)

    I’d say there might be a connection with one of Hadley’s packages.

    Further debugging shows that the error is thrown by the call

    xml2::xml_find_all(x, make_selector(css, xpath))

    BTW: Is there a reason why teh XML package is called first:

    doc library(rNOMADS)
    Loading required package: rvest
    Loading required package: xml2
    > library(GEOmap)
    > model.urls sessionInfo()
    R version 3.2.0 (2015-04-16)
    Platform: x86_64-pc-linux-gnu (64-bit)
    Running under: Debian GNU/Linux stretch/sid


    attached base packages:
    [1] stats graphics grDevices utils datasets methods base

    other attached packages:
    [1] GEOmap_2.3-5 rNOMADS_2.1.3 rvest_0.2.0.9000 xml2_0.1.0 setwidth_1.0-3

    loaded via a namespace (and not attached):
    [1] Rcpp_0.11.5 lattice_0.20-31 XML_3.98-1.1 grid_3.2.0 magrittr_1.5
    [6] RPMG_2.1-7 spam_1.0-1 httr_0.6.1 sp_1.0-17 stringr_0.6.2
    [11] splancs_2.01-37 maps_2.3-9 fields_8.2-1

  3. When I run “model.urls <- GetDODSDates("gfs_0p25")", I get below error:

    Error in UseMethod("xml_find_all") :
    no applicable method for 'xml_find_all' applied to an object of class "c('HTMLInternalDocument', 'HTMLInternalDocument', 'XMLInternalDocument', 'XMLAbstractDocument')"

    I literally installed R for the first time today. Really newb… Any ideas what might be causing this?


  4. urls.out <- CrawlModels(abbrev = "gfs_0p50", depth = 5)
    Error in open.connection(x, "rb") : Couldn't connect to server problem

  5. Hi,
    I work with R on Windows 10 :o(
    I am trying to use rNOMADS (which seem to be the perfect package for my project) but as others I don’t find a solution to avoid the following error :
    > model.urls <- GetDODSDates("gfs_0p25")
    Erreur dans UseMethod("xml_find_all") :
    pas de méthode pour 'xml_find_all' applicable pour un objet de classe "c('HTMLInternalDocument', 'HTMLInternalDocument', 'XMLInternalDocument', 'XMLAbstractDocument')"
    Could someone help me please ?

    • Hey, please contact me at danny.c.bowman[at] and I’ll help you find out what the problem is. I just tested it on my Windows machine and it worked.
      -Danny (rNOMADS maintainer)

  6. Hello there!. Thank you for the excellent package. I have been using it for a while, downloading automatically data for my project but since 22 Dec 2018 the same script that worked perfectly during several months, is not able to get the model information with the ParseModelPage function, nor the GribGrab function is working either.
    I was getting the data for domain (-58.5, -53, -30, -35), Uruguay area.
    The model was GFS 0.25º.

    A example of my code (used to work but now is not working):


    url <- paste0("😉

    I'm getting this error msg:

    Error in curlMultiPerform(multiHandle) :
    embedded nul in string: ':00:01 GMT;';_csma_NSLR('test.aspx?s=x');}\nfunction _csma_NSI(e){_csma_NSLR('test.aspx?s=i');g_csma_i=1;}\nfunction _csma_NSDC(e){_csma_NSLR('test.aspx?s=c');g_csma_c=1;}\nfunction _csma_NSDL(e){if(document.readyState=="complete"){_csma_NSDC(e);}else if(document.readyState=="interactive"){_csma_NSI(e);}}\nfunction _csma_NSTC(o){var d=50,c=100,i=0;for(i=0;i<c;i++){if(!o.complete){setTimeout('return;',d);}else {break;}}}\nfunction _csma_NSISOD(dt){return ''+dt.getUTCFullYear()+'-'+(dt.getUTCMonth()+1)+'-'+dt.getUTCDate()+'T'+dt.getUTCHours()+':'+dt.getUTCMinutes()+':'+dt.getUTCSeconds()+'.'+dt.getUTCMilliseconds()+'Z'+dt.getTimezoneOffset();}\nif(window.attachEvent&&document.attachEvent){document.attachEvent('onreadystatechange',_csma_NSDL);window.attachEvent('onbeforeunload',_csma_NSGB);} else if(window.addEventListener){window.addEventListener('DOMContentLoaded',_csma_NSI,false );window.addEventListener('load',_csma_NSDC,false);window.addEventListene

    Could you please help me find a solution.

  7. Thank you very much for your quick answer. I hope you can make it work again soon. I need those numbers badly for my irrigation app, it should be released by the end of February… Do you think you’ll fix the problem by then?. Thank you again!.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s