<div dir="ltr">Mary,<br><br>Thanks so much for this quick fix! I can't believe i missed the library load for this function! That did the trick! <div><br></div><div>Many thanks,<br><br><br>Nick Luchetti</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 26, 2018 at 9:14 PM, Mary Haley <span dir="ltr"><<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Nick,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you read the documentation for time_axis_labels:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Document/Functions/User_contributed/time_axis_labels.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Document/Functions/User_<wbr>contributed/time_axis_labels.<wbr>shtml</a><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You'll see that you have to load a script to get access to this function:</div><div class="gmail_default" style="font-size:small"><br></div>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/contrib/time_axis_<wbr>labels.ncl<div class="gmail_default" style="font-size:small;display:inline">"</div><div><div class="gmail_default" style="font-size:small;display:inline"><br></div></div><div><div class="gmail_default" style="font-size:small;display:inline">Here's a simple script that uses this function with WRF data. Note that I also used wrf_times_c to convert from the WRF Times array to a numeric array of "hours since":</div></div><div><div class="gmail_default" style="font-size:small;display:inline"></div><br><font face="monospace, monospace">load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/wrf/WRF_<wbr>contributed.ncl"<br>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/contrib/time_axis_<wbr>labels.ncl"<br><br>fname = "../cdf_files/<a href="http://secure-web.cisco.com/1HtojnyvB7YZD0tepNfHd-hJsQirLkMCCiIL81zZ3bx_QKti8TlWx5pBJbZgmavvm1I0LQLElAzNVVqso5S1cnHUUCrWzCWAIQF2s05SlezEqQlWDydso5cDFnSIRuJxKzJGMlXQy-CFpgsn0Ojzv-T4MOenHCQP1wPMlEIuLIJtXhe4lBepYM2VgrzcGGSnseVyDiWutwuUoC0Ux_iKSjiuwl_Bm6k_OgJHiyYyWO8M8YlurBmvMze6zuC-07pfsHdmHh98QScf3zK9HUTlCYdavppnWGm1ebdQqpmo6Fdgg905caEXmlPV9XXaa7-BzewasCSFXFeFDV8hjosxBfAmpb_UN_eq4Z47chXTOMNv7uiSiK6kuxt6iRXCZcZE3dc7XjnorBIi9mBJ9oYL51t4rdzo9sfQ0MsWRRdhq6T8hqFmlZ5Qk7ghPF2oNv6r7/http%3A%2F%2Fwrfout_d01_000000_25time.nc" target="_blank">wrfout_d01_<wbr>000000_25time.nc</a>"<br><br>;---Convert WRF times to an "hours since" format <br>f = addfile(fname,"r")<br>Times = f->Times ; Times(Time, DateStrLen)(type character) </font></div><div><font face="monospace, monospace"><br>Time_1 = wrf_times_c( Times, 1 ) ; "hours since 1901-01-01 00:00:00"<br>;---Read some variable that has Time as a dimension pres = f->P<br>printVarSummary(pres)<br><br>;---Set some <div class="gmail_default" style="font-size:small;display:inline">plot options</div><div class="gmail_default" style="font-size:small;display:inline"></div> <br>res = True<br>res@xyLineColor = "NavyBlue"<br>res@xyLineThicknessF = 2.0<br><br></font><div class="gmail_default" style="font-size:small"><font face="monospace, monospace">;--Use time_axis_labels for nice time labels</font></div><font face="monospace, monospace">restick = True<br>restick@ttmFormat = "%N/%D~C~%H:%M"<br>restick@ttmAxis = "XB"<br>time_axis_labels( Time_1, res, restick )<br><br>wks = gsn_open_wks("x11","wrf_times"<wbr>)<br>plot = gsn_csm_xy( wks, Time_1, pres(:,0,0,0), res )<br></font><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Mon, Jun 25, 2018 at 12:44 PM, Nicholas Thomas Luchetti <span dir="ltr"><<a href="mailto:Nicholas.Luchetti@colorado.edu" target="_blank">Nicholas.Luchetti@colorado.<wbr>edu</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi all,<br><br>I am struggling to convert my x-axis time labels to UTC when plotting WRF output... <br><br>I've tried following the time_labels_3.ncl example: <a href="https://www.ncl.ucar.edu/Applications/Scripts/time_labels_3.ncl" target="_blank">https://www.ncl.ucar.<wbr>edu/Applications/Scripts/time_<wbr>labels_3.ncl</a><div><br></div><div>but can't seem to get it to even recognize the time_axis_labels function. It gives an error (screenshot attached) before even starting the script...<br><br>Additionally, my WRF simulations output every 5 minutes, so when I use the wrf_times_c function for hours since the beginning of the simulation, the times are listed as decimals (see attached screenshot)... Could this be an issue considering the example script displays a perfect 60 minute output from a WRF simulation? <br><br>I've also attached my script. Does anyone know of a quick fix for this? Or do I need to figure out a better way to convert the times to a useable format? <br><br>Thanks,<br><br>Nick Luchetti <span class="m_-924477091340175645HOEnZb"><font color="#888888"><br><br>-- <br><div class="m_-924477091340175645m_7673490919712865749gmail_signature"><div dir="ltr"><div><div dir="ltr"><span style="font-size:12.8px;color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif"><font size="2">Nicholas Luchetti</font></span><div><div><font color="#000000" face="Calibri, Arial, Helvetica, sans-serif" size="2">Graduate Student<br>Department of Atmospheric and Oceanic Sciences (ATOC)<br>CU Boulder <br></font><div style="font-size:12.8px;color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif"><br></div></div></div></div></div></div></div>
</font></span></div></div>
<br></div></div>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><span style="font-size:12.8px;color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif"><font size="2">Nicholas Luchetti</font></span><div><div><font color="#000000" face="Calibri, Arial, Helvetica, sans-serif" size="2">Graduate Student<br>Department of Atmospheric and Oceanic Sciences (ATOC)<br>CU Boulder <br></font><div style="font-size:12.8px;color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif"><br></div></div></div></div></div></div></div>
</div>