[ncl-talk] Opendap retrieve only a subset of data

Ugo Merlini umerlini at enet.it
Fri Jul 1 13:03:04 MDT 2016


I'm trying to to retrieve form ncep opendap server asubset of data 
limiting the usage of the internet band speed up all the script.  In 
Grads and in NCO is possibile (but this last give me many reading error) 
is there a way to it in NCL?

Regards
Ugo

here my script

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/calendar_decode2.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/ut_string.ncl"

begin
   data_sistema =systemfunc("date -d '-1 day' +'%Y%m%d'")

   http1 = "http://nomads.ncep.noaa.gov:9090/dods/gfs_0p25/gfs"
   http2 = systemfunc("date -d '-1 day' +'%Y%m%d'")
   http3 = "gfs_0p25"


       filename = http1 + http2 + "/" + http3 + "_00z"
       data_run_temp = data_sistema + " 0000"
       data_run = systemfunc( "date -u -d '"+ data_run_temp +"' '+%s'" )
       run = "gfs_0p25_00"
       print(filename)



     exists = isfilepresent(filename)
     if(.not.exists) then
       print("OPeNDAP isfilepresent test unsuccessful.")
       print("Either file doesn't exist, or NCL does not have OPeNDAP 
capabilities on this system")
     else
       print("OPeNDAP isfilepresent test successful.")
       gfs = addfile(filename,"r")
       vars = getfilevarnames(gfs)
     end if

end


More information about the ncl-talk mailing list