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 ;************************************************
10 ;************************************************
12 ;************************************************
13 ;fili2 = "b30.061n_1995-2004_ANN_climo_lnd.nc"
15 ;fili2 = "i01.03cn_1545-1569_ANN_climo.nc"
17 fili2 = "newcn05_ncep_1i_ANN_climo_lnd.nc"
20 diri2 = "/fis/cgd/cseg/people/jeff/clamp_data/model/"
21 f = addfile (diri2+fili2,"r")
30 ;************************************************
32 ;************************************************
33 diro = "/fis/cgd/cseg/people/jeff/clamp_data/biomass/ob/"
34 filo = "amazon_biomass_"+model_grid+".nc"
35 c = addfile(diro+filo,"c")
36 ;************************************************
37 ; read in observed data
38 ;************************************************
39 diri = "/fis/cgd/cseg/people/jeff/clamp_data/biomass/ob/"
40 fili = "amazon_biomass.nc"
41 g = addfile (diri+fili,"r")
45 ;************************************************
46 ; from class to value:
47 ; Biomass map has 11 classes: (unit= Mg/ha)
60 ;--------------------------
62 bi@_FillValue = 1.e+36
64 bi = where(bi.eq.0., bi@_FillValue,bi)
65 bi = where(bi.eq.1., 12.5,bi)
66 bi = where(bi.eq.2., 37.5,bi)
67 bi = where(bi.eq.3., 62.5,bi)
68 bi = where(bi.eq.4., 87.5,bi)
69 bi = where(bi.eq.5., 125.,bi)
70 bi = where(bi.eq.6., 175.,bi)
71 bi = where(bi.eq.7., 225.,bi)
72 bi = where(bi.eq.8., 275.,bi)
73 bi = where(bi.eq.9., 325.,bi)
74 bi = where(bi.eq.10.,375.,bi)
75 bi = where(bi.eq.11.,425.,bi)
77 ;print("min/max = " + min(bi) + "/" + max(bi))
79 ;************************************************
80 ; Observed factor_aboveground = 0.5
81 ;************************************************
83 factor_aboveground = 0.5
84 ;bi = bi * factor_aboveground
87 ;************************************************
88 ; find model grids that is inside observed grids
89 ;************************************************
90 ind_lonL = min(ind(lon .ge. xi(0)))
91 ind_lonR = max(ind(lon .le. xi(dimsizes(xi)-1)))
95 ;print (lon(ind_lonL))
98 ;print (xi(dimsizes(xi)-1))
99 ;print (lon(ind_lonR))
101 ind_latS = min(ind(lat .ge. yi(0)))
102 ind_latN = max(ind(lat .le. yi(dimsizes(yi)-1)))
106 ;print (lat(ind_latS))
109 ;print (yi(dimsizes(yi)-1))
110 ;print (lat(ind_latN))
112 nlat_out = ind_latN - ind_latS + 1
113 nlon_out = ind_lonR - ind_lonL + 1
118 bo = new((/nlat_out,nlon_out/),float)
119 lat_out = new((/nlat_out/),float)
120 lon_out = new((/nlon_out/),float)
125 if (j.eq.0 .or. j.eq.nlat-1) then
128 LATN = lat(j)+0.5*(lat(j+1)-lat(j))
130 if (j.eq.nlat-1) then
131 LATS = lat(j)-0.5*(lat(j)-lat(j-1))
135 LATS = lat(j)-0.5*(lat(j)-lat(j-1))
136 LATN = lat(j)+0.5*(lat(j+1)-lat(j))
143 if (i.eq.0 .or. i.eq.nlon-1) then
146 LONR = lon(i)+0.5*(lon(i+1)-lon(i))
148 if (i.eq.nlon-1) then
149 LONL = lon(i)-0.5*(lon(i)-lon(i-1))
153 LONL = lon(i)-0.5*(lon(i)-lon(i-1))
154 LONR = lon(i)+0.5*(lon(i+1)-lon(i))
162 bo(jj,ii) = avg(bi({LATS:LATN},{LONL:LONR}))
167 lon_out@long_name = "longitude"
168 lon_out@units = "degrees_east"
169 lon_out&lon = lon_out
172 lat_out@long_name = "latitude"
173 lat_out@units = "degrees_north"
174 lat_out&lat = lat_out
181 bo@long_name = bi@long_name
182 ; bo@_FillValue = bi@_FillValue
183 bo@_FillValue = 1.e+36