[ncl-talk] Getting time series from several files in ncl
Rick Brownrigg
brownrig at ucar.edu
Sun Apr 19 14:16:59 MDT 2020
HI Zilore,
I think the issue is that addfiles() return a *list* of filevars, where
addfile returns a single filevar. Lists are indexed with [ ] notation;
perhaps something like this will work:
x = a[:]->T2(0,{850},{-15},{30})
Rick
On Sun, Apr 19, 2020 at 1:54 PM zilore mumba via ncl-talk <ncl-talk at ucar.edu>
wrote:
> I am trying to get time series at given locations from several WRF output
> files, e.g. 48H forecast temperature at 850hPa. Each file contains a day's
> model run.
> I have used ncl for years by adapting existing scripts, without really
> understanding. One issue I have difficulty with is getting variables from a
> file, especially WRF output.
> I thought the script to get a time series at 15S, 30E would be as simple
> as the one below. I am able to print the varsummary, but printing x tells
> me that "a is not a valid file reference.
> I would appreciate ant assistance.
> begin
> files = systemfunc("ls -1 data/wrfout_d01_2020*") + ".nc"
> a = addfiles(files,"r")
>
> ListSetType (a, "cat") ; concatenate (=default)
> tc = wrf_user_getvar(a,"tc",0)
> printVarSummary (tc)
>
> x = a->T2(0,{850},{-15},{30})
> asciiwrite("outfile.txt",x)
> end
>
> Zilore Mumba
> _______________________________________________
> 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/20200419/c76852de/attachment.html>
More information about the ncl-talk
mailing list