[ncl-talk] Getting time series from several files in ncl

Barry Lynn barry.h.lynn at gmail.com
Mon Apr 20 04:02:16 MDT 2020


If you know when these values occur within the time series, then you can
index them quite easily.

Why don't you use wrf_user_getvar and then the wrf interpolation program.

If you want them at a specific point, I think you know how to do this.
There is also a get location program

https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_ll_to_ij.shtml

Barry

On Mon, Apr 20, 2020 at 11:55 AM zilore mumba <zmumba at yahoo.com> wrote:

> Barry,
> My intention is to have RH and U, V time series. That's what I had in mind
> when I put 48. T2 only has time, lon ,lat. I have several daily output
> files, and I want an n-day series of 48 hour forecasts of T2
>
> On Monday, April 20, 2020, 8:00:41 AM GMT+2, Barry Lynn <
> barry.h.lynn at gmail.com> wrote:
>
>
> Zilore:
>
> T2 is a three dimensional variable.  Also, T2 is the two meter
> temperature.
>
> You want tc or tk (see:
> https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_getvar.shtml
> ).
>
> Could you please explain how you are interpolating to 850 mb?  There is a
> WRF program to do this, and I am not sure how the indexing you are using
> works. How are you indexing the 48 time slot?  WRF has a program to list
> times, and you can match the time you want to the listed times to find the
> index.
>
> Barry
>
> On Mon, Apr 20, 2020 at 8:17 AM zilore mumba via ncl-talk <
> ncl-talk at ucar.edu> wrote:
>
> Sorry Rick I put in a surface variable T2 which only 3 coordinates, so I
> put "x = a[:]->T2(0,{-15},{30})". Now I am getting error of coordinates
> west-east and south-north not having  associated coordinate variables. I
> have seen this error before. I will find out how to get out of it
>
> On Sunday, April 19, 2020, 11:53:33 PM GMT+2, Rick Brownrigg <
> brownrig at ucar.edu> wrote:
>
>
> Perhaps do a printVarSummary(a[0]->T2)  ; it sounds like its not the shape
> you think it might/should be; i.e. 3D vs 4D
>
>
>
> On Sun, Apr 19, 2020 at 3:29 PM zilore mumba <zmumba at yahoo.com> wrote:
>
>
>
> On Sunday, April 19, 2020, 11:27:47 PM GMT+2, zilore mumba <
> zmumba at yahoo.com> wrote:
>
>
> Thanks Rick, that is close. The error am getting now is:
> fatal:Number of subscripts on rhs do not match number of dimensions of
> aggregated cat type variable, (4) Subscripts used, (3) Subscripts expected
>
> On Sunday, April 19, 2020, 10:17:12 PM GMT+2, Rick Brownrigg <
> brownrig at ucar.edu> wrote:
>
>
> 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
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> --
> Barry H. Lynn, Ph.D
> Senior Associate Scientist, Lecturer,
> The Institute of the Earth Science,
> The Hebrew University of Jerusalem,
> Givat Ram, Jerusalem 91904, Israel
> Tel: 972 547 231 170
> Fax: (972)-25662581
>
> C.E.O, Weather It Is, LTD
> Weather and Climate Focus
> http://weather-it-is.com
> Jerusalem, Israel
> Local: 02 930 9525
> Cell: 054 7 231 170
> Int-IS: x972 2 930 9525
>
>

-- 
Barry H. Lynn, Ph.D
Senior Associate Scientist, Lecturer,
The Institute of the Earth Science,
The Hebrew University of Jerusalem,
Givat Ram, Jerusalem 91904, Israel
Tel: 972 547 231 170
Fax: (972)-25662581

C.E.O, Weather It Is, LTD
Weather and Climate Focus
http://weather-it-is.com
Jerusalem, Israel
Local: 02 930 9525
Cell: 054 7 231 170
Int-IS: x972 2 930 9525
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200420/9841d672/attachment.html>


More information about the ncl-talk mailing list