|
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 netCDF file |
|
10 ;************************************************ |
|
11 ; fili = "Npp_0.05deg_mean.nc" |
|
12 fili = "Npp_T42_mean.nc" |
|
13 ; fili = "i01.03cn_1545-1569_ANN_climo.nc" |
|
14 ; fili = "i01.04casa_1605-1629_ANN_climo.nc" |
|
15 |
|
16 a = addfile(fili,"r") |
|
17 |
|
18 ;************************************************ |
|
19 ; read in data |
|
20 ;************************************************ |
|
21 ; x = a->NPP(::10,::10) ; for observed 0.05deg |
|
22 x = a->NPP |
|
23 |
|
24 nsec_per_year = 60*60*24*365 |
|
25 |
|
26 ;scale_factor = nsec_per_year ; for model |
|
27 scale_factor = 1. ; for observed T42 |
|
28 ;scale_factor = 0.1 ; for observed 0.05deg |
|
29 |
|
30 x = x * scale_factor |
|
31 |
|
32 x@units = "gC/m^2/year" |
|
33 ;************************************************ |
|
34 ; create default plot |
|
35 ;************************************************ |
|
36 |
|
37 ; setvalues NhlGetWorkspaceObjectId() |
|
38 ; "wsMaximumSize" : 199999999 |
|
39 ; end setvalues |
|
40 |
|
41 wks = gsn_open_wks("png","xy") ; open a ps file |
|
42 ; gsn_define_colormap(wks,"wgne15") ; choose colormap |
|
43 gsn_define_colormap(wks,"gui_default") ; choose colormap |
|
44 |
|
45 res = True ; Use plot options |
|
46 res@cnFillOn = True ; Turn on color fill |
|
47 res@gsnSpreadColors = True ; use full colormap |
|
48 ; res@cnFillMode = "RasterFill" ; Turn on raster color |
|
49 ; res@lbLabelAutoStride = True |
|
50 res@cnLinesOn = False ; Turn off contourn lines |
|
51 res@mpFillOn = False ; Turn off map fill |
|
52 res@tiMainString = "Observed MODIS MOD 17" |
|
53 ; res@tiMainString = "Model i01.03cn" |
|
54 ; res@tiMainString = "Model i01.04casa" |
|
55 |
|
56 res@gsnSpreadColors = True ; use full colormap |
|
57 res@cnLevelSelectionMode = "ManualLevels" ; Manual contour invtervals |
|
58 res@cnMinLevelValF = 0. ; Min level |
|
59 res@cnMaxLevelValF = 2200. ; Max level |
|
60 res@cnLevelSpacingF = 200. ; interval |
|
61 |
|
62 plot = gsn_csm_contour_map_ce(wks,x,res) ; for observed |
|
63 ; plot = gsn_csm_contour_map_ce(wks,x(0,:,:),res) ; for model |
|
64 |
|
65 end |