npp/31.contour_ob.ncl
author Forrest Hoffman <forrest@climatemodeling.org>
Mon, 26 Jan 2009 22:08:20 -0500
changeset 0 0c6405ab2ff4
permissions -rw-r--r--
Initial commit of C-LAMP Diagnostics from Jeff Lee
     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 ;************************************************
     7 begin
     8 ;************************************************
     9 ; read in observed data
    10 ;************************************************
    11 ;f     = addfile ("Npp_0.05deg_mean.nc","r")
    12 ;y     = f->NPP(::10,::10)                 ; for observed 0.05deg
    13  f     = addfile ("Npp_T42_mean.nc","r")
    14  y     = f->NPP
    15 ;************************************************
    16 ; read in model data
    17 ;************************************************
    18  g     = addfile ("i01.03cn_1545-1569_ANN_climo.nc","r")
    19 ;g     = addfile ("i01.04casa_1605-1629_ANN_climo.nc","r")
    20  x     = g->NPP
    21 
    22  delta = 0.00000000001
    23  x0    = x(0,:,:)
    24  y = where(ismissing(y).and.(ismissing(x0).or.(x0.lt.delta)),0.,y)
    25 
    26  y@units = "gC/m^2/year" 
    27 ;************************************************
    28 ; create default plot
    29 ;************************************************
    30   
    31 ; setvalues NhlGetWorkspaceObjectId()
    32 ;   "wsMaximumSize" : 199999999
    33 ; end setvalues
    34 
    35   wks = gsn_open_wks("png","xy")         ; open a ps file
    36 ; gsn_define_colormap(wks,"wgne15")          ; choose colormap
    37   gsn_define_colormap(wks,"gui_default")     ; choose colormap
    38 
    39   res                     = True             ; Use plot options
    40   res@cnFillOn            = True             ; Turn on color fill
    41   res@gsnSpreadColors      = True            ; use full colormap
    42 ; res@cnFillMode          = "RasterFill"     ; Turn on raster color
    43 ; res@lbLabelAutoStride   = True
    44   res@cnLinesOn           = False            ; Turn off contourn lines
    45   res@mpFillOn            = False            ; Turn off map fill
    46   res@tiMainString        = "Observed MODIS MOD 17"
    47 ; res@tiMainString        = "Model i01.03cn"
    48 ; res@tiMainString        = "Model i01.04casa"
    49 
    50   res@gsnSpreadColors     = True             ; use full colormap
    51   res@cnLevelSelectionMode = "ManualLevels"    ; Manual contour invtervals
    52   res@cnMinLevelValF       = 0.                ; Min level
    53   res@cnMaxLevelValF       = 2200.             ; Max level
    54   res@cnLevelSpacingF      = 200.              ; interval
    55 
    56   plot = gsn_csm_contour_map_ce(wks,y,res)         ; for observed
    57 
    58 end