[ncl-talk] Opendap retrieve only a subset of data
Rick Brownrigg
brownrig at ucar.edu
Fri Jul 1 15:37:59 MDT 2016
Hi,
Are you getting the "Either file doesn't exist, or NCL does not have
OPeNDAP capabilities on this system" message, or some other error -- I'm
getting a SEGV out of the isfilepresent() function call. Ncl is
optionally built with OpenDAP, and it may be that your version was built
without it?
Rick
On Fri, Jul 1, 2016 at 1:03 PM, Ugo Merlini <umerlini at enet.it> wrote:
> 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
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160701/097d1011/attachment.html
More information about the ncl-talk
mailing list