biomass/26.contour.ncl
changeset 0 0c6405ab2ff4
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/biomass/26.contour.ncl	Mon Jan 26 22:08:20 2009 -0500
     1.3 @@ -0,0 +1,75 @@
     1.4 +;*************************************************
     1.5 +; ce_1.ncl
     1.6 +;************************************************
     1.7 +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"  
     1.8 +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"  
     1.9 +;************************************************
    1.10 +begin
    1.11 +;************************************************
    1.12 +; read data
    1.13 +;************************************************
    1.14 +  grid = "1x1"
    1.15 +; grid = "T31"
    1.16 +; grid = "T42"
    1.17 +; grid = "1.9"
    1.18 +
    1.19 +  diri  = "/fis/cgd/cseg/people/jeff/clamp_data/observed/biomass/"
    1.20 +  fili  = "amazon_mask_"+ grid + ".nc"
    1.21 +  f     = addfile (diri+fili,"r")
    1.22 +
    1.23 +  y = f->mask_amazon
    1.24 +
    1.25 +  printVarSummary(y)
    1.26 +
    1.27 +  wks = gsn_open_wks ("ps","test")   ; open workstation
    1.28 +  gsn_define_colormap(wks,"gui_default")     ; choose colormap
    1.29 +
    1.30 +;-----------------------------------------
    1.31 +; plot area sum
    1.32 +
    1.33 +  gRes  = True
    1.34 +  gRes@txFontHeightF = 0.02
    1.35 +; gRes@txAngleF = 90
    1.36 +
    1.37 +  Sum_area = 7.41
    1.38 +
    1.39 +  area_sum_text = "(mask area = "+sprintf("%.2f", Sum_area)+"(x1.e12 m2))"
    1.40 +
    1.41 +  gsn_text_ndc(wks,area_sum_text,0.50,0.80,gRes)
    1.42 +;-----------------------------------------
    1.43 +
    1.44 +;************************************************
    1.45 +; create default plot
    1.46 +;************************************************
    1.47 +
    1.48 +  res                     = True             ; Use plot options
    1.49 +  res@cnFillOn            = True             ; Turn on color fill
    1.50 +  res@gsnSpreadColors      = True            ; use full colormap
    1.51 +; res@cnFillMode          = "RasterFill"     ; Turn on raster color
    1.52 +; res@lbLabelAutoStride   = True
    1.53 +  res@cnLinesOn           = False            ; Turn off contourn lines
    1.54 +  res@mpFillOn            = False            ; Turn off map fill
    1.55 +  res@gsnAddCyclic        = False
    1.56 +  res@tiMainString        = "Amazon Mask: grid = "+ grid
    1.57 +
    1.58 +  res@mpMinLatF            = -21.1      ; range to zoom in on
    1.59 +  res@mpMaxLatF            =  13.8
    1.60 +  res@mpMinLonF            =  277.28
    1.61 +  res@mpMaxLonF            =  326.43
    1.62 +
    1.63 +  res@gsnSpreadColors     = True             ; use full colormap
    1.64 +  res@cnLevelSelectionMode = "ManualLevels"  ; Manual contour invtervals
    1.65 +; res@cnMinLevelValF       = 1.              ; Min level
    1.66 +; res@cnMaxLevelValF       = 11.             ; Max level
    1.67 +; res@cnLevelSpacingF      = 1.              ; interval
    1.68 +  res@cnMinLevelValF       = 0.              ; Min level
    1.69 +  res@cnMaxLevelValF       = 1.              ; Max level
    1.70 +  res@cnLevelSpacingF      = 0.1             ; interval
    1.71 +
    1.72 +; pres                     = True            ; panel plot mods desired
    1.73 +; pres@gsnMaximize         = True            ; fill the page
    1.74 +
    1.75 +  plot = gsn_csm_contour_map_ce(wks,y,res)   ; for observed
    1.76 +; gsn_panel(wks,plot,(/1,1/),pres)           ; create panel plot
    1.77 +; system("convert xy.ps xy.png")
    1.78 +end
    1.79 \ No newline at end of file