;************************************************ 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" ;************************************************ ;---------------------------------------------------------------------- ; This procedure copies the three dimension names from Xfrom, to the ; first, third, and fourth dimensions of Xto. ; ; This procedure is untested! ;---------------------------------------------------------------------- procedure copy_coords(Xfrom,Xto) begin Xto!0 = Xfrom!0 ; Xto!1 = ??? Xto!2 = Xfrom!1 Xto!3 = Xfrom!2 end begin a = addfile("wrf_data.nc","r") X=a->T2 Xdims = dimsizes(X) ntim = Xdims(0) nlat = Xdims(1) nlon = Xdims(2) ntim8 = ntim/8 ;; assuming ntim is a multiple of 8! X_r = reshape(X,(/ntim8,8,nlat,nlon/)) copy_VarAtts(X,X_r) copy_coords(X,X_r) ; copy the dimension names from X to_Xr printVarSummary(X) ter = dim_avg_n_Wrap( X_r, 1 ) ter = ter - 273 ter@units = "degC" wks = gsn_open_wks("png","time_avg_plot") ; Create a plot workstation res = True ; Use basic options for this field res@cnFillOn = True ; Create a color fill plot contour = wrf_contour(a,wks,ter,res) pltres = True ; Set plot options mpres = True ; Set map options plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres) ; Plot the data over a map background end