forrest@0: ;************************************************* forrest@0: ; ce_1.ncl forrest@0: ;************************************************ forrest@0: load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" forrest@0: load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" forrest@0: ;************************************************ forrest@0: begin forrest@0: ;************************************************ forrest@0: ; read in netCDF file forrest@0: ;************************************************ forrest@0: ; fili = "Npp_0.05deg_mean.nc" forrest@0: fili = "Npp_T42_mean.nc" forrest@0: ; fili = "i01.03cn_1545-1569_ANN_climo.nc" forrest@0: ; fili = "i01.04casa_1605-1629_ANN_climo.nc" forrest@0: forrest@0: a = addfile(fili,"r") forrest@0: forrest@0: ;************************************************ forrest@0: ; read in data forrest@0: ;************************************************ forrest@0: ; x = a->NPP(::10,::10) ; for observed 0.05deg forrest@0: x = a->NPP forrest@0: forrest@0: nsec_per_year = 60*60*24*365 forrest@0: forrest@0: ;scale_factor = nsec_per_year ; for model forrest@0: scale_factor = 1. ; for observed T42 forrest@0: ;scale_factor = 0.1 ; for observed 0.05deg forrest@0: forrest@0: x = x * scale_factor forrest@0: forrest@0: x@units = "gC/m^2/year" forrest@0: ;************************************************ forrest@0: ; create default plot forrest@0: ;************************************************ forrest@0: forrest@0: ; setvalues NhlGetWorkspaceObjectId() forrest@0: ; "wsMaximumSize" : 199999999 forrest@0: ; end setvalues forrest@0: forrest@0: wks = gsn_open_wks("png","xy") ; open a ps file forrest@0: ; gsn_define_colormap(wks,"wgne15") ; choose colormap forrest@0: gsn_define_colormap(wks,"gui_default") ; choose colormap forrest@0: forrest@0: res = True ; Use plot options forrest@0: res@cnFillOn = True ; Turn on color fill forrest@0: res@gsnSpreadColors = True ; use full colormap forrest@0: ; res@cnFillMode = "RasterFill" ; Turn on raster color forrest@0: ; res@lbLabelAutoStride = True forrest@0: res@cnLinesOn = False ; Turn off contourn lines forrest@0: res@mpFillOn = False ; Turn off map fill forrest@0: res@tiMainString = "Observed MODIS MOD 17" forrest@0: ; res@tiMainString = "Model i01.03cn" forrest@0: ; res@tiMainString = "Model i01.04casa" forrest@0: forrest@0: res@gsnSpreadColors = True ; use full colormap forrest@0: res@cnLevelSelectionMode = "ManualLevels" ; Manual contour invtervals forrest@0: res@cnMinLevelValF = 0. ; Min level forrest@0: res@cnMaxLevelValF = 2200. ; Max level forrest@0: res@cnLevelSpacingF = 200. ; interval forrest@0: forrest@0: plot = gsn_csm_contour_map_ce(wks,x,res) ; for observed forrest@0: ; plot = gsn_csm_contour_map_ce(wks,x(0,:,:),res) ; for model forrest@0: forrest@0: end