;************************************************ load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" ;************************************************ diri = "/home/swati/work/analysis/2_cities/Patna/14aug2014/wrf_out_data/4th_domain/" ; input directory fils = systemfunc ("ls "+diri+"wrfout_d04_2014-08-13*") ; file paths a = addfiles (fils, "r") ; note the "s" of addfile wks = gsn_open_wks("png","temp") gsn_define_colormap(wks,"rainbow") ; overwrite the .hluresfile color map ; Set some basic resources res = True res@NoHeaderFooter = True ; Switch headers and footers off pltres = True pltres@PanelPlot = True ; Indicate these plots are to be paneled. mpres = True ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; times = wrf_user_getvar(a,"times",-1) ; get all times in the file plots = new ( 6, graphic ) do itime = 0,5 t = wrf_user_getvar(a(itime),"T2",-1) ; T2 in Kelvin ; printVarSummary(t) ;exit slp = wrf_user_getvar(a(itime),"slp",-1) ; slp ; Generate contours. t_res = res t_res@cnFillOn = True t_res@ContourParameters = (/ 240., 300., 5. /) t_res@lbLabelBarOn = False ; Turn off individual label bars so we can contour = wrf_contour(a(itime),wks,t,t_res) slp_res = res slp_res@ContourParameters = (/ 990., 1026., 2. /) slp_res@cnInfoLabelFontHeightF = 0.027 con_slp = wrf_contour(a(itime),wks,slp,slp_res) ; Overlay contours on a map ;pltres@NoTitles = True pltres@CommonTitle = True pltres@PlotTitle = times(itime) plots(itime) = wrf_map_overlays(a(itime),wks,(/contour,con_slp/),pltres,mpres) delete(contour) end do ; Panel the WRF plots. pnlres = True pnlres@txString = t@description + " (" + t@units + ")" pnlres@gsnPanelYWhiteSpacePercent = 13 ; Add white space b/w plots. pnlres@gsnPanelLabelBar = True ; Turn on common labelbar pnlres@lbLabelAutoStride = True ; Spacing of lbar labels. pnlres@lbBoxMinorExtentF = 0.13 gsn_panel(wks,(/plots/),(/3,3/),pnlres)