load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" begin ; ; If this is set to True, then the script will work. ; Otherwise, whatever is the last color table you set, ; will be applied to all plots. ; DO_PANEL_MYSELF = False ;---Generate some dummy data. nplots = 4 nx = 129 ny = 129 data = new((/nplots,nx,ny/),float) data(0,:,:) = generate_2d_array(10, 10, -19, 19, 0, (/nx,ny/)) data(1,:,:) = generate_2d_array(10, 10, -27, 30, 1, (/nx,ny/)) data(2,:,:) = generate_2d_array(10, 10, -5, 5, 2, (/nx,ny/)) data(3,:,:) = generate_2d_array(10, 10, 0, 1000, 3, (/nx,ny/)) wks = gsn_open_wks("x11","panel") ;---Create array to hold plots. ;---Set up resources. res = True if(DO_PANEL_MYSELF) then xpos = (/0.10,0.55,0.10,0.55/) ypos = (/0.95,0.95,0.45,0.45/) res@vpWidthF = 0.34 res@vpHeightF = 0.34 else res@gsnDraw = False end if res@gsnFrame = False res@gsnSpreadColors = True res@cnFillOn = True res@cnLinesOn = False colormaps = (/"GreenYellow","WhiteYellowOrangeRed","BlWhRe",\ "BlueWhiteOrangeRed"/) ;---Create each plot, using a different color map for each one. plots = new(nplots,graphic) do n=0,nplots-1 gsn_define_colormap(wks,colormaps(n)) if(DO_PANEL_MYSELF) then res@vpXF = xpos(n) res@vpYF = ypos(n) end if plots(n) = gsn_csm_contour(wks,data(n,:,:),res) end do if(.not.DO_PANEL_MYSELF) then pres = True pres@gsnMaximize = True gsn_panel(wks,plots,(/2,2/),pres) else frame(wks) end if end