[Rnomads-user] Extract SOILW 4 layers from GFS analysis

Xiaoyan Shao shaox at us.ibm.com
Wed Apr 11 19:23:15 CEST 2018


Dear rNOMADS users,

I am relatively new to GFS grib2 data processing. Need some help here. 
Thanks in advance. 

I ran into some difficulty in extracting the 4 soil water content 
parameters from GFS reanalysis files. 

Here is the download link for a specific file I am testing: 
https://nomads.ncdc.noaa.gov/data/gfsanl/201801/20180101/gfsanl_4_20180101_0000_006.grb2 


I would like to extract 4 parameters using this R package. I have the grb2 
file downloaded to my local computer. 

library(rNOMADS)
fpath<-"gfsanl_4_20180101_0000_006.grb2"
variables<-c("SOILW")
levels<-c("0.1-0.4 m below ground") # I want to test one parameter first
export_data<- ReadGrib(fpath,levels=levels,variables=variables)

> str(export_data)
List of 9
 $ model.run.date: chr(0) 
 $ forecast.date : chr(0) 
 $ variables     : chr(0) 
 $ levels        : chr(0) 
 $ lon           : num(0) 
 $ lat           : num(0) 
 $ value         : chr(0) 
 $ meta.data     : chr "None - this field is used for grib1 files"
 $ grib.type     : chr "grib2"

What did I do wrong here? 

There are 4 SOILW parameters at different levels: 
[271] "271:43400382:d=2018010100:SOILW:0-0.1 m below ground:6 hour fcst:"
[273] "273:43583330:d=2018010100:SOILW:0.1-0.4 m below ground:6 hour 
fcst:" 
[275] "275:43764744:d=2018010100:SOILW:0.4-1 m below ground:6 hour fcst:"  
 
[277] "277:43943879:d=2018010100:SOILW:1-2 m below ground:6 hour fcst:"   

When I change the variables to the 4th layer above, then it returns some 
data. It also works with the other 3 variables I am interested shown 
below: 
[286] "286:45186361:d=2018010100:TMAX:2 m above ground:0-6 hour max fcst:" 
 
[287] "287:45421594:d=2018010100:TMIN:2 m above ground:0-6 hour min fcst:" 
 
[293] "293:46556801:d=2018010100:APCP:surface:0-6 hour acc fcst:" 

Also gdal_translate will get the data out, for example temperature will be 
in C unit, but if I use the above command for the TMAX and TMIN, the unit 
seems to be K? 

Thanks & Regards,
Cheyenne

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rnomads-user/attachments/20180411/32f9a04c/attachment.html>


More information about the Rnomads-user mailing list