[Rnomads-user] ModelGrid function with Dods data

Adam Simkowski akssimkowski at sbcglobal.net
Wed Jan 7 22:12:27 CET 2015


Hi all, 
 
I am attempting to build an array of GFS model data, but I am running into some trouble when it comes to defining my Cartesian nodes in the ModelGrib function. 
 
I'll walk you through my code before that point... I pull the current day 0z GFS_hd run and then specify a given lat lon area along with certain variables to reduce the size of the data that I am reading in. From there, I run the DODSGrab function to pull in 36 hours worth of forecast data (gfs_hd) which works fine. 
 
>From there, my troubles begin with the ModelGrid function. I believe I have all the arguments correct other than Cartesian.nodes, but I am skeptical on the resolution... not completely sure if I did that correctly. When it comes to the Cartesian.nodes function, I'm not exactly sure what to put in the argument. I understand that it has to be a list with an x and y element, but I can't find any literature on the gfs_hd grid in kilometers. Any thoughts on how to move forward here?
 
Thank you. 
 
 
Code is listed below. I am running on a windows 7 machine so pulling Grib data is not an option for me, unfortunately. 
 
#############################################3
  
  library("rNOMADS")
  library("RCurl")
  
  GFS.list <- GetDODSDates(abbrev="gfs_hd", archive=F, request.sleep=1) #returns list of available dates with GFS data in a numerical list
  
  
  current.GFS.url <- tail(GFS.list$url, 1)
  GFS.model.runs <- GetDODSModelRuns(current.GFS.url)
  
  GFS.0z <- (head(GFS.model.runs$model.run,1))
  
  #run when needed 
  #GFS.info.variables <- GetDODSModelRunInfo(current.GFS.url, GFS.0z)
  
  lon <- c(480, 620) # USA Longitude
  lat <- c(240, 280) # USA Latitude
  
variables <- c("tmax2m","tmin2m", "weasdsfc", "ugrdmwl", "vgrdmwl")
  
GFS.Model.Data <- DODSGrab(current.GFS.url, GFS.0z, variables, time = c(0,36), lon, lat)
 
GFS.modelgrid <- ModelGrid(model.data = GFS.Model.Data, grid.type = "cartesian", resolution = c(-140,40),levels = c("surface","2_m_above_ground"), variables, model.domain = NULL, cartesian.nodes = (list(x=0.5,y=0.5)))
 
########################################################################
 
Adam 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rnomads-user/attachments/20150107/0d69d67f/attachment.html>


More information about the Rnomads-user mailing list