<div dir="ltr">Hi Prasad,<div>Can you send ncl-talk the output from the following printVarSummary call:</div><div><span style="font-family:sans-serif;font-size:12.8px">time_axis_labels(Time_0,</span><span style="font-family:sans-serif;font-size:12.8px">restime,restick)</span><br style="font-family:sans-serif;font-size:12.8px"><b>printVarSummary(restime)</b></div><div><b>printVarSummary(ua(:,:,100,100))</b><br style=""><span style="font-family:sans-serif;font-size:12.8px">contour_vor = wrf_contour(sfile,wks,ua(:,:,</span><span style="font-family:sans-serif;font-size:12.8px">100,100),restime)</span></div><div>Adam</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 2, 2019 at 9:43 AM Prasad Kunjeer via ncl-talk <<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Sorry I just forgot to attach the file.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 2, 2019, 9:04 PM Prasad Kunjeer <<a href="mailto:pskunjeer@gmail.com" target="_blank">pskunjeer@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div style="font-family:sans-serif;font-size:12.8px" dir="auto">Sir,</div><div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br></div><div style="font-family:sans-serif;font-size:12.8px" dir="auto">I am trying to plot a simple graph from a WRF output. The X axis of the plot is time and i want to print the time table for the same. I am using the function 'time_axis_labels'. I have attached the script:</div><div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br></div><div style="font-family:sans-serif;font-size:12.8px" dir="auto">load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/time_axis_labels.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"<br>;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br>;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br>; This file still has to be loaded manually<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/time_axis_labels.ncl"<br> <br> srcDirName = "/home/prasad/res/"<br> srcFileName = "<a href="http://newdo3.nc/" style="text-decoration-line:none;color:rgb(66,133,244)" rel="noreferrer noreferrer" target="_blank">newdo3.nc</a>"<br> srcFilePath = srcDirName + srcFileName<br>;---Retrieve either one level, or all levels. Use '-1' for all.<br> sfile = addfile(srcFilePath,"r")<br><br> ua = wrf_user_getvar(sfile,"ua",-1) ; On mass grid<br> va = wrf_user_getvar(sfile,"va",-1)<br> printVarSummary(ua) ; (Time,bottom_top,south_north,west_east)<br> printVarSummary(va) ; (Time,bottom_top,south_north,west_east)<br><br> Times = sfile->Times<br> Time_0 = wrf_times_c(Times, 0)<br><br> printVarSummary(Times)<br> printVarSummary(Time_0)<br> print(Time_0)<br><br> wks = gsn_open_wks("png","time_labels") ; send graphics to PNG file<br>;--------------------------------------------------<br>; The time_axis_label function adds additional<br>; resources to "res" to produce nicely-formatted<br>; time labels on X axis. This function only works<br>; if you have a time "units" recognized by the<br>; cd_calendar function.<br>;--------------------------------------------------<br> pltres = True<br> restime = True<br> restick = True<br> restick@ttmFormat = "%N/%D %H:%M"<br> time_axis_labels(Time_0,restime,restick)<br><br> contour_vor = wrf_contour(sfile,wks,ua(:,:,100,100),restime)<br> plot = wrf_overlays(sfile,wks,(/contour_vor/),pltres)<br></div><div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br></div><div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br></div><div style="font-family:sans-serif;font-size:12.8px" dir="auto">The WRF file contains the 25 time steps at 3 hour interval. I have attached the output of printvarSummary and print of the time varibale.</div><div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br></div><div style="font-family:sans-serif;font-size:12.8px" dir="auto">Variable: Time_0<br>Type: double<br>Total Size: 200 bytes<br> 25 values<br>Number of Dimensions: 1<br>Dimensions and sizes: [Time | 25]<br>Coordinates:<br> Time: [ 0.. 72]<br>Number Of Attributes: 4<br> units : hours since 2018-09-22 12:00:00<br> calendar : standard<br> long_name : Time<br> description : Time<br></div><div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br></div><div style="font-family:sans-serif;font-size:12.8px" dir="auto">Variable: Time_0<br>Type: double<br>Total Size: 200 bytes<br> 25 values<br>Number of Dimensions: 1<br>Dimensions and sizes: [Time | 25]<br>Coordinates:<br> Time: [ 0.. 72]<br>Number Of Attributes: 4<br> units : hours since 2018-09-22 12:00:00<br> calendar : standard<br> long_name : Time<br> description : Time<br>(0) 0<br>(1) 3<br>(2) 6<br>(3) 9<br>(4) 12 etc.<br></div><div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br></div><div style="font-family:sans-serif;font-size:12.8px" dir="auto">But when I plot the figure, the output takes 1 hour interval rather than 3 hour interval.</div><div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br></div><div style="font-family:sans-serif;font-size:12.8px" dir="auto"><div dir="auto">The time interval for WRF file is 3 hour and there are 25 time steps. The first time steps is 22/09/2018 1200. The time should start from 22/09/2018 and end at 25/09/2018 with 25 time steps (22/09/2018 1200, 22/09/2018 1500 etc upto 25/09/2018 1200). But the graph ends at 23/09/2018 1200 which correspond to 25 time steps at 1 hour interval. I want graph to end at 25/09/2018 1200.<br></div></div><div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br></div><div style="font-family:sans-serif;font-size:12.8px" dir="auto">Please guide in correcting the output of graph</div></div>
</blockquote></div>
_______________________________________________<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/mailman/listinfo/ncl-talk</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist, </font></span><span><font color="#888888">Climate and Global Dynamics Laboratory, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a> </font></span><span><font color="#888888">303-497-1726 </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>