<div dir="ltr"><div dir="ltr"><div>Hi Prasad,</div><div>From the figure you had attached, it seems that the NCL is plotting 3 hourly data correctly. For example, count the minor tic mark lines, i.e small vertical grey lines on x-axis. The problem is that it is not showing results to the last value of your data.</div><div>Try setting the following two resources for both/one of your resources set, i.e. restime and restic:</div><div><br></div><div>restime@trXMinF = 0 ; OR min(Time_0)</div><div>
restime@trXMaxF = 72; OR 25; OR max(Time_0)
</div><div><br></div><div>
<div>restic@trXMinF = 0 ; OR min(Time_0)</div><div>
restic@trXMaxF = 72; OR 25; OR max(Time_0)
</div>
</div><div><br></div><div>PS: I have not used WRF plotting routines, so I am not quite sure if these would work. Anyway, worth a try.<br></div><div><br></div><div>Cheers,</div><div>Rashed<br></div><div><br></div><div><br></div><div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Oct 5, 2019 at 2: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="ltr"><div>Hi Adam,</div><div><br></div><div>I have modified the script as per your instructions. The output of the PrintVarSummary (ua) is given below ;</div><div><br></div><div>Variable: ua (subsection)<br>Type: float<br>Total Size: 3200 bytes<br> 800 values<br>Number of Dimensions: 2<br>Dimensions and sizes: [Time | 25] x [bottom_top | 32]<br>Coordinates: <br> <b> Time: [0..72]</b><br>Number Of Attributes: 6<br> FieldType : 104<br> MemoryOrder : XYZ<br> description : x-wind component<br> units : m s-1<br> stagger : <br> coordinates : XLONG XLAT<br></div><div><br></div><div>But still, there is no change in the graph.<br></div><div> <br></div><div><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><span style="font-size:10pt;font-family:"Mangal","serif"" lang="HI">Regards<br>प्रसाद कुंजीर</span><span style="font-size:9pt;font-family:"Arial","sans-serif"">/ </span><span style="font-size:10.5pt;font-family:"Arial","sans-serif"">Prasad Kunjeer<br>
</span><span><span style="font-size:10.5pt;font-family:"Mangal","serif"" lang="HI">वैज्ञानिक -</span></span><span lang="hi"> सी</span><span><span style="font-size:10.5pt;font-family:"Mangal","serif"" lang="HI"> / </span><span style="font-size:10.5pt;font-family:"Arial","sans-serif"">Scientist - C<br>
</span><span style="font-size:10.5pt;font-family:"Mangal","serif"" lang="HI">केन्द्रीय जल और विद्युत अनुसंधान</span><span style="font-size:10.5pt;font-family:"Arial","sans-serif"" lang="HI"> </span><span style="font-size:10.5pt;font-family:"Mangal","serif"" lang="HI">शाला / </span><span style="font-size:10.5pt;font-family:"Arial","sans-serif"">Central Water and Power Research Station<br>
</span><span style="font-size:10.5pt;font-family:"Mangal","serif"" lang="HI">पुणे </span><span style="font-size:10.5pt;font-family:"Arial","sans-serif"">411 024/ Pune 411 024</span></span></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Oct 5, 2019 at 3:59 AM Adam Phillips <<a href="mailto:asphilli@ucar.edu" target="_blank">asphilli@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="ltr">Hi Prasad,<div>Your ur array does not have a time coordinate variable as shown here:</div><div>Type: float<br>Total Size: 3200 bytes<br> 800 values<br>Number of Dimensions: 2<br>Dimensions and sizes: [Time | 25] x [bottom_top | 32]<br><b>Coordinates:</b><br>Number Of Attributes: 6<br></div><div><br></div><div>Thus, NCL defaults to setting your times to go from 0 to 24 (as you have 25 timesteps). This is why you are only seeing two labels at tmXBValues 0 and 18, as the range that is shown on the plot goes from 0->24. To fix this, I would recommend assigning a coordinate variable to ua as follows:</div><div>ua&Time = ispan(0,72,3)</div><div><br></div><div>That way the Times associated with ua run from 0->72, and your tick mark labels cover the same span. </div><div><br></div><div>If you have any further questions please respond to the ncl-talk email list.</div><div>Adam </div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 3, 2019 at 3:17 AM 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="ltr"><div>SIr,</div><div><br></div><div>The outputs of:</div><div><br></div><div><b>printVarSummary(restime) is<br></b></div><div><b>Variable: restime<br>Type: logical<br>Total Size: 4 bytes<br> 1 values<br>Number of Dimensions: 1<br>Dimensions and sizes: [1]<br>Coordinates: <br>Number Of Attributes: 4<br> tmXBMode : Explicit<br> tmXBValues : ( 0, 18, 36, 54, 72 )<br> tmXBMinorValues : <ARRAY of 25 elements><br> tmXBLabels : ( 09/22 12:00, 09/23 06:00, 09/24 00:00, 09/24 18:00, 09/25 12:00 )</b></div><div><b><br></b></div><div><b><b>printVarSummary(ua(:,:,100,100)) is </b><span><br></span></b></div><div><b>Type: float<br>Total Size: 3200 bytes<br> 800 values<br>Number of Dimensions: 2<br>Dimensions and sizes: [Time | 25] x [bottom_top | 32]<br>Coordinates: <br>Number Of Attributes: 6<br> FieldType : 104<br> MemoryOrder : XYZ<br> description : x-wind component<br> units : m s-1<br> stagger : <br> coordinates : XLONG XLAT<br></b></div><div><br></div><div>In restime it is showing labels from 09/22 12:00, 09/23 06:00, 09/24 00:00, 09/24 18:00, 09/25 12:00 but during plotting it is not showing the same.</div><div><br></div><div><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><span style="font-size:10pt;font-family:Mangal,serif" lang="HI">Regards<br>प्रसाद कुंजीर</span><span style="font-size:9pt;font-family:Arial,sans-serif">/ </span><span style="font-size:10.5pt;font-family:Arial,sans-serif">Prasad Kunjeer<br>
</span><span><span style="font-size:10.5pt;font-family:Mangal,serif" lang="HI">वैज्ञानिक -</span></span><span lang="hi"> सी</span><span><span style="font-size:10.5pt;font-family:Mangal,serif" lang="HI"> / </span><span style="font-size:10.5pt;font-family:Arial,sans-serif">Scientist - C<br>
</span><span style="font-size:10.5pt;font-family:Mangal,serif" lang="HI">केन्द्रीय जल और विद्युत अनुसंधान</span><span style="font-size:10.5pt;font-family:Arial,sans-serif" lang="HI"> </span><span style="font-size:10.5pt;font-family:Mangal,serif" lang="HI">शाला / </span><span style="font-size:10.5pt;font-family:Arial,sans-serif">Central Water and Power Research Station<br>
</span><span style="font-size:10.5pt;font-family:Mangal,serif" lang="HI">पुणे </span><span style="font-size:10.5pt;font-family:Arial,sans-serif">411 024/ Pune 411 024</span></span></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 2, 2019 at 11:09 PM Adam Phillips <<a href="mailto:asphilli@ucar.edu" target="_blank">asphilli@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="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><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" target="_blank">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"><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>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><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>
</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>