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