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/wrf/WRFUserARW.ncl" begin ; ; ; USE_WRF_MAP_PROJECTION = True ;---Open file. You may need to include ".nc" at the end. filename = "/work/anderson/acarne2/Seaice/run_2007/wrfout_d01_2007-10-01_00:00:00" a = addfile(filename,"r") ;---Read variables directly or use wrf_user_getvar nt = 0 land = a->LANDMASK(nt,:,:) ; nt=0 is the first time step ;---Open workstation wks = gsn_open_wks("x11","wrf_contour_map") ; "ps", "pdf", "png" ;---Set some resources res = True res@gsnMaximize = True ; maximize plot in frame res@cnFillOn = True ; turn on contour fill res@cnLinesOn = False ; turn off contour lines res@cnLineLabelsOn = False ; turn off line labels res@gsnAddCyclic = False ; set to False if plotting regional data res@tiMainString = filename res@cnFillPalette = "BlRe" ;---THESE VALUES WILL LIKELY NEED TO BE CHANGED OR COMMENTED res@cnLevelSelectionMode = "ManualLevels" res@cnMinLevelValF = 0 res@cnMaxLevelValF = 1 res@cnLevelSpacingF = .5 if(USE_WRF_MAP_PROJECTION) then ; ; This function looks at the global attributes on the WRF output ; file and sets some map resources based on their values. ; res = wrf_map_resources(a,res) res@tfDoNDCOverlay = True ; No lat/lon coordinates required else land@lat2d = a->XLAT(nt,:,:) ; Lat/lon coordinates required land@lon2d = a->XLONG(nt,:,:) res@mpProjection = "STEREOGRAPHIC" ; default for gsn_csm_contour_map res@mpMinLatF = min(land@lat2d) res@mpMaxLatF = max(land@lat2d) res@mpMinLonF = min(land@lon2d) res@mpMaxLonF = max(land@lon2d) res@mpCenterLonF = (res@mpMinLonF + res@mpMaxLonF) / 2. res@mpDataBaseVersion = "MediumRes" ; better map outlines end if plot = gsn_csm_contour_map(wks,land,res) end