<div dir="ltr">For reference, this error is regarding the line that says, &quot;<span style="font-family:Menlo;font-size:11px">wdir = f-&gt;wind_direction(u,v,0).</span>&quot;<br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr">Michelle Serino<div>M.S. Candidate</div><div><span style="font-size:small">Texas A&amp;M University</span><br></div><div>Atmospheric Sciences Dept.</div><div>Eller O&amp;M, Suite 1017</div><div>College Station, TX 77843<br></div><div>(484) 769-0949</div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Fri, Oct 23, 2015 at 9:39 AM, Michelle Serino <span dir="ltr">&lt;<a href="mailto:mmserino@tamu.edu" target="_blank">mmserino@tamu.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thank you for your quick reply!  To clarify, what did you accomplish by submitting the JIRA ticket?  Also, when I run your modified script, I am now getting an error that some vector subscripts need to be integers.  Did you run into this as well?<div><br></div><div>Thanks again,</div><div><br></div><div>Michelle</div></div><div class="gmail_extra"><span class=""><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr">Michelle Serino<div>M.S. Candidate</div><div><span style="font-size:small">Texas A&amp;M University</span><br></div><div>Atmospheric Sciences Dept.</div><div>Eller O&amp;M, Suite 1017</div><div>College Station, TX 77843<br></div><div>(484) 769-0949</div></div></div></div></div></div></div></div></div></div>
<br></span><div><div class="h5"><div class="gmail_quote">On Thu, Oct 22, 2015 at 6:55 PM, Dennis Shea <span dir="ltr">&lt;<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">My speculation is that different grib tables are being accessed.<br>
<br>
JIRA-2297<br>
<div><div><br>
On Thu, Oct 22, 2015 at 5:36 PM, Dennis Shea &lt;<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>&gt; wrote:<br>
&gt; There appears to be a naming error.<br>
&gt;<br>
&gt; When I do<br>
&gt;<br>
&gt; %&gt; ncl_filedump ruc2anl_252_20090605_2000_000.grb | less<br>
&gt;<br>
&gt; I get the variable names you use.<br>
&gt;<br>
&gt; ===<br>
&gt;<br>
&gt; When I execute your script I ran into errors. I inserted a<br>
&gt;<br>
&gt; f = addfile(...)<br>
&gt; print(f)                ; should match ncl_filedump BUT they don&#39;t<br>
&gt; ... NCL need to fix<br>
&gt;<br>
&gt; The variable names and dimension names are changed from the ncl_filedump.<br>
&gt;<br>
&gt; I will fill out a JIRA ticket.<br>
&gt;<br>
&gt; However, we can use the variable names from the &#39;print(f)&#39;, the script<br>
&gt; works correctly.<br>
&gt;<br>
&gt;<br>
&gt; ===<br>
&gt; See attached<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Thu, Oct 22, 2015 at 4:55 PM, Michelle Serino &lt;<a href="mailto:mmserino@tamu.edu" target="_blank">mmserino@tamu.edu</a>&gt; wrote:<br>
&gt;&gt; Good afternoon,<br>
&gt;&gt;<br>
&gt;&gt; I am modifying one of NCAR&#39;s scripts (skewt_6.ncl) to plot a skew-T with<br>
&gt;&gt; RUC2 Analysis data in grib1 format.  I have modified the script accordingly<br>
&gt;&gt; to reflect the change in file type and to apply to the case I am studying,<br>
&gt;&gt; but most everything else I have left as it was originally.  I am receiving<br>
&gt;&gt; an error that, after some extensive research and attempts, I have been<br>
&gt;&gt; unable to fix, so I appreciate any help that anyone can provide.<br>
&gt;&gt;<br>
&gt;&gt; My code:<br>
&gt;&gt;<br>
&gt;&gt; load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;<br>
&gt;&gt;<br>
&gt;&gt; load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot;<br>
&gt;&gt;<br>
&gt;&gt; load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/skewt_func.ncl&quot;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; begin<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; ; --- Read RUC GRIB file------------;<br>
&gt;&gt;<br>
&gt;&gt;     dir  = &quot;/atmomounts/home/grad/mserino/Desktop/&quot;<br>
&gt;&gt;<br>
&gt;&gt;     fil  = &quot;ruc2anl_252_20090605_2000_000.grb&quot;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;     ; force a &#39;time&#39; dimension<br>
&gt;&gt;<br>
&gt;&gt;     setfileoption(&quot;grb&quot;,&quot;SingleElementDimensions&quot;,&quot;Initial_time&quot;)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;     f     = addfile(dir+fil,&quot;r&quot;)<br>
&gt;&gt;<br>
&gt;&gt;     p     = int2flt(f-&gt;lv_ISBL2)               ;  ( lv_ISBL2 )<br>
&gt;&gt;<br>
&gt;&gt;     time  = f-&gt;initial_time0_encoded  ; yyyymmddhh.hh_frac<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;     ; RUC grid point locations<br>
&gt;&gt;<br>
&gt;&gt;     lat2d = f-&gt;gridlat_252              ; ( ygrid_0, xgrid_0 )<br>
&gt;&gt;<br>
&gt;&gt;     lon2d = f-&gt;gridlon_252<br>
&gt;&gt;<br>
&gt;&gt;     print(&quot;lat2d: min=&quot;+min(lat2d)+&quot;  ;  max=&quot;+max(lat2d))<br>
&gt;&gt;<br>
&gt;&gt;     print(&quot;lon2d: min=&quot;+min(lon2d)+&quot;  ;  max=&quot;+max(lon2d))<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;     ;p     = p*0.01                    ; change units<br>
&gt;&gt;<br>
&gt;&gt;     p@units = &quot;hPa&quot;                   ; skewT, mixhum_ptrh use mb (hPa)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;     ; --- Specify one or more locations<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;     lat   = (/ 37.25    , 43.25 /)<br>
&gt;&gt;<br>
&gt;&gt;     lon   = (/-107.75 ,-101.75   /)<br>
&gt;&gt;<br>
&gt;&gt;     npts  = dimsizes(lat)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;     ; create plot(s)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;     skewtOpts                 = True<br>
&gt;&gt;<br>
&gt;&gt;     skewtOpts@DrawColAreaFill = True    ; default is False<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;     dataOpts   = True<br>
&gt;&gt;<br>
&gt;&gt;     dataOpts@PrintZ = True<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;     do n=0,npts-1           ; loop over each grid pt<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;         ; find grid point nearest the user specified location<br>
&gt;&gt;<br>
&gt;&gt;         nm  = getind_latlon2d (lat2d,lon2d, lat(n), lon(n))<br>
&gt;&gt;<br>
&gt;&gt;         nn  = nm(0,0)<br>
&gt;&gt;<br>
&gt;&gt;         mm  = nm(0,1)<br>
&gt;&gt;<br>
&gt;&gt;         print(&quot;location=(&quot;+lat(n)+&quot;,&quot;+lon(n)+&quot;)<br>
&gt;&gt; grid=(&quot;+lat2d(nn,mm)+&quot;,&quot;+lon2d(nn,mm)+&quot;)&quot;)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;         tk   = f-&gt;TMP_252_ISBL(0,:,nn,mm)<br>
&gt;&gt;<br>
&gt;&gt;         z    = f-&gt;HGT_P0_252_ISBL(0,:,nn,mm)<br>
&gt;&gt;<br>
&gt;&gt;         rh   = f-&gt;R_H_P0_252_ISBL(0,:,nn,mm)<br>
&gt;&gt;<br>
&gt;&gt;         u    = f-&gt;U_GRD_252_ISBL(0,:,nn,mm)<br>
&gt;&gt;<br>
&gt;&gt;         v    = f-&gt;V_GRD_252_ISBL(0,:,nn,mm)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;         ; change units and calculate needed variables<br>
&gt;&gt;<br>
&gt;&gt;         tc   = tk - 273.15<br>
&gt;&gt;<br>
&gt;&gt;         tc@units= &quot;degC&quot;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;         q    = mixhum_ptrh (p, tk, rh, 2)<br>
&gt;&gt;<br>
&gt;&gt;         q@units = &quot;kg/kg&quot;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;         tdc  = dewtemp_trh(tk,rh) - 273.15<br>
&gt;&gt;<br>
&gt;&gt;         tdc@units = &quot;degC&quot;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;         wspd = sqrt(u^2 + v^2)<br>
&gt;&gt;<br>
&gt;&gt;         wdir = wind_direction(u,v,0)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;         itime= toint(time)<br>
&gt;&gt;<br>
&gt;&gt;         skewtOpts@tiMainString    = &quot;RUC: &quot;+itime+&quot;:<br>
&gt;&gt; (&quot;+lat(n)+&quot;,&quot;+lon(n)+&quot;)&quot;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;         ; each location will have a different file name<br>
&gt;&gt;<br>
&gt;&gt;         wks  = gsn_open_wks (&quot;png&quot;,<br>
&gt;&gt; &quot;ruc2anl_skewt_&quot;+itime+&quot;_&quot;+sprinti(&quot;%0.3i&quot;,n))<br>
&gt;&gt;<br>
&gt;&gt;         skewt_bkgd = skewT_BackGround (wks, skewtOpts)<br>
&gt;&gt;<br>
&gt;&gt;         skewt_data = skewT_PlotData   (wks, skewt_bkgd, p,tc,tdc,z,<br>
&gt;&gt; wspd,wdir, dataOpts)<br>
&gt;&gt;<br>
&gt;&gt;         draw (skewt_bkgd)<br>
&gt;&gt;<br>
&gt;&gt;         draw (skewt_data)<br>
&gt;&gt;<br>
&gt;&gt;         frame(wks)<br>
&gt;&gt;<br>
&gt;&gt;     end do<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; end<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; The error I get regards the lines in red:<br>
&gt;&gt;<br>
&gt;&gt; Either file (f) isn&#39;t defined or variable (lv_ISBL2) is not a variable in<br>
&gt;&gt; the file<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; The correct file, f, is defined because I am able to print its contents.<br>
&gt;&gt; The variable &quot;lv_ISBL2&quot; is also a defined variable in the file, so I am not<br>
&gt;&gt; sure why it is not recognized.  My code is attached, and the RUC2 data are<br>
&gt;&gt; available at the link below.  Thank you again, and I look forward to hearing<br>
&gt;&gt; from you.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; ruc2anl_252_20090605_2000_000.grb<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Best regards,<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Michelle Serino<br>
&gt;&gt; M.S. Candidate<br>
&gt;&gt; Texas A&amp;M University<br>
&gt;&gt; Atmospheric Sciences Dept.<br>
&gt;&gt; Eller O&amp;M, Suite 1017<br>
&gt;&gt; College Station, TX 77843<br>
&gt;&gt; (484) 769-0949<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; ncl-talk mailing list<br>
&gt;&gt; <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
&gt;&gt; List instructions, subscriber options, unsubscribe:<br>
&gt;&gt; <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
&gt;&gt;<br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div>