Modifications to scoring and graphics production for the final version of code for the C-LAMP paper in GCB.
1 ; ***********************************************
2 ; interpolate into model grids (T31)
3 ; ***********************************************
4 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
5 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
6 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
7 ;************************************************
12 ;************************************************
14 ;************************************************
15 diro = "/fis/cgd/cseg/people/jeff/clamp_data/lai/"
16 ; filo = "LAI_" + year + "_monthly_0.25deg.nc"
17 filo = "LAI_2000-2005_mean_0.25deg.nc"
18 ; filo = "LAI_2000-2005_ensemble_0.25deg.nc"
19 c = addfile(diro+filo,"c")
20 filedimdef(c,"time",-1,True)
22 ;************************************************
23 ; read in observed data
24 ;************************************************
25 diri = "/fis/cgd/cseg/people/jeff/clamp_data/lai/"
26 ; fili = "LAI_" + year + "_monthly.nc"
27 fili = "LAI_2000-2005_mean_0.05deg.nc"
28 ; fili = "LAI_2000-2005_ensemble_0.05deg.nc"
29 g = addfile (diri+fili,"r")
34 ;************************************************
35 ; change into 0-360E, 90S-90N
36 ; Observed NPP*scale_factor
37 ;************************************************
40 bi = (/ bi(:,::-1,:) /)
65 ;************************************************
66 ; create 0.25deg lat and lon
67 ;************************************************
71 lat = latGlobeFo(nlat, "lat", "latitude", "degrees_north") ; S->N
72 ; lat = (/ lat(::-1) /) ; N->S
74 lon = lonGlobeFo(nlon, "lon", "longitude", "degrees_east") ; 0->360
75 ; lon = (/ lon - 180. /) ; subtract 180 from all values ; 180W-180E
76 lon&lon = lon ; update coordinates
81 ; rad = 4.*atan(1.)/180.
84 ; clat@long_name = "cos(latitude)"
86 ; printVarSummary(clat)
88 ;bo = new((/12,nlat,nlon/),float)
89 bo = new((/1,nlat,nlon/),float)
94 if (j.eq.0 .or. j.eq.nlat-1) then
97 LATN = lat(j)+0.5*(lat(j+1)-lat(j))
100 LATS = lat(j)-0.5*(lat(j)-lat(j-1))
104 LATS = lat(j)-0.5*(lat(j)-lat(j-1))
105 LATN = lat(j)+0.5*(lat(j+1)-lat(j))
108 ; CLAT = clat({LATS:LATN}) ; do once for *slight* efficiency
109 ; TEMP = bi(:,{LATS:LATN},:) ; 2D [lat,lon]
112 if (i.eq.0 .or. i.eq.nlon-1) then
115 LONR = lon(i)+0.5*(lon(i+1)-lon(i))
117 if (i.eq.nlon-1) then
118 LONL = lon(i)-0.5*(lon(i)-lon(i-1))
122 LONL = lon(i)-0.5*(lon(i)-lon(i-1))
123 LONR = lon(i)+0.5*(lon(i+1)-lon(i))
131 bo(m,j,i) = avg(bi(m,{LATS:LATN},{LONL:LONR}))
132 ; bo(m,j,i) = wgt_areaave(TEMP(m,{LONL:LONR}), CLAT, 1.0, 0)
147 ; bo@units = bi@units
148 ; bo@long_name = bi@long_name
150 bo@long_name = "Leaf Area Index"
151 bo@_FillValue = bi@_FillValue