<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">http://www.ncl.ucar.edu/Document/Functions/User_contributed/time_axis_labels.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/nclscripts/contrib/time_axis_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/nclscripts/wrf/WRF_contributed.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/time_axis_labels.ncl"<br><br>fname = "../cdf_files/<a href="http://wrfout_d01_000000_25time.nc">wrfout_d01_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")<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">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.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">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="HOEnZb"><font color="#888888"><br><br>-- <br><div class="m_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>______________________________<wbr>_________________<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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>