;********************************************* ; latlon2pop_1.ncl ; ; Concepts illustrated: ; - Converting a lat/lon grid to a POP grid ; - Drawing a perimeter around areas on a contour plot with missing data ; - Drawing color filled contours using a selected color map ; ;********************************************* ; ; These files are loaded by default in NCL V6.2.0 and newer ; 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" ; ; This file still has to be loaded manually load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/popRemap.ncl" ;********************************************* begin in = addfile ("pcmdi_sst_ccm_bc1x1_1976-1996.nc", "r") ice = in->ice_cov ;************************************************* ; remap file to pop grid ;************************************************* remap=PopLatLon(ice,"1x1d","gx1v3","bilin","da","010808") ;************************************************* ; create plot ;************************************************* wks = gsn_open_wks("png","lat2pop") ; send graphics to PNG file res = True ; plot mods desired res@cnFillOn = True ; turn on color fill res@cnFillPalette = "BlAqGrYeOrRe" ; set color map res@cnLineLabelsOn = False ; turn off line labels res@cnLinesOn = False ; turn of contour lines res@cnMissingValPerimOn = True ; outline missing values res@cnInfoLabelOn = False ; turn off info label res@gsnLeftString = "" ; eliminate left plot string res@gsnRightString = "" ; eliminate right plot string res@tiMainString = str_sub_str(ice@long_name,"Psuedo","Pseudo") + " (" + ice@units + ")" ; set title res@lbOrientation = "Vertical" plot = gsn_csm_contour(wks,remap(0,:,:),res) ; contour the variable end