New model subsets and MODIS NPP for final C-LAMP paper in GCB.
1 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
2 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
3 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
6 ; Read in binary (2-byte, short int, little endian) MODIS NPP global
7 ; annual data at 0.5 degree resolution and create a mean that will
8 ; then be reprojected to various computational grids.
10 setfileoption("bin", "ReadByteOrder", "LittleEndian")
11 file_prefix = "Npp_0.05deg_"
12 file_suffix = ".int16"
20 bin_scale_factor = 0.1
22 npp = new((/bin_nlat,bin_nlon/), float)
26 do y = yr_init,yr_final
27 ifile = file_prefix + y + file_suffix
28 print("Reading " + ifile)
29 npp_short = fbindirread(ifile, 0, (/bin_nlat,bin_nlon/), "short")
30 npp_short@_FillValue = inttoshort(bin_fill)
31 npp = npp + short2flt(npp_short) * bin_scale_factor
37 npp = npp / int2flt(cnt)
39 npp@long_name = "net primary production"
40 npp@units = "gC/m^2/y"
41 npp@_FillValue = 1.e20
43 lat = latGlobeFo(bin_nlat, "lat", "latitude", "degrees_north")
44 lat = (/ lat(::-1) /) ; make N->S
45 lon = lonGlobeFo(bin_nlon, "lon", "longitude", "degrees_east")
46 lon = (/ lon - 180. /) ; subtract 180 from all values
47 lon&lon = lon ; update coordinates
54 ncfile = addfile("npp_0.5deg_mean_" + yr_init + "-" + yr_final + ".nc", "c")
57 ;*************************************
59 ;*************************************
61 setvalues NhlGetWorkspaceObjectId()
62 "wsMaximumSize" : 199999999
65 wks = gsn_open_wks("ps", "npp_0.5deg_mean_" + yr_init + "-" + yr_final) ; open a PostScript file
66 gsn_define_colormap(wks, "gui_default") ; choose colormap
68 res = True ; Use plot options
69 res@cnFillOn = True ; Turn on color fill
70 res@cnFillMode = "RasterFill" ; Turn on raster color
71 res@lbLabelAutoStride = True
72 res@cnLinesOn = False ; Turn off contour lines
73 res@gsnSpreadColors = True ; Use full colormap
74 res@mpFillOn = False ; Turn off map fill
76 res@cnLevelSelectionMode = "ManualLevels" ; Manual contour invtervals
77 res@cnMinLevelValF = 0. ; Min level
78 res@cnMaxLevelValF = 2200. ; Max level
79 res@cnLevelSpacingF = 200. ; interval
80 res@tiMainString = "MODIS mean net primary production (" + yr_init + "-" + yr_final + ")"
82 npp@units = "gC m~S~-2~N~ y~S~-1~N~"
84 plot = gsn_csm_contour_map_ce(wks,npp,res)