<html><head></head><body><div class="ydp34aba3d7yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div></div>
<div><br></div><div><br></div>
</div><div id="yahoo_quoted_7983023808" class="yahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
On Sunday, April 19, 2020, 11:27:47 PM GMT+2, zilore mumba <zmumba@yahoo.com> wrote:
</div>
<div><br></div>
<div><br></div>
<div><div id="yiv7781110550"><div><div class="yiv7781110550ydp9bf07722yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div></div>
<div dir="ltr">Thanks Rick, that is close. The error am getting now is:</div><div dir="ltr"> <span>fatal:Number of subscripts on rhs do not match number of dimensions of aggregated cat type variable, (4) Subscripts used, (3) Subscripts expected</span><br clear="none"></div><div><br clear="none"></div>
</div><div class="yiv7781110550yqt7626531940" id="yiv7781110550yqt05792"><div class="yiv7781110550yahoo_quoted" id="yiv7781110550yahoo_quoted_8222480418">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
On Sunday, April 19, 2020, 10:17:12 PM GMT+2, Rick Brownrigg <brownrig@ucar.edu> wrote:
</div>
<div><br clear="none"></div>
<div><br clear="none"></div>
<div><div id="yiv7781110550"><div><div dir="ltr"><div>HI Zilore,</div><div><br clear="none"></div><div>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:</div><div><br clear="none"></div><div> x = a[:]->T2(0,{850},{-15},{30})</div><div><br clear="none"></div><div>Rick<br clear="none"></div></div><br clear="none"><div class="yiv7781110550gmail_quote"><div class="yiv7781110550yqt8231179072" id="yiv7781110550yqt67703"><div class="yiv7781110550gmail_attr" dir="ltr">On Sun, Apr 19, 2020 at 1:54 PM zilore mumba via ncl-talk <<a rel="nofollow" shape="rect" ymailto="mailto:ncl-talk@ucar.edu" target="_blank" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>> wrote:<br clear="none"></div><blockquote class="yiv7781110550gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;"><div><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div dir="ltr">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.</div><div dir="ltr"> 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.</div><div dir="ltr">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.</div><div dir="ltr">I would appreciate ant assistance.</div><div dir="ltr"><div>begin<br clear="none">files = systemfunc("ls -1 data/wrfout_d01_2020*") + ".nc"<br clear="none"> a = addfiles(files,"r")<br clear="none"><br clear="none"> ListSetType (a, "cat") ; concatenate (=default)<br clear="none"> tc = wrf_user_getvar(a,"tc",0)<br clear="none"> printVarSummary (tc)<br clear="none"><br clear="none"> x = a->T2(0,{850},{-15},{30})<br clear="none"> asciiwrite("outfile.txt",x)<br clear="none">end<br clear="none"><br clear="none"></div><div dir="ltr">Zilore Mumba<br clear="none"></div></div></div></div>_______________________________________________<br clear="none">
ncl-talk mailing list<br clear="none">
<a rel="nofollow" shape="rect" ymailto="mailto:ncl-talk@ucar.edu" target="_blank" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br clear="none">
List instructions, subscriber options, unsubscribe:<br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div></div></div></div></div>
</div>
</div></div></div></div></div>
</div>
</div></body></html>