<div dir="ltr">I apologize for my vagueness. The error I get is "<font face="Menlo" style="font-size:11px">Undefined identifier: (wind_direction) is undefined, can't continue."</font><font face="arial, helvetica, sans-serif"> And I forgot to include the fact that I am using version 6.0.0, but I will use the equation in place of that function for now.</font></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&M University</span><br></div><div>Atmospheric Sciences Dept.</div><div>Eller O&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 10:23 AM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I added the following print statement. The 1st 10 values for each<br>
location are below.<br>
<span class=""><br>
wspd = sqrt(u^2 + v^2)<br>
wdir = wind_direction(u,v,0)<br>
<br>
</span> print(wspd+" "+u+" "+v+" "+wdir)<br>
<br>
<br>
(0) location=(37.25,-107.75) grid=(37.2053,-107.789)<br>
(0) 17.4863 15.6 7.9 243.142<br>
(1) 21.3026 19.4 8.8 245.601<br>
(2) 29.0661 28 7.8 254.434<br>
(3) 37.2979 35.7 10.8 253.168<br>
(4) 39.3146 36 15.8 246.304<br>
(5) 38.2027 33.2 18.9 240.348<br>
(6) 36.0325 30.3 19.5 237.236<br>
(7) 34.2118 27.9 19.8 234.638<br>
(8) 33.1622 26.3 20.2 232.474<br>
(9) 32.453 25.4 20.2 231.506<br>
[snip]<br>
(0) location=(43.25,-101.75) grid=(43.1875,-101.65)<br>
(0) 17.4152 17.3 2 263.405<br>
(1) 23.0235 22.8 -3.2 277.989<br>
(2) 29.3097 29.1 -3.5 276.858<br>
(3) 43.9915 43.8 -4.1 275.348<br>
(4) 46.5897 46.4 -4.2 275.172<br>
(5) 41.3241 41.2 -3.2 274.441<br>
(6) 37.191 37.1 -2.6 274.009<br>
(7) 34.8695 34.8 -2.2 273.617<br>
(8) 32.9439 32.9 -1.7 272.958<br>
(9) 31.1315 31.1 -1.4 272.578<br>
<br>
<br>
=====<br>
<br>
<br>
When you say error you never specified the specific error message.<br>
<br>
Was it something like ' wind_direction' not found?<br>
The 'wind_direction' function was introduced with NCL 6.1.0. Perhaps<br>
you have an old version of NCL. The current release is 6.3.0<br>
<br>
wdir = atan2(u,v)*57.29579 + 180<br>
<div class="HOEnZb"><div class="h5"><br>
On Fri, Oct 23, 2015 at 8:46 AM, Michelle Serino <<a href="mailto:mmserino@tamu.edu">mmserino@tamu.edu</a>> wrote:<br>
> For reference, this error is regarding the line that says, "wdir =<br>
> f->wind_direction(u,v,0)."<br>
><br>
> Michelle Serino<br>
> M.S. Candidate<br>
> Texas A&M University<br>
> Atmospheric Sciences Dept.<br>
> Eller O&M, Suite 1017<br>
> College Station, TX 77843<br>
> (484) 769-0949<br>
><br>
> On Fri, Oct 23, 2015 at 9:39 AM, Michelle Serino <<a href="mailto:mmserino@tamu.edu">mmserino@tamu.edu</a>> wrote:<br>
>><br>
>> Thank you for your quick reply! To clarify, what did you accomplish by<br>
>> submitting the JIRA ticket? Also, when I run your modified script, I am now<br>
>> getting an error that some vector subscripts need to be integers. Did you<br>
>> run into this as well?<br>
>><br>
>> Thanks again,<br>
>><br>
>> Michelle<br>
>><br>
>> Michelle Serino<br>
>> M.S. Candidate<br>
>> Texas A&M University<br>
>> Atmospheric Sciences Dept.<br>
>> Eller O&M, Suite 1017<br>
>> College Station, TX 77843<br>
>> (484) 769-0949<br>
>><br>
>> On Thu, Oct 22, 2015 at 6:55 PM, Dennis Shea <<a href="mailto:shea@ucar.edu">shea@ucar.edu</a>> wrote:<br>
>>><br>
>>> My speculation is that different grib tables are being accessed.<br>
>>><br>
>>> JIRA-2297<br>
>>><br>
>>> On Thu, Oct 22, 2015 at 5:36 PM, Dennis Shea <<a href="mailto:shea@ucar.edu">shea@ucar.edu</a>> wrote:<br>
>>> > There appears to be a naming error.<br>
>>> ><br>
>>> > When I do<br>
>>> ><br>
>>> > %> ncl_filedump ruc2anl_252_20090605_2000_000.grb | less<br>
>>> ><br>
>>> > I get the variable names you use.<br>
>>> ><br>
>>> > ===<br>
>>> ><br>
>>> > When I execute your script I ran into errors. I inserted a<br>
>>> ><br>
>>> > f = addfile(...)<br>
>>> > print(f) ; should match ncl_filedump BUT they don't<br>
>>> > ... NCL need to fix<br>
>>> ><br>
>>> > The variable names and dimension names are changed from the<br>
>>> > ncl_filedump.<br>
>>> ><br>
>>> > I will fill out a JIRA ticket.<br>
>>> ><br>
>>> > However, we can use the variable names from the 'print(f)', the script<br>
>>> > works correctly.<br>
>>> ><br>
>>> ><br>
>>> > ===<br>
>>> > See attached<br>
>>> ><br>
>>> ><br>
>>> ><br>
>>> ><br>
>>> ><br>
>>> > On Thu, Oct 22, 2015 at 4:55 PM, Michelle Serino <<a href="mailto:mmserino@tamu.edu">mmserino@tamu.edu</a>><br>
>>> > wrote:<br>
>>> >> Good afternoon,<br>
>>> >><br>
>>> >> I am modifying one of NCAR's scripts (skewt_6.ncl) to plot a skew-T<br>
>>> >> with<br>
>>> >> RUC2 Analysis data in grib1 format. I have modified the script<br>
>>> >> accordingly<br>
>>> >> to reflect the change in file type and to apply to the case I am<br>
>>> >> studying,<br>
>>> >> but most everything else I have left as it was originally. I am<br>
>>> >> receiving<br>
>>> >> an error that, after some extensive research and attempts, I have been<br>
>>> >> unable to fix, so I appreciate any help that anyone can provide.<br>
>>> >><br>
>>> >> My code:<br>
>>> >><br>
>>> >> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>
>>> >><br>
>>> >> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br>
>>> >><br>
>>> >> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/skewt_func.ncl"<br>
>>> >><br>
>>> >><br>
>>> >> begin<br>
>>> >><br>
>>> >><br>
>>> >> ; --- Read RUC GRIB file------------;<br>
>>> >><br>
>>> >> dir = "/atmomounts/home/grad/mserino/Desktop/"<br>
>>> >><br>
>>> >> fil = "ruc2anl_252_20090605_2000_000.grb"<br>
>>> >><br>
>>> >><br>
>>> >> ; force a 'time' dimension<br>
>>> >><br>
>>> >> setfileoption("grb","SingleElementDimensions","Initial_time")<br>
>>> >><br>
>>> >><br>
>>> >> f = addfile(dir+fil,"r")<br>
>>> >><br>
>>> >> p = int2flt(f->lv_ISBL2) ; ( lv_ISBL2 )<br>
>>> >><br>
>>> >> time = f->initial_time0_encoded ; yyyymmddhh.hh_frac<br>
>>> >><br>
>>> >><br>
>>> >> ; RUC grid point locations<br>
>>> >><br>
>>> >> lat2d = f->gridlat_252 ; ( ygrid_0, xgrid_0 )<br>
>>> >><br>
>>> >> lon2d = f->gridlon_252<br>
>>> >><br>
>>> >> print("lat2d: min="+min(lat2d)+" ; max="+max(lat2d))<br>
>>> >><br>
>>> >> print("lon2d: min="+min(lon2d)+" ; max="+max(lon2d))<br>
>>> >><br>
>>> >><br>
>>> >> ;p = p*0.01 ; change units<br>
>>> >><br>
>>> >> p@units = "hPa" ; skewT, mixhum_ptrh use mb<br>
>>> >> (hPa)<br>
>>> >><br>
>>> >><br>
>>> >> ; --- Specify one or more locations<br>
>>> >><br>
>>> >><br>
>>> >> lat = (/ 37.25 , 43.25 /)<br>
>>> >><br>
>>> >> lon = (/-107.75 ,-101.75 /)<br>
>>> >><br>
>>> >> npts = dimsizes(lat)<br>
>>> >><br>
>>> >><br>
>>> >> ; create plot(s)<br>
>>> >><br>
>>> >><br>
>>> >> skewtOpts = True<br>
>>> >><br>
>>> >> skewtOpts@DrawColAreaFill = True ; default is False<br>
>>> >><br>
>>> >><br>
>>> >> dataOpts = True<br>
>>> >><br>
>>> >> dataOpts@PrintZ = True<br>
>>> >><br>
>>> >><br>
>>> >> do n=0,npts-1 ; loop over each grid pt<br>
>>> >><br>
>>> >><br>
>>> >> ; find grid point nearest the user specified location<br>
>>> >><br>
>>> >> nm = getind_latlon2d (lat2d,lon2d, lat(n), lon(n))<br>
>>> >><br>
>>> >> nn = nm(0,0)<br>
>>> >><br>
>>> >> mm = nm(0,1)<br>
>>> >><br>
>>> >> print("location=("+lat(n)+","+lon(n)+")<br>
>>> >> grid=("+lat2d(nn,mm)+","+lon2d(nn,mm)+")")<br>
>>> >><br>
>>> >><br>
>>> >><br>
>>> >> tk = f->TMP_252_ISBL(0,:,nn,mm)<br>
>>> >><br>
>>> >> z = f->HGT_P0_252_ISBL(0,:,nn,mm)<br>
>>> >><br>
>>> >> rh = f->R_H_P0_252_ISBL(0,:,nn,mm)<br>
>>> >><br>
>>> >> u = f->U_GRD_252_ISBL(0,:,nn,mm)<br>
>>> >><br>
>>> >> v = f->V_GRD_252_ISBL(0,:,nn,mm)<br>
>>> >><br>
>>> >><br>
>>> >> ; change units and calculate needed variables<br>
>>> >><br>
>>> >> tc = tk - 273.15<br>
>>> >><br>
>>> >> tc@units= "degC"<br>
>>> >><br>
>>> >><br>
>>> >> q = mixhum_ptrh (p, tk, rh, 2)<br>
>>> >><br>
>>> >> q@units = "kg/kg"<br>
>>> >><br>
>>> >><br>
>>> >> tdc = dewtemp_trh(tk,rh) - 273.15<br>
>>> >><br>
>>> >> tdc@units = "degC"<br>
>>> >><br>
>>> >><br>
>>> >> wspd = sqrt(u^2 + v^2)<br>
>>> >><br>
>>> >> wdir = wind_direction(u,v,0)<br>
>>> >><br>
>>> >><br>
>>> >> itime= toint(time)<br>
>>> >><br>
>>> >> skewtOpts@tiMainString = "RUC: "+itime+":<br>
>>> >> ("+lat(n)+","+lon(n)+")"<br>
>>> >><br>
>>> >><br>
>>> >> ; each location will have a different file name<br>
>>> >><br>
>>> >> wks = gsn_open_wks ("png",<br>
>>> >> "ruc2anl_skewt_"+itime+"_"+sprinti("%0.3i",n))<br>
>>> >><br>
>>> >> skewt_bkgd = skewT_BackGround (wks, skewtOpts)<br>
>>> >><br>
>>> >> skewt_data = skewT_PlotData (wks, skewt_bkgd, p,tc,tdc,z,<br>
>>> >> wspd,wdir, dataOpts)<br>
>>> >><br>
>>> >> draw (skewt_bkgd)<br>
>>> >><br>
>>> >> draw (skewt_data)<br>
>>> >><br>
>>> >> frame(wks)<br>
>>> >><br>
>>> >> end do<br>
>>> >><br>
>>> >><br>
>>> >> end<br>
>>> >><br>
>>> >><br>
>>> >> The error I get regards the lines in red:<br>
>>> >><br>
>>> >> Either file (f) isn't defined or variable (lv_ISBL2) is not a variable<br>
>>> >> in<br>
>>> >> the file<br>
>>> >><br>
>>> >><br>
>>> >> The correct file, f, is defined because I am able to print its<br>
>>> >> contents.<br>
>>> >> The variable "lv_ISBL2" is also a defined variable in the file, so I<br>
>>> >> am not<br>
>>> >> sure why it is not recognized. My code is attached, and the RUC2 data<br>
>>> >> are<br>
>>> >> available at the link below. Thank you again, and I look forward to<br>
>>> >> hearing<br>
>>> >> from you.<br>
>>> >><br>
>>> >><br>
>>> >> ruc2anl_252_20090605_2000_000.grb<br>
>>> >><br>
>>> >><br>
>>> >> Best regards,<br>
>>> >><br>
>>> >><br>
>>> >> Michelle Serino<br>
>>> >> M.S. Candidate<br>
>>> >> Texas A&M University<br>
>>> >> Atmospheric Sciences Dept.<br>
>>> >> Eller O&M, Suite 1017<br>
>>> >> College Station, TX 77843<br>
>>> >> (484) 769-0949<br>
>>> >><br>
>>> >><br>
>>> >> _______________________________________________<br>
>>> >> ncl-talk mailing list<br>
>>> >> <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
>>> >> List instructions, subscriber options, unsubscribe:<br>
>>> >> <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
>>> >><br>
>><br>
>><br>
><br>
</div></div></blockquote></div><br></div>