load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" begin diri = "$NCARG_ROOT/lib/ncarg/data/cdf/" fili = "Tstorm.cdf" tf = addfile(diri+fili,"r") ; Open netCDF file. t = (tf->t(0,:,:) - 273.15)*9./5. +32. ; Read in temp, ; convert to C. ; ; Variable "t" does not have any coordinate information ; attached to it, so we need to do that here. ; lat = tf->lat ; Read lat/lon off file. lon = tf->lon lat@units = "degrees_north" ; Attach units attributes lon@units = "degrees_east" t!0 = "lat" ; Name rightmost (y) dimension t!1 = "lon" ; Name leftmost (x) dimension t&lat = lat ; Assign coordinate arrays t&lon = lon printVarSummary(t) wks = gsn_open_wks("x11","contourmap2_ex06") ; Open X11 window res = True ; Plot options desired. res@gsnMaximize = True ; Maximize plot in frame. res@gsnAddCyclic = False ; This is not global data. res@gsnLeftString = "Temperature" ; left subtitle res@gsnCenterString = "January 1996 Snow Storm" ; center subtitle res@gsnRightString = "Celsius" ; right subtitle res@mpProjection = "LambertEqualArea" ; Default="CylindricalEquidistant" res@mpLimitMode = "LatLon" ; How to zoom in on map res@mpCenterLonF = -100. ; Change center lat/lon res@mpCenterLatF = 40. res@mpMinLatF = min(lat) ; Area to zoom in on. res@mpMaxLatF = max(lat) res@mpMinLonF = min(lon) res@mpMaxLonF = max(lon) res@mpGridAndLimbOn = True ; Turn on lat/lon grid res@mpGridLineColor = "NavyBlue" ; Grid color res@mpGridLineThicknessF = 0.5 ; Grid thickness res@mpGridLineDashPattern = 2 ; Change dash pattern res@mpGridAndLimbDrawOrder = "PreDraw" res@mpGridSpacingF = 10. res@cnFillOn = True ; Turn on contour fill. res@cnLinesOn = False ; Turn off contour lines. res@cnFillPalette = "temp1" ; Set color map to use. res@pmLabelBarOrthogonalPosF = -0.05 ; Move labelbar closer to plot res@cnLevelSelectionMode = "ManualLevels" ; Default is "AutomaticLevels" res@cnLevelSpacingF = 2.25 ; Contour level spacing plot = gsn_csm_contour_map(wks,t,res) end