load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" function conv_date(date:integer) begin months = (/"","January","February","March","April","May","June","July", \ "August","September","October","November","December"/) year = str_get_cols(""+date,0,3) imnth = toint(str_get_cols(""+date,4,5)) month = months(imnth) return(month + " " + year) end begin a = addfile("sst8292a.nc","r") ;************************************************ ; Read in Sea Surface Temperature Anomalies ; Determine the subscripts corresponding to Dec 82 ;************************************************ sst = a->SSTA date_sst = a->date ;************************************************ ; create plots ;************************************************ type = "png" type@wkWidth = 1026 type@wkHeight = 1026 wks = gsn_open_wks(type,"panel") ; send graphics to PNG file res = True res@gsnMaximize = True res@gsnDraw = False ; don't draw res@gsnFrame = False ; don't advance frame res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels res@cnMinLevelValF = -5. ; set min contour level res@cnMaxLevelValF = 5. ; set max contour level res@cnLevelSpacingF = 0.5 ; set contour spacing res@cnFillOn = True res@cnLinesOn = False res@cnLineLabelsOn = False res@cnFillDrawOrder = "Predraw" ; fill and lines before map res@cnFillPalette = "BlueRed" ; Blue-Red colormap res@lbLabelBarOn = False res@mpCenterLonF = 180. ; center plot at 180 res@mpMinLonF = 120. ; select a subregion res@mpMaxLonF = 240. res@mpMinLatF = -60. res@mpMaxLatF = 60. res@gsnLeftString = "" res@gsnRightString = "" res@tmYROn = False ; Turn off right and top tick marks res@tmXTOn = False ; Turn off right and top tick marks dates = (/198212,199008/) plots = new(dimsizes(dates),graphic) do n=0,1 res@tiMainString = "" + conv_date(dates(n)) ind_sst := ind(date_sst.eq.dates(n)) plots(n) = gsn_csm_contour_map(wks,sst(ind_sst,:,:),res) end do pnlres = True pnlres@txString = sst@long_name + " (" + sst@units + ")" pnlres@gsnPanelLabelBar = True pnlres@pmLabelBarWidthF = 0.8 pnlres@lbLabelFontHeightF = 0.015 gsn_panel(wks,plots,(/1,2/),pnlres) delete(wks) system("convert -trim -geometry 1026x576 panel.png panel_trim.png") end