<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><div>Dear NCL users,</div><div>I have hourly wrf arw output and plotted t<span style="font-size: 12pt;">he hovmoller diagramme  along the cross section of two points  for july as </span></div><div><ul><li>monthly average of each hour (average value of 0 hour, 1 hour ........23 hour of each day) precipitation for whole month ( 24 values ).</li><li>ploted hovmoller for  hourly time  vs cross section grid of two points.</li><li>i have used reshape function however i am confused whether its producing right output or not.(use of reshape function for my purpose). <b>(array as 24, number of days, ncross_section_points and averaging for days </b></li><li>furthermore, I would like to convert the UTC time to local time (5:45 hour ahead of UTC) in my plot but could not get idea to do so.</li></ul></div><div>I look forward for getting feedback from you.</div><div><b>my script</b></div><div><b><br></b></div><div>; This script is used to plot </div><div>; get each hour average value for 24 hours</div><div>; get data along two point section</div><div>; plot hovmoller for time vs grid along section </div><div><br></div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"</div><div><br></div><div>begin</div><div>; The WRF ARW input file.  </div><div>; This needs to have a ".nc" appended, so just do it.</div><div> DATADir = "/geodata/data/private/fgvy024/Build_WRF/WRFV6/run/"</div><div> FILES = systemfunc (" ls -1 " + DATADir + "wrfout_d03_2015-07*") ; contain hourly time stamp</div><div> numFILES = dimsizes(FILES)</div><div> a = addfiles(FILES+".nc","r")</div><div> </div><div> type = "png"                ; map type</div><div> wks = gsn_open_wks(type,"july_hovmoller_hourly_ppt")         ; Create a plot workstation</div><div> rain_exp = wrf_user_getvar(a,"RAINNC",-1)</div><div> rain_con = wrf_user_getvar(a,"RAINC",-1)</div><div> rain = rain_exp + rain_con</div><div> Remp = dimsizes(rain)</div><div> nt = Remp(0)</div><div> nnlat = Remp(1)</div><div> nlon = Remp(2)</div><div>; get hourly rainfall</div><div>  Ree = rain(1:nt-1,:,:) - rain(0:nt-2,:,:) ; to get hourly precipitation</div><div> ; get new variable with full time step to make it multiplable by 24</div><div>  Re = new((/nt, nnlat, nlon/),float)</div><div>  Re(1:nt-1,:,:) = Ree(:,:, :) </div><div>  Re(0, :, :) = 0 ; first array will have zero value</div><div>  dims = dimsizes(Re)</div><div>  pA_lon = 86.2233 ; longitude of point A</div><div>  pA_lat = 27.88163333 ; lat of point A</div><div>  pB_lon = 86.541725 ; similar for point B</div><div>  pB_lat = 27.89950278</div><div>    pointA = wrf_user_ll_to_ij(a, pA_lon, pA_lat, True) ; get array point</div><div>    pointB = wrf_user_ll_to_ij(a, pB_lon, pB_lat, True)</div><div>    xA = pointA(0) - 1</div><div>    yA = pointA(1) - 1  </div><div>    xB = pointB(0) - 1</div><div>    yB = pointB(1) - 1 </div><div>  opts = True </div><div>  plane = new(4,float) ; for section along two points</div><div>  plane = (/  yA,xA, yB,xB  /)</div><div><br></div><div>; interpolate value along the section of A and B</div><div> R_plane = wrf_user_intrp2d(Re,plane,0.,opts)</div><div> Re_dims = dimsizes(R_plane)</div><div> ntim     = Re_dims(0)</div><div> ncross     = Re_dims(1)</div><div> ndays       = ntim/24</div><div> Re3d       = reshape(R_plane,(/24,ndays, ncross/)) ;  hours, days, crosssection</div><div> copy_VarAtts(R_plane,Re3d)</div><div> Re3d_hr_avg = dim_avg_n_Wrap(Re3d,1) ; hourly average (monthly, 0 hours average, 1 hour average, etc)</div><div>  res                      = True               ; plot mods desired</div><div>  res@cnFillOn             = True               ; turn on color fill</div><div>  res@cnFillPalette        = "BlWhRe"           ; set color map</div><div>  res@tiMainString         = "Hourly Precipitation"   ; title</div><div>  res@cnLevelSelectionMode = "ManualLevels"     ; manual contour levels</div><div>  res@cnMinLevelValF       = 0.<span class="Apple-tab-span" style="white-space:pre">        </span>        ; min level</div><div>  res@cnMaxLevelValF       =  2               ; max level</div><div>  res@cnLevelSpacingF      = 0.1               ; contour level spacing</div><div>  plot = gsn_csm_hov(wks, Re3d_hr_avg(:,:), res) </div><div>end</div><div><br></div><div><i style="font-size: 12pt;">Regards</i></div><i>Ram</i><style><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}
.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}
--></style>                                               </div></body>
</html>