<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">pskunjeer@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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>