load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "./add_map_tickmarks.ncl" load "./WRFUserARW.ncl" begin ;---Open the WRF-ARW input file. Be sure to append the ".nc". dir = "$NCARGTEST/nclscripts/cdf_files/" filename = "wrfout_d01_2005-12-14_13:00:00.GWATC_FCST.nc" a = addfile(dir + filename,"r") ;---Start the graphics. type = "ps" wks = gsn_open_wks(type,"wrf_zoom_new") ; Set some basic WRF plot options res = True res@MainTitle = "REAL-TIME WRF" pltres = True mpres = True mpres = True times = wrf_user_list_times(a) ; get times in the file ntimes = dimsizes(times) ; number of times in the file it = 0 print("Working on time: " + times(it) ) res@TimeLabel = times(it) ; Set Valid time to use on plots tc = wrf_user_getvar(a,"tc",it) ; T in C ter = wrf_user_getvar(a,"HGT",it) ; terrain height dims = dimsizes(ter) ;---As an example, we are looking for the lower right 1/4 of the domain x_start = dims(1)/2 x_end = dims(1)-1 y_start = 0 y_end = dims(0)/2 mpres@ZoomIn = True mpres@Xstart = x_start mpres@Ystart = y_start mpres@Xend = x_end mpres@Yend = y_end tc_zoom = tc(:,y_start:y_end,x_start:x_end) tc_zoom@description = tc@description + " - Lower right of domain" ter_zoom = ter(y_start:y_end,x_start:x_end) ter_zoom@description = ter@description + " - Lower right of domain" opts = res opts@cnFillOn = True ;---Plot zoomed terrain contour_zoom = wrf_contour(a,wks,ter_zoom,opts) ;---Force decimal labels on lat/lon axis. mpres@tmYLValues = ispan(26,42,2) + 0.5 mpres@tmXBValues = ispan(-84,70,2) + 0.5 mpres@tmYLLabelFontHeightF = 0.013 mpres@tmXBLabelFontHeightF = 0.013 plot_zoom = wrf_map_overlays(a,wks,(/contour_zoom/),pltres,mpres) delete(opts) ;---Plot zoomed tc opts = res opts@cnFillOn = True contour = wrf_contour(a,wks,tc_zoom(0,:,:),opts) plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres) end