<div dir="ltr">I am writing a script to overlay U wind and precipitation from the wrf run. My script is as below. <div><br></div><div>;----------------------------------------------------------------------<br>; wrf_interp_3.ncl<br>;----------------------------------------------------------------------<br>; Concepts illustrated:<br>; - Interpolating a vertical cross-section from a 3D WRF-ARW field.<br>;----------------------------------------------------------------------<br>; wrf_user_vert_cross and wrf_user_interp_level replace the <br>; deprecated wrf_user_intrp3d function. <br>;<br>; NCL V6.6.0 or higher is required to run this example.<br>;----------------------------------------------------------------------<br><br>begin<br> dir = "/media/prasad/C_Drive/2016/res/regrid_exp/"<br> a = addfile(dir+"<a href="http://wrfout_d03_2016-06-30_17_00_00.nc">wrfout_d03_2016-06-30_17_00_00.nc</a>","r")<br><br> z = wrf_user_getvar(a, "z",0) ; grid point height<br> qv = wrf_user_getvar(a, "QVAPOR",0) ; cloud field<br> lats = wrf_user_getvar(a, "lat",0)<br> lons = wrf_user_getvar(a, "lon",0)<br> pr = wrf_user_getvar(a, "pressure",0)<br> ua = wrf_user_getvar(a, "ua",0)<br> va = wrf_user_getvar(a, "va",0)<br> wa = wrf_user_getvar(a, "wa",0)<br><br> rain_exp = wrf_user_getvar(a,"RAINNC",0) / 25.4<br> rain_con = wrf_user_getvar(a,"RAINC", 0) / 25.4<br> rain_tot = (rain_exp + rain_con)<br> copy_VarMeta(rain_exp,rain_tot)<br><br> printVarSummary(rain_tot) <br> printVarSummary(rain_exp) <br> printMinMax(rain_tot,0) <br> <br> xlon = wrf_user_getvar(a, "XLONG",0)<br><br> start_lat = 29.75<br> end_lat = 29.75<br> start_lon = 77<br> end_lon = 83<br> opt = True<br> opt@latlon = True<br> opt@linecoords = True<br> opt@file_handle = a<br> qv_latlon = wrf_user_vert_cross(ua,pr,(/start_lon,start_lat,end_lon,end_lat/),opt)<br> <br> printVarSummary(ua) ; [bottom_top | 31] x [south_north | 546] x [west_east | 480]<br> printVarSummary(qv_latlon) ; [vertical | 100] x [cross_line_idx | 171]<br> printMinMax(ua,0) ; [bottom_top | 31] x [south_north | 546] x [west_east | 480]<br> printMinMax(qv_latlon,0) ; [vertical | 100] x [cross_line_idx | 171]<br><br><br>;---Interpolate the 2D Rain field to the lat/lon line<br> t2_line = wrf_user_interp_line(rain_tot,(/start_lon,start_lat,end_lon,end_lat/),opt)<br> printVarSummary(t2_line) <br> long_line = wrf_user_interp_line(xlon,(/start_lon,start_lat,end_lon,end_lat/),opt)<br><br> printMinMax(qv_latlon,0)<br> printMinMax(t2_line,0)<br> printMinMax(long_line,0)<br><br> wks = gsn_open_wks("png","wrf_interp_u_wind")<br><br> res = True<br> res@gsnMaximize = True ; maximize plot in frame<br> res@cnFillOn = True ; turn on contour fill<br> res@cnFillOpacityF = 0.4<br> res@cnLinesOn = False ; turn off contour lines<br> res@cnLineLabelsOn = False ; turn off line labels<br> res@lbOrientation = "Vertical"<br> res@lbLabelFontHeightF = 0.01<br> res@tiMainString = "Cross section from ("+start_lat+","+start_lon+ \<br> ") to ("+end_lat + ","+end_lon+")"<br> res@gsnStringFontHeightF = 0.015<br> res@tmXBLabelFontHeightF = 0.01<br> res@tmXBLabelAngleF = 45.<br> res@trYReverse = True<br> ;res@gsnDraw = False ; do not draw the plot<br> ;res@gsnFrame = False ; do not advance the frame<br><br>;--Explicitly set lat/lon labels for X axis<br> xvalues = ispan(0,dimsizes(qv_latlon(0,:))-1,1)<br> ll_step = 15 ; step interval for tickmarks<br> res@tmXBMode = "Explicit"<br> res@tmXBValues = xvalues(::ll_step)<br> res@tmXBLabels = sprintf("%6.2f",qv_latlon@lats(::ll_step)) + "~S~o~N~N~C~" + \<br> sprintf("%6.2f",qv_latlon@lons(::ll_step)) + "~S~o~N~E"<br><br> plot = gsn_csm_contour(wks,qv_latlon,res)<br><br> res_z = res<br> res_z@cnFillOn = False ; turn on contour fill<br> res_z@cnLinesOn = True ; turn off contour lines<br> res_z@cnLineLabelsOn = False ; turn off line labels<br> res_z@trYReverse = False<br> ;res_z@xyLineColors = "blue" <br> res_z@xyLineThicknesses = (/3.0/) ; make line thicker<br> res_z@xyLineColors = (/"green"/) ; change line color<br><br>;--Explicitly set lat/lon labels for X axis<br> xvalues = ispan(0,dimsizes(long_line(:))-1,1)<br> ll_step = 15 ; step interval for tickmarks<br> res_z@tmXBMode = "Explicit"<br> res_z@tmXBValues = xvalues(::ll_step)<br> res_z@tmXBLabels = sprintf("%6.2f",qv_latlon@lats(::ll_step)) + "~S~o~N~N~C~" + \<br> sprintf("%6.2f",qv_latlon@lons(::ll_step)) + "~S~o~N~E"<br><br> plot_ov = gsn_csm_xy(wks,long_line,t2_line,res_z)<br><br><br> overlay(plot,plot_ov) ; overlay the U-wind plot on the temperature plot<br> draw(plot) ; draw the temperature plot (with the rh plot overlaid)<br> frame(wks) ; advance the frame<br><br>end<br></div><div><br></div><div><br></div><div>I am getting both precipitation and U wind plot but both on separate pages. I want to overlay them. The help is really appreciated</div><div><br></div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><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></div></div>