Modifications to scoring and graphics production for the final version of code for the 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"
9 diri = "/fis/cgd/cseg/people/jeff/clamp/"
10 fili = "Npp_0.05deg_mean.int16"
12 diro = "/fis/cgd/cseg/people/jeff/clamp/"
13 filo = "Npp_0.05deg_mean_3.nc"
14 c = addfile(diro+filo,"c")
16 ; I think (a) the file is "little endian"; read into short
17 ; (b) the _FillValue is 32700
19 setfileoption("bin","ReadByteOrder","LittleEndian")
20 xShort= fbindirread(diri+fili,0, (/nlat,mlon/), "short")
21 xShort@_FillValue= inttoshort(32700)
23 ;;xShort@scale_factor = ?????
24 ;;xShort@add_offset = ?????
26 x = short2flt( xShort )
28 ;;print(xShort(:,1800)+" "+x(:,1800)) ; look at the values
31 x@long_name = "net primary production"
32 x@units = "gC/m^2/year"
33 ; x@_FillValue = -17281 ; orig fill
34 x@_FillValue = 1e20 ; new fill
36 lat = latGlobeFo(nlat, "lat", "latitude", "degrees_north")
37 lat = (/ lat(::-1) /) ; make N->S
38 lon = lonGlobeFo(mlon, "lon", "longitude", "degrees_east")
39 lon = (/ lon - 180. /) ; subtract 180 from all values
40 lon&lon = lon ; update coordinates
51 ;************************************************
53 ;************************************************
55 setvalues NhlGetWorkspaceObjectId()
56 "wsMaximumSize" : 199999999
59 wks = gsn_open_wks("ps","Npp_rdBinPlt") ; open a ps file
60 ;gsn_define_colormap(wks,"wgne15") ; choose colormap
62 res = True ; Use plot options
63 res@cnFillOn = True ; Turn on color fill
64 res@cnFillMode = "RasterFill" ; Turn on raster color
65 res@lbLabelAutoStride = True
66 res@cnLinesOn = False ; Turn off contourn lines
67 ;res@gsnSpreadColors = True ; use full colormap
68 res@mpFillOn = False ; Turn off map fill
70 ;res@cnLevelSelectionMode = "ManualLevels" ; Manual contour invtervals
71 ;res@cnMinLevelValF = ; Min level
72 ;res@cnMaxLevelValF = ; Max level
73 ;res@cnLevelSpacingF = ; interval
74 res@tiMainString = fili
76 plot = gsn_csm_contour_map_ce(wks,x,res)