lai/32.contour_land_class.ncl
author Forrest Hoffman <forrest@climatemodeling.org>
Thu, 26 Mar 2009 14:02:21 -0400
changeset 1 4be95183fbcd
permissions -rw-r--r--
Modifications to scoring and graphics production for the final version of code for the C-LAMP paper in GCB.
     1 ;*************************************************
     2 ; ce_1.ncl
     3 ;************************************************
     4 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"  
     5 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
     6 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"   
     7 ;************************************************
     8 begin
     9 ;************************************************
    10 ; read in observed data
    11 ;************************************************
    12   diri  = "/fis/cgd/cseg/people/jeff/clamp_data/lai/"
    13 ; fili  = "land_class_0.25deg.nc"
    14   fili  = "land_class_T42_new.nc" 
    15   f     = addfile(diri+fili,"r")
    16   print (f)
    17 
    18 ; y     = f->LAND_CLASS(::10,::10)   ; for 0.25deg
    19 ; y    =  (/ y(::-1,:) /)            ; for 0.25deg
    20 
    21   y     = f->LAND_CLASS
    22   printVarSummary(y)
    23 
    24   y = where(y.eq.0,y@_FillValue,y)
    25 
    26   printVarSummary(y)
    27   print (min(y)+"/"+max(y))
    28 ;************************************************
    29 ; create default plot
    30 ;************************************************
    31   wks = gsn_open_wks("ps","xy")              ; open a ps file
    32   gsn_define_colormap(wks,"gui_default")     ; choose colormap
    33 
    34   res                     = True             ; Use plot options
    35   res@cnFillOn            = True             ; Turn on color fill
    36   res@gsnSpreadColors     = True             ; use full colormap
    37 ; res@cnFillMode          = "RasterFill"     ; Turn on raster color
    38 ; res@lbLabelAutoStride   = True
    39   res@cnLinesOn           = False            ; Turn off contourn lines
    40   res@mpFillOn            = False            ; Turn off map fill
    41   res@tiMainString        = "MODIS LAND CLASS T42"
    42 
    43   res@gsnSpreadColors      = True            ; use full colormap
    44   res@cnLevelSelectionMode = "ManualLevels"  ; Manual contour invtervals
    45   res@cnMinLevelValF       = 1.              ; Min level
    46   res@cnMaxLevelValF       = 19.             ; Max level
    47   res@cnLevelSpacingF      = 1.              ; interval
    48   pres                     = True            ; panel plot mods desired
    49   pres@gsnMaximize         = True            ; fill the page
    50 
    51   plot = gsn_csm_contour_map_ce(wks,y,res)   ; for observed
    52   gsn_panel(wks,plot,(/1,1/),pres)           ; create panel plot
    53   system("convert xy.ps xy.png")
    54 end