npp/31.contour_model.ncl
changeset 0 0c6405ab2ff4
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/npp/31.contour_model.ncl	Mon Jan 26 22:08:20 2009 -0500
     1.3 @@ -0,0 +1,65 @@
     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 in netCDF file
    1.13 +;************************************************
    1.14 +; fili = "Npp_0.05deg_mean.nc"
    1.15 +  fili = "Npp_T42_mean.nc"
    1.16 +; fili = "i01.03cn_1545-1569_ANN_climo.nc"
    1.17 +; fili = "i01.04casa_1605-1629_ANN_climo.nc"
    1.18 +
    1.19 +  a = addfile(fili,"r")
    1.20 +
    1.21 +;************************************************
    1.22 +; read in data
    1.23 +;************************************************
    1.24 +; x = a->NPP(::10,::10)       ; for observed 0.05deg
    1.25 +  x = a->NPP
    1.26 +
    1.27 +  nsec_per_year = 60*60*24*365
    1.28 +
    1.29 +;scale_factor = nsec_per_year ; for model 
    1.30 + scale_factor = 1.            ; for observed T42
    1.31 +;scale_factor = 0.1           ; for observed 0.05deg
    1.32 +
    1.33 +  x = x * scale_factor
    1.34 +
    1.35 +  x@units = "gC/m^2/year" 
    1.36 +;************************************************
    1.37 +; create default plot
    1.38 +;************************************************
    1.39 +  
    1.40 +; setvalues NhlGetWorkspaceObjectId()
    1.41 +;   "wsMaximumSize" : 199999999
    1.42 +; end setvalues
    1.43 +
    1.44 +  wks = gsn_open_wks("png","xy")         ; open a ps file
    1.45 +; gsn_define_colormap(wks,"wgne15")          ; choose colormap
    1.46 +  gsn_define_colormap(wks,"gui_default")     ; choose colormap
    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@tiMainString        = "Observed MODIS MOD 17"
    1.56 +; res@tiMainString        = "Model i01.03cn"
    1.57 +; res@tiMainString        = "Model i01.04casa"
    1.58 +
    1.59 +  res@gsnSpreadColors     = True             ; use full colormap
    1.60 +  res@cnLevelSelectionMode = "ManualLevels"    ; Manual contour invtervals
    1.61 +  res@cnMinLevelValF       = 0.                ; Min level
    1.62 +  res@cnMaxLevelValF       = 2200.             ; Max level
    1.63 +  res@cnLevelSpacingF      = 200.              ; interval
    1.64 +
    1.65 +  plot = gsn_csm_contour_map_ce(wks,x,res)         ; for observed
    1.66 +; plot = gsn_csm_contour_map_ce(wks,x(0,:,:),res)  ; for model
    1.67 +
    1.68 +end
    1.69 \ No newline at end of file