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/wrf/WRFUserARW.ncl" load "./WRFUserARW.ncl" begin wks = gsn_open_wks("x11", "katrina_moving_nest") ; Open PostScript file. DATADir = "/kiaat2/bruyerec/OnLineTutorial/NCL/" FILES = systemfunc (" ls -1 " + DATADir + "wrfout_d02_2005-08-30_??:00:00") numFILES = dimsizes(FILES) f = addfiles(FILES+".nc","r") var_in = wrf_user_getvar(f,"slp",-1) lat = wrf_user_getvar(f,"XLAT",-1) lon = wrf_user_getvar(f,"XLONG",-1) times = wrf_user_getvar(f,"times",-1) ; set some data information for countour intervals mn = min(var_in) mx = max(var_in) nlev = tointeger((mx-mn)/2)+1 levels = nice_mnmxintvl(mn,mx,nlev,True) ilevs = tointeger(levels) res = True ; Set some contouring resources. res@cnFillOn = True res@cnLinesOn = False res@gsnSpreadColors = True res@cnLevelSelectionMode = "ManualLevels" res@cnMinLevelValF = levels(0) res@cnMaxLevelValF = levels(1) res@cnLevelSpacingF = ilevs(2) ; Add map resources res@mpFillOn = False res@mpDataBaseVersion = "MediumRes" ; Default is LowRes res@mpOutlineDrawOrder = "PostDraw" ; Draw map outlines last res@mpGridAndLimbOn = False ; Turn off lat/lon lines res@pmTickMarkDisplayMode = "Always" ; Turn on map tickmarks res = set_mp_wrf_map_resources(f[0],res) res@mpLimitMode = "Corners" ; Portion of map to zoom res@mpLeftCornerLatF = min (lat) - 2.0 res@mpLeftCornerLonF = min (lon) - 5.0 res@mpRightCornerLatF = max (lat) + 2.0 res@mpRightCornerLonF = max (lon) + 5.0 ; Add label bar resources res@lbLabelAutoStride = True res@lbBoxMinorExtentF = 0.13 res@lbLabelFontHeightF = 0.012 res@gsnLeftStringFontHeightF = 0.01 res@gsnRightStringFontHeightF = 0.008 res@gsnMaximize = True ; Maximize plot in frame do ip = 0,numFILES-1 var = var_in(ip,:,:) var@lat2d = lat(ip,:,:) var@lon2d = lon(ip,:,:) res@gsnRightString = times(ip) map = gsn_csm_contour_map(wks, var, res) end do end