forrest@0
|
1 |
;************************************************************
|
forrest@0
|
2 |
; add table
|
forrest@0
|
3 |
; add time series plot
|
forrest@0
|
4 |
; sort by latitude in decending order (N->S)
|
forrest@0
|
5 |
; find year_ob >= 4
|
forrest@0
|
6 |
; add year_ob_i and year_ob_f
|
forrest@0
|
7 |
; change long_name
|
forrest@0
|
8 |
;************************************************************
|
forrest@0
|
9 |
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
|
forrest@0
|
10 |
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
|
forrest@0
|
11 |
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
|
forrest@0
|
12 |
;************************************************************
|
forrest@0
|
13 |
procedure set_line(lines:string,nline:integer,newlines:string)
|
forrest@0
|
14 |
begin
|
forrest@0
|
15 |
; add line to ascci/html file
|
forrest@0
|
16 |
|
forrest@0
|
17 |
nnewlines = dimsizes(newlines)
|
forrest@0
|
18 |
if(nline+nnewlines-1.ge.dimsizes(lines))
|
forrest@0
|
19 |
print("set_line: bad index, not setting anything.")
|
forrest@0
|
20 |
return
|
forrest@0
|
21 |
end if
|
forrest@0
|
22 |
lines(nline:nline+nnewlines-1) = newlines
|
forrest@0
|
23 |
; print ("lines = " + lines(nline:nline+nnewlines-1))
|
forrest@0
|
24 |
nline = nline + nnewlines
|
forrest@0
|
25 |
return
|
forrest@0
|
26 |
end
|
forrest@0
|
27 |
;*************************************************************
|
forrest@0
|
28 |
begin
|
forrest@0
|
29 |
|
forrest@0
|
30 |
plot_type = "ps"
|
forrest@0
|
31 |
plot_type_new = "png"
|
forrest@0
|
32 |
|
forrest@0
|
33 |
;************************************************
|
forrest@0
|
34 |
; read model data
|
forrest@0
|
35 |
;************************************************
|
forrest@0
|
36 |
model = "cn"
|
forrest@0
|
37 |
; model = "casa"
|
forrest@0
|
38 |
|
forrest@0
|
39 |
model_name = "i01.10" + model
|
forrest@0
|
40 |
|
forrest@0
|
41 |
; change to unit of observed (u mol/m2/s)
|
forrest@0
|
42 |
; Model_units [=] gC/m2/s
|
forrest@0
|
43 |
; 12. = molecular weight of C
|
forrest@0
|
44 |
; u mol = 1e-6 mol
|
forrest@0
|
45 |
factor = 1e6 /12.
|
forrest@0
|
46 |
|
forrest@0
|
47 |
ENERGY ="new"
|
forrest@0
|
48 |
|
forrest@0
|
49 |
;************************************************
|
forrest@0
|
50 |
; read data: observed
|
forrest@0
|
51 |
;************************************************
|
forrest@0
|
52 |
|
forrest@0
|
53 |
station = (/"ARM_Oklahoma" \
|
forrest@0
|
54 |
,"ARM_Oklahoma_burn" \
|
forrest@0
|
55 |
,"ARM_Oklahoma_control" \
|
forrest@0
|
56 |
,"Atqasuk" \
|
forrest@0
|
57 |
,"Audubon" \
|
forrest@0
|
58 |
,"AustinCary" \
|
forrest@0
|
59 |
,"Bartlett" \
|
forrest@0
|
60 |
,"Bondville" \
|
forrest@0
|
61 |
,"Brookings" \
|
forrest@0
|
62 |
,"Donaldson" \
|
forrest@0
|
63 |
,"Duke_Forest_Hardwoods" \
|
forrest@0
|
64 |
,"Duke_Forest_Open_Field" \
|
forrest@0
|
65 |
,"Duke_Forest_Pine" \
|
forrest@0
|
66 |
,"Fermi_Ag" \
|
forrest@0
|
67 |
,"Fermi_Prairie" \
|
forrest@0
|
68 |
,"Flagstaff_Managed" \
|
forrest@0
|
69 |
,"Flagstaff_Unmanaged" \
|
forrest@0
|
70 |
,"Flagstaff_Wildfire" \
|
forrest@0
|
71 |
,"FortPeck" \
|
forrest@0
|
72 |
,"FreemanRanch_mesquite" \
|
forrest@0
|
73 |
,"Goodwin_Creek" \
|
forrest@0
|
74 |
,"HarvardForest" \
|
forrest@0
|
75 |
,"HarvardForestHemlock" \
|
forrest@0
|
76 |
,"HowlandForestMain" \
|
forrest@0
|
77 |
,"HowlandForestWest" \
|
forrest@0
|
78 |
,"Ivotuk" \
|
forrest@0
|
79 |
,"KendallGrasslands" \
|
forrest@0
|
80 |
,"KennedySpaceCenterPine" \
|
forrest@0
|
81 |
,"KennedySpaceCenterScrub" \
|
forrest@0
|
82 |
,"LittleProspect" \
|
forrest@0
|
83 |
,"LostCreek" \
|
forrest@0
|
84 |
,"Mead-irrigated" \
|
forrest@0
|
85 |
,"Mead-irrigated-rotation" \
|
forrest@0
|
86 |
,"Mead-rainfed" \
|
forrest@0
|
87 |
,"Metolius_2nd_YoungPonderosaPine" \
|
forrest@0
|
88 |
,"MetoliusEyerly" \
|
forrest@0
|
89 |
,"MetoliusIntermediatePine" \
|
forrest@0
|
90 |
,"MetoliusOldPonderosaPine" \
|
forrest@0
|
91 |
,"MissouriOzark" \
|
forrest@0
|
92 |
,"Mize" \
|
forrest@0
|
93 |
,"MorganMonroe" \
|
forrest@0
|
94 |
,"NiwotRidge" \
|
forrest@0
|
95 |
,"NorthCarolina_cc" \
|
forrest@0
|
96 |
,"NorthCarolina_lp" \
|
forrest@0
|
97 |
,"ParkFalls" \
|
forrest@0
|
98 |
,"Rayonier" \
|
forrest@0
|
99 |
,"SantaRita" \
|
forrest@0
|
100 |
,"SkyOaks_Old" \
|
forrest@0
|
101 |
,"SkyOaks_PostFire" \
|
forrest@0
|
102 |
,"SkyOaks_Young" \
|
forrest@0
|
103 |
,"SylvaniaWilderness" \
|
forrest@0
|
104 |
,"Toledo" \
|
forrest@0
|
105 |
,"Tonzi" \
|
forrest@0
|
106 |
,"UCI_1850" \
|
forrest@0
|
107 |
,"UCI_1930" \
|
forrest@0
|
108 |
,"UCI_1964" \
|
forrest@0
|
109 |
,"UCI_1964wet" \
|
forrest@0
|
110 |
,"UCI_1981" \
|
forrest@0
|
111 |
,"UCI_1989" \
|
forrest@0
|
112 |
,"UCI_1998" \
|
forrest@0
|
113 |
,"UMBS" \
|
forrest@0
|
114 |
,"Vaira" \
|
forrest@0
|
115 |
,"WalkerBranch" \
|
forrest@0
|
116 |
,"WillowCreek" \
|
forrest@0
|
117 |
,"WindRiver" \
|
forrest@0
|
118 |
,"Wisconsin_ihw" \
|
forrest@0
|
119 |
,"Wisconsin_irp" \
|
forrest@0
|
120 |
,"Wisconsin_mrp" \
|
forrest@0
|
121 |
,"Wisconsin_myjp" \
|
forrest@0
|
122 |
,"Wisconsin_pb" \
|
forrest@0
|
123 |
,"Wisconsin_rpcc" \
|
forrest@0
|
124 |
,"Wisconsin_yhw" \
|
forrest@0
|
125 |
,"Wisconsin_yjp" \
|
forrest@0
|
126 |
,"Wisconsin_yrp" \
|
forrest@0
|
127 |
/)
|
forrest@0
|
128 |
|
forrest@0
|
129 |
year_ob = (/"2003-2006" \
|
forrest@0
|
130 |
,"2005-2006" \
|
forrest@0
|
131 |
,"2005-2006" \
|
forrest@0
|
132 |
,"1999-2006" \
|
forrest@0
|
133 |
,"2002-2006" \
|
forrest@0
|
134 |
,"2000-2005" \
|
forrest@0
|
135 |
,"2004-2005" \
|
forrest@0
|
136 |
,"1996-2006" \
|
forrest@0
|
137 |
,"2004-2006" \
|
forrest@0
|
138 |
,"1999-2004" \
|
forrest@0
|
139 |
,"2003-2005" \
|
forrest@0
|
140 |
,"2001-2005" \
|
forrest@0
|
141 |
,"2001-2005" \
|
forrest@0
|
142 |
,"2005-2006" \
|
forrest@0
|
143 |
,"2004-2006" \
|
forrest@0
|
144 |
,"2005-2006" \
|
forrest@0
|
145 |
,"2005-2006" \
|
forrest@0
|
146 |
,"2005-2006" \
|
forrest@0
|
147 |
,"2000-2006" \
|
forrest@0
|
148 |
,"2004-2006" \
|
forrest@0
|
149 |
,"2002-2006" \
|
forrest@0
|
150 |
,"1991-2004" \
|
forrest@0
|
151 |
,"2004-2004" \
|
forrest@0
|
152 |
,"1996-2004" \
|
forrest@0
|
153 |
,"1999-2004" \
|
forrest@0
|
154 |
,"2003-2006" \
|
forrest@0
|
155 |
,"2004-2006" \
|
forrest@0
|
156 |
,"2002-2002" \
|
forrest@0
|
157 |
,"2000-2006" \
|
forrest@0
|
158 |
,"2002-2005" \
|
forrest@0
|
159 |
,"2001-2005" \
|
forrest@0
|
160 |
,"2001-2005" \
|
forrest@0
|
161 |
,"2001-2005" \
|
forrest@0
|
162 |
,"2001-2005" \
|
forrest@0
|
163 |
,"2004-2005" \
|
forrest@0
|
164 |
,"2004-2005" \
|
forrest@0
|
165 |
,"2003-2005" \
|
forrest@0
|
166 |
,"1996-2000" \
|
forrest@0
|
167 |
,"2004-2006" \
|
forrest@0
|
168 |
,"1998-2004" \
|
forrest@0
|
169 |
,"1999-2005" \
|
forrest@0
|
170 |
,"1999-2003" \
|
forrest@0
|
171 |
,"2005-2006" \
|
forrest@0
|
172 |
,"2005-2006" \
|
forrest@0
|
173 |
,"1996-2003" \
|
forrest@0
|
174 |
,"1998-1998" \
|
forrest@0
|
175 |
,"2004-2006" \
|
forrest@0
|
176 |
,"1997-2006" \
|
forrest@0
|
177 |
,"2004-2006" \
|
forrest@0
|
178 |
,"1997-2006" \
|
forrest@0
|
179 |
,"2002-2006" \
|
forrest@0
|
180 |
,"2004-2005" \
|
forrest@0
|
181 |
,"2001-2006" \
|
forrest@0
|
182 |
,"2004-2005" \
|
forrest@0
|
183 |
,"2001-2005" \
|
forrest@0
|
184 |
,"2001-2005" \
|
forrest@0
|
185 |
,"2002-2004" \
|
forrest@0
|
186 |
,"2001-2005" \
|
forrest@0
|
187 |
,"2001-2005" \
|
forrest@0
|
188 |
,"2002-2005" \
|
forrest@0
|
189 |
,"1999-2003" \
|
forrest@0
|
190 |
,"2001-2006" \
|
forrest@0
|
191 |
,"1995-1999" \
|
forrest@0
|
192 |
,"1999-2005" \
|
forrest@0
|
193 |
,"1999-2004" \
|
forrest@0
|
194 |
,"2003-2003" \
|
forrest@0
|
195 |
,"2003-2003" \
|
forrest@0
|
196 |
,"2002-2005" \
|
forrest@0
|
197 |
,"2004-2004" \
|
forrest@0
|
198 |
,"2002-2002" \
|
forrest@0
|
199 |
,"2005-2005" \
|
forrest@0
|
200 |
,"2002-2002" \
|
forrest@0
|
201 |
,"2004-2005" \
|
forrest@0
|
202 |
,"2002-2002" \
|
forrest@0
|
203 |
/)
|
forrest@0
|
204 |
|
forrest@0
|
205 |
year_ob_i = (/2003 \
|
forrest@0
|
206 |
,2005 \
|
forrest@0
|
207 |
,2005 \
|
forrest@0
|
208 |
,1999 \
|
forrest@0
|
209 |
,2002 \
|
forrest@0
|
210 |
,2000 \
|
forrest@0
|
211 |
,2004 \
|
forrest@0
|
212 |
,1996 \
|
forrest@0
|
213 |
,2004 \
|
forrest@0
|
214 |
,1999 \
|
forrest@0
|
215 |
,2003 \
|
forrest@0
|
216 |
,2001 \
|
forrest@0
|
217 |
,2001 \
|
forrest@0
|
218 |
,2005 \
|
forrest@0
|
219 |
,2004 \
|
forrest@0
|
220 |
,2005 \
|
forrest@0
|
221 |
,2005 \
|
forrest@0
|
222 |
,2005 \
|
forrest@0
|
223 |
,2000 \
|
forrest@0
|
224 |
,2004 \
|
forrest@0
|
225 |
,2002 \
|
forrest@0
|
226 |
,1991 \
|
forrest@0
|
227 |
,2004 \
|
forrest@0
|
228 |
,1996 \
|
forrest@0
|
229 |
,1999 \
|
forrest@0
|
230 |
,2003 \
|
forrest@0
|
231 |
,2004 \
|
forrest@0
|
232 |
,2002 \
|
forrest@0
|
233 |
,2000 \
|
forrest@0
|
234 |
,2002 \
|
forrest@0
|
235 |
,2001 \
|
forrest@0
|
236 |
,2001 \
|
forrest@0
|
237 |
,2001 \
|
forrest@0
|
238 |
,2001 \
|
forrest@0
|
239 |
,2004 \
|
forrest@0
|
240 |
,2004 \
|
forrest@0
|
241 |
,2003 \
|
forrest@0
|
242 |
,1996 \
|
forrest@0
|
243 |
,2004 \
|
forrest@0
|
244 |
,1998 \
|
forrest@0
|
245 |
,1999 \
|
forrest@0
|
246 |
,1999 \
|
forrest@0
|
247 |
,2005 \
|
forrest@0
|
248 |
,2005 \
|
forrest@0
|
249 |
,1996 \
|
forrest@0
|
250 |
,1998 \
|
forrest@0
|
251 |
,2004 \
|
forrest@0
|
252 |
,1997 \
|
forrest@0
|
253 |
,2004 \
|
forrest@0
|
254 |
,1997 \
|
forrest@0
|
255 |
,2002 \
|
forrest@0
|
256 |
,2004 \
|
forrest@0
|
257 |
,2001 \
|
forrest@0
|
258 |
,2004 \
|
forrest@0
|
259 |
,2001 \
|
forrest@0
|
260 |
,2001 \
|
forrest@0
|
261 |
,2002 \
|
forrest@0
|
262 |
,2001 \
|
forrest@0
|
263 |
,2001 \
|
forrest@0
|
264 |
,2002 \
|
forrest@0
|
265 |
,1999 \
|
forrest@0
|
266 |
,2001 \
|
forrest@0
|
267 |
,1995 \
|
forrest@0
|
268 |
,1999 \
|
forrest@0
|
269 |
,1999 \
|
forrest@0
|
270 |
,2003 \
|
forrest@0
|
271 |
,2003 \
|
forrest@0
|
272 |
,2002 \
|
forrest@0
|
273 |
,2004 \
|
forrest@0
|
274 |
,2002 \
|
forrest@0
|
275 |
,2005 \
|
forrest@0
|
276 |
,2002 \
|
forrest@0
|
277 |
,2004 \
|
forrest@0
|
278 |
,2002 \
|
forrest@0
|
279 |
/)
|
forrest@0
|
280 |
|
forrest@0
|
281 |
year_ob_f = (/2006 \
|
forrest@0
|
282 |
,2006 \
|
forrest@0
|
283 |
,2006 \
|
forrest@0
|
284 |
,2006 \
|
forrest@0
|
285 |
,2006 \
|
forrest@0
|
286 |
,2005 \
|
forrest@0
|
287 |
,2005 \
|
forrest@0
|
288 |
,2006 \
|
forrest@0
|
289 |
,2006 \
|
forrest@0
|
290 |
,2004 \
|
forrest@0
|
291 |
,2005 \
|
forrest@0
|
292 |
,2005 \
|
forrest@0
|
293 |
,2005 \
|
forrest@0
|
294 |
,2006 \
|
forrest@0
|
295 |
,2006 \
|
forrest@0
|
296 |
,2006 \
|
forrest@0
|
297 |
,2006 \
|
forrest@0
|
298 |
,2006 \
|
forrest@0
|
299 |
,2006 \
|
forrest@0
|
300 |
,2006 \
|
forrest@0
|
301 |
,2006 \
|
forrest@0
|
302 |
,2004 \
|
forrest@0
|
303 |
,2004 \
|
forrest@0
|
304 |
,2004 \
|
forrest@0
|
305 |
,2004 \
|
forrest@0
|
306 |
,2006 \
|
forrest@0
|
307 |
,2006 \
|
forrest@0
|
308 |
,2002 \
|
forrest@0
|
309 |
,2006 \
|
forrest@0
|
310 |
,2005 \
|
forrest@0
|
311 |
,2005 \
|
forrest@0
|
312 |
,2005 \
|
forrest@0
|
313 |
,2005 \
|
forrest@0
|
314 |
,2005 \
|
forrest@0
|
315 |
,2005 \
|
forrest@0
|
316 |
,2005 \
|
forrest@0
|
317 |
,2005 \
|
forrest@0
|
318 |
,2000 \
|
forrest@0
|
319 |
,2006 \
|
forrest@0
|
320 |
,2004 \
|
forrest@0
|
321 |
,2005 \
|
forrest@0
|
322 |
,2003 \
|
forrest@0
|
323 |
,2006 \
|
forrest@0
|
324 |
,2006 \
|
forrest@0
|
325 |
,2003 \
|
forrest@0
|
326 |
,1998 \
|
forrest@0
|
327 |
,2006 \
|
forrest@0
|
328 |
,2006 \
|
forrest@0
|
329 |
,2006 \
|
forrest@0
|
330 |
,2006 \
|
forrest@0
|
331 |
,2006 \
|
forrest@0
|
332 |
,2005 \
|
forrest@0
|
333 |
,2006 \
|
forrest@0
|
334 |
,2005 \
|
forrest@0
|
335 |
,2005 \
|
forrest@0
|
336 |
,2005 \
|
forrest@0
|
337 |
,2004 \
|
forrest@0
|
338 |
,2005 \
|
forrest@0
|
339 |
,2005 \
|
forrest@0
|
340 |
,2005 \
|
forrest@0
|
341 |
,2003 \
|
forrest@0
|
342 |
,2006 \
|
forrest@0
|
343 |
,1999 \
|
forrest@0
|
344 |
,2005 \
|
forrest@0
|
345 |
,2004 \
|
forrest@0
|
346 |
,2003 \
|
forrest@0
|
347 |
,2003 \
|
forrest@0
|
348 |
,2005 \
|
forrest@0
|
349 |
,2004 \
|
forrest@0
|
350 |
,2002 \
|
forrest@0
|
351 |
,2005 \
|
forrest@0
|
352 |
,2002 \
|
forrest@0
|
353 |
,2005 \
|
forrest@0
|
354 |
,2002 \
|
forrest@0
|
355 |
/)
|
forrest@0
|
356 |
|
forrest@0
|
357 |
field = (/"NEE Flux" \
|
forrest@0
|
358 |
,"Net Radiation" \
|
forrest@0
|
359 |
,"Latent Heat" \
|
forrest@0
|
360 |
,"Sensible Heat" \
|
forrest@0
|
361 |
,"GPP Flux" \
|
forrest@0
|
362 |
,"Respiration" \
|
forrest@0
|
363 |
/)
|
forrest@0
|
364 |
|
forrest@0
|
365 |
field_unit = (/"u mol/m2/s" \
|
forrest@0
|
366 |
,"W/m2" \
|
forrest@0
|
367 |
,"W/m2" \
|
forrest@0
|
368 |
,"W/m2" \
|
forrest@0
|
369 |
,"u mol/m2/s" \
|
forrest@0
|
370 |
,"u mol/m2/s" \
|
forrest@0
|
371 |
/)
|
forrest@0
|
372 |
|
forrest@0
|
373 |
nfield = dimsizes(field)
|
forrest@0
|
374 |
|
forrest@0
|
375 |
;========================================================================
|
forrest@0
|
376 |
; find (# of year observed) >=4 and year_ob_i <= 2001
|
forrest@0
|
377 |
|
forrest@0
|
378 |
dir_root = "/fis/cgd/cseg/people/jeff/clamp/ameriflux/data/"
|
forrest@0
|
379 |
|
forrest@0
|
380 |
nstation = dimsizes(station)
|
forrest@0
|
381 |
|
forrest@0
|
382 |
year_station = new ((/nstation/),integer)
|
forrest@0
|
383 |
|
forrest@0
|
384 |
do n = 0,nstation-1
|
forrest@0
|
385 |
|
forrest@0
|
386 |
diro = dir_root + station(n)+"/"
|
forrest@0
|
387 |
filo = year_ob_i(n)+"-"+year_ob_f(n)+"_L4_m.nc"
|
forrest@0
|
388 |
fo = addfile (diro+filo,"r")
|
forrest@0
|
389 |
|
forrest@0
|
390 |
year = fo->year
|
forrest@0
|
391 |
year_station(n) = dimsizes(year)
|
forrest@0
|
392 |
delete (year)
|
forrest@0
|
393 |
|
forrest@0
|
394 |
end do
|
forrest@0
|
395 |
|
forrest@0
|
396 |
delete (fo)
|
forrest@0
|
397 |
|
forrest@0
|
398 |
i_long_ob = ind(year_station .ge. 4 .and. year_ob_i .le. 2001)
|
forrest@0
|
399 |
|
forrest@0
|
400 |
station_long = station(i_long_ob)
|
forrest@0
|
401 |
year_ob_long = year_ob(i_long_ob)
|
forrest@0
|
402 |
year_ob_i_long = year_ob_i(i_long_ob)
|
forrest@0
|
403 |
year_ob_f_long = year_ob_f(i_long_ob)
|
forrest@0
|
404 |
year_station_long = year_station(i_long_ob)
|
forrest@0
|
405 |
|
forrest@0
|
406 |
nstation_long = dimsizes(station_long)
|
forrest@0
|
407 |
; print (nstation_long)
|
forrest@0
|
408 |
; print (i_long_ob)
|
forrest@0
|
409 |
; print (year_ob_i(i_long_ob))
|
forrest@0
|
410 |
; print (station_long)
|
forrest@0
|
411 |
|
forrest@0
|
412 |
;========================================================================
|
forrest@0
|
413 |
; get long observed lat and lon
|
forrest@0
|
414 |
|
forrest@0
|
415 |
dir_root = "/fis/cgd/cseg/people/jeff/clamp/ameriflux/data/"
|
forrest@0
|
416 |
|
forrest@0
|
417 |
lat_ob_long = new ((/nstation_long/),float)
|
forrest@0
|
418 |
lon_ob_long = new ((/nstation_long/),float)
|
forrest@0
|
419 |
|
forrest@0
|
420 |
do n = 0,nstation_long-1
|
forrest@0
|
421 |
|
forrest@0
|
422 |
diro = dir_root + station_long(n)+"/"
|
forrest@0
|
423 |
filo = year_ob_i_long(n)+"-"+year_ob_f_long(n)+"_L4_m.nc"
|
forrest@0
|
424 |
fo = addfile (diro+filo,"r")
|
forrest@0
|
425 |
|
forrest@0
|
426 |
; print (diro)
|
forrest@0
|
427 |
; print (filo)
|
forrest@0
|
428 |
|
forrest@0
|
429 |
lon_ob_long(n) = fo->lon
|
forrest@0
|
430 |
lat_ob_long(n) = fo->lat
|
forrest@0
|
431 |
|
forrest@0
|
432 |
delete (fo)
|
forrest@0
|
433 |
|
forrest@0
|
434 |
end do
|
forrest@0
|
435 |
|
forrest@0
|
436 |
;=========================================================
|
forrest@0
|
437 |
; get model data at observed lat-lon
|
forrest@0
|
438 |
|
forrest@0
|
439 |
dirm = "/fis/cgd/cseg/people/jeff/clamp_data/model/"
|
forrest@0
|
440 |
film = model_name+"_ameriflux_1990-2004_monthly.nc"
|
forrest@0
|
441 |
fm = addfile (dirm+film,"r")
|
forrest@0
|
442 |
|
forrest@0
|
443 |
xm = fm->lon
|
forrest@0
|
444 |
ym = fm->lat
|
forrest@0
|
445 |
date = fm->date
|
forrest@0
|
446 |
|
forrest@0
|
447 |
date_dim = dimsizes(date)
|
forrest@0
|
448 |
nyear = date_dim(0)
|
forrest@0
|
449 |
|
forrest@0
|
450 |
nmonth =12
|
forrest@0
|
451 |
|
forrest@0
|
452 |
data_mod = new ((/nfield,nyear,nmonth,nstation_long/),float)
|
forrest@0
|
453 |
|
forrest@0
|
454 |
;************************************************************
|
forrest@0
|
455 |
; interpolate model data into observed station
|
forrest@0
|
456 |
; note: model is 0-360E, 90S-90N
|
forrest@0
|
457 |
;************************************************************
|
forrest@0
|
458 |
|
forrest@0
|
459 |
; to be able to handle observation at (-89.98,-24.80)
|
forrest@0
|
460 |
ym(0) = -90.
|
forrest@0
|
461 |
|
forrest@0
|
462 |
if (ENERGY .eq. "old") then
|
forrest@0
|
463 |
|
forrest@0
|
464 |
data = fm->NEE
|
forrest@0
|
465 |
data_mod(0,:,:,:) = data(:,:,:) * factor
|
forrest@0
|
466 |
|
forrest@0
|
467 |
; data = fm->LATENT
|
forrest@0
|
468 |
data1 = fm->FCEV
|
forrest@0
|
469 |
data2 = fm->FCTR
|
forrest@0
|
470 |
data3 = fm->FGEV
|
forrest@0
|
471 |
data_mod(2,:,:,:) = data1(:,:,:)+data2(:,:,:)+data3(:,:,:)
|
forrest@0
|
472 |
delete (data1)
|
forrest@0
|
473 |
delete (data2)
|
forrest@0
|
474 |
delete (data3)
|
forrest@0
|
475 |
|
forrest@0
|
476 |
; data = fm->SENSIBLE
|
forrest@0
|
477 |
data = fm->FSH
|
forrest@0
|
478 |
data_mod(3,:,:,:) = data(:,:,:)
|
forrest@0
|
479 |
|
forrest@0
|
480 |
; data = fm->NETRAD
|
forrest@0
|
481 |
data1 = fm->FSA
|
forrest@0
|
482 |
data2 = fm->FIRA
|
forrest@0
|
483 |
data_mod(1,:,:,:) = data1(:,:,:)-data2(:,:,:)
|
forrest@0
|
484 |
delete (data1)
|
forrest@0
|
485 |
delete (data2)
|
forrest@0
|
486 |
|
forrest@0
|
487 |
else
|
forrest@0
|
488 |
|
forrest@0
|
489 |
data = fm->NEE
|
forrest@0
|
490 |
yy = linint2_points_Wrap(xm,ym,data,True,lon_ob_long,lat_ob_long,0)
|
forrest@0
|
491 |
data_mod(0,:,:,:) = yy(:,:,:) * factor
|
forrest@0
|
492 |
|
forrest@0
|
493 |
data = fm->NETRAD
|
forrest@0
|
494 |
yy = linint2_points_Wrap(xm,ym,data,True,lon_ob_long,lat_ob_long,0)
|
forrest@0
|
495 |
data_mod(1,:,:,:) = yy(:,:,:)
|
forrest@0
|
496 |
|
forrest@0
|
497 |
data = fm->LATENT
|
forrest@0
|
498 |
yy = linint2_points_Wrap(xm,ym,data,True,lon_ob_long,lat_ob_long,0)
|
forrest@0
|
499 |
data_mod(2,:,:,:) = yy(:,:,:)
|
forrest@0
|
500 |
|
forrest@0
|
501 |
; data = fm->SENSIBLE
|
forrest@0
|
502 |
data = fm->FSH
|
forrest@0
|
503 |
yy = linint2_points_Wrap(xm,ym,data,True,lon_ob_long,lat_ob_long,0)
|
forrest@0
|
504 |
data_mod(3,:,:,:) = yy(:,:,:)
|
forrest@0
|
505 |
|
forrest@0
|
506 |
end if
|
forrest@0
|
507 |
|
forrest@0
|
508 |
data = fm->GPP
|
forrest@0
|
509 |
yy = linint2_points_Wrap(xm,ym,data,True,lon_ob_long,lat_ob_long,0)
|
forrest@0
|
510 |
data_mod(4,:,:,:) = yy(:,:,:) * factor
|
forrest@0
|
511 |
|
forrest@0
|
512 |
if (model .eq. "cn") then
|
forrest@0
|
513 |
data = fm->ER
|
forrest@0
|
514 |
else
|
forrest@0
|
515 |
data1 = fm->AR
|
forrest@0
|
516 |
data2 = fm->HR
|
forrest@0
|
517 |
data = data1 + data2
|
forrest@0
|
518 |
|
forrest@0
|
519 |
delete (data1)
|
forrest@0
|
520 |
delete (data2)
|
forrest@0
|
521 |
end if
|
forrest@0
|
522 |
|
forrest@0
|
523 |
yy = linint2_points_Wrap(xm,ym,data,True,lon_ob_long,lat_ob_long,0)
|
forrest@0
|
524 |
data_mod(5,:,:,:) = yy(:,:,:) * factor
|
forrest@0
|
525 |
|
forrest@0
|
526 |
delete (fm)
|
forrest@0
|
527 |
delete (data)
|
forrest@0
|
528 |
|
forrest@0
|
529 |
;*******************************************************************
|
forrest@0
|
530 |
; for station line plot
|
forrest@0
|
531 |
;*******************************************************************
|
forrest@0
|
532 |
|
forrest@0
|
533 |
; for x-axis in xyplot
|
forrest@0
|
534 |
mon = ispan(1,12,1)
|
forrest@0
|
535 |
mon@long_name = "month"
|
forrest@0
|
536 |
|
forrest@0
|
537 |
res = True ; plot mods desired
|
forrest@0
|
538 |
res@xyLineThicknesses = (/2.0,2.0/) ; make 2nd lines thicker
|
forrest@0
|
539 |
res@xyLineColors = (/"blue","red"/) ; line color (ob,model)
|
forrest@0
|
540 |
|
forrest@0
|
541 |
res@tmXBFormat = "f" ; not to add trailing zeros
|
forrest@0
|
542 |
|
forrest@0
|
543 |
;-------------------------------------------------------------------------
|
forrest@0
|
544 |
; Add a boxed legend using the more simple method
|
forrest@0
|
545 |
|
forrest@0
|
546 |
res@pmLegendDisplayMode = "Always"
|
forrest@0
|
547 |
; res@pmLegendWidthF = 0.1
|
forrest@0
|
548 |
res@pmLegendWidthF = 0.08
|
forrest@0
|
549 |
res@pmLegendHeightF = 0.06
|
forrest@0
|
550 |
; res@pmLegendOrthogonalPosF = -1.17
|
forrest@0
|
551 |
; res@pmLegendOrthogonalPosF = -1.00 ;(downward)
|
forrest@0
|
552 |
res@pmLegendOrthogonalPosF = -0.30 ;(downward)
|
forrest@0
|
553 |
|
forrest@0
|
554 |
; res@pmLegendParallelPosF = 0.18
|
forrest@0
|
555 |
res@pmLegendParallelPosF = 0.23 ;(rightward)
|
forrest@0
|
556 |
|
forrest@0
|
557 |
; res@lgPerimOn = False
|
forrest@0
|
558 |
res@lgLabelFontHeightF = 0.015
|
forrest@0
|
559 |
res@xyExplicitLegendLabels = (/"observed",model_name/)
|
forrest@0
|
560 |
;-------------------------------------------------------------------
|
forrest@0
|
561 |
; for panel plot
|
forrest@0
|
562 |
res@gsnFrame = False ; Do not draw plot
|
forrest@0
|
563 |
res@gsnDraw = False ; Do not advance frame
|
forrest@0
|
564 |
|
forrest@0
|
565 |
pres = True ; panel plot mods desired
|
forrest@0
|
566 |
pres@gsnPanelYWhiteSpacePercent = 5 ; increase white space around
|
forrest@0
|
567 |
; indiv. plots in panel
|
forrest@0
|
568 |
pres@gsnMaximize = True ; fill the page
|
forrest@0
|
569 |
;-------------------------------------------------------------------
|
forrest@0
|
570 |
|
forrest@0
|
571 |
;==============================================================
|
forrest@0
|
572 |
; get ob data at each site
|
forrest@0
|
573 |
|
forrest@0
|
574 |
dir_root = "/fis/cgd/cseg/people/jeff/clamp/ameriflux/data/"
|
forrest@0
|
575 |
|
forrest@0
|
576 |
do n = 0,nstation_long-1
|
forrest@0
|
577 |
; do n = 2,6
|
forrest@0
|
578 |
|
forrest@0
|
579 |
year_setback = 0
|
forrest@0
|
580 |
|
forrest@0
|
581 |
nyear = year_station_long(n)
|
forrest@0
|
582 |
|
forrest@0
|
583 |
if (year_ob_f_long(n).eq. 2006) then
|
forrest@0
|
584 |
year_setback = 2006 -2004
|
forrest@0
|
585 |
end if
|
forrest@0
|
586 |
if (year_ob_f_long(n).eq. 2005) then
|
forrest@0
|
587 |
year_setback = 2005 -2004
|
forrest@0
|
588 |
end if
|
forrest@0
|
589 |
|
forrest@0
|
590 |
ntime = (nyear - year_setback) * nmonth
|
forrest@0
|
591 |
print (nyear)
|
forrest@0
|
592 |
|
forrest@0
|
593 |
data_ob = new ((/nfield, nyear, nmonth/),float)
|
forrest@0
|
594 |
|
forrest@0
|
595 |
diro = dir_root + station_long(n)+"/"
|
forrest@0
|
596 |
filo = year_ob_i_long(n)+"-"+year_ob_f_long(n)+"_L4_m.nc"
|
forrest@0
|
597 |
fo = addfile (diro+filo,"r")
|
forrest@0
|
598 |
|
forrest@0
|
599 |
; print (diro)
|
forrest@0
|
600 |
; print (filo)
|
forrest@0
|
601 |
|
forrest@0
|
602 |
data_ob(0,:,:) = fo->NEE_or_fMDS
|
forrest@0
|
603 |
data_ob(1,:,:) = fo->Rg_f
|
forrest@0
|
604 |
data_ob(2,:,:) = fo->LE_f
|
forrest@0
|
605 |
data_ob(3,:,:) = fo->H_f
|
forrest@0
|
606 |
data_ob(4,:,:) = fo->GPP_or_MDS
|
forrest@0
|
607 |
data_ob(5,:,:) = fo->Reco_or
|
forrest@0
|
608 |
|
forrest@0
|
609 |
delete (fo)
|
forrest@0
|
610 |
|
forrest@0
|
611 |
timeI = new((/ntime/),integer)
|
forrest@0
|
612 |
timeF = new((/ntime/),float)
|
forrest@0
|
613 |
timeI = ispan(1,ntime,1)
|
forrest@0
|
614 |
timeF = year_ob_i_long(n) + (timeI-1)/12.
|
forrest@0
|
615 |
timeF@long_name = "year"
|
forrest@0
|
616 |
|
forrest@0
|
617 |
plot_data = new((/2,ntime/),float)
|
forrest@0
|
618 |
|
forrest@0
|
619 |
;----------------------------
|
forrest@0
|
620 |
; for model_vs_ob
|
forrest@0
|
621 |
|
forrest@0
|
622 |
plot_name = station_long(n)+"_tseries_vs_ob"
|
forrest@0
|
623 |
title = station_long(n)+"("+sprintf("%5.2f",lat_ob_long(n))+","+sprintf("%5.2f",lon_ob_long(n))+")"
|
forrest@0
|
624 |
res@tiMainString = title
|
forrest@0
|
625 |
|
forrest@0
|
626 |
wks = gsn_open_wks (plot_type,plot_name)
|
forrest@0
|
627 |
plot=new(nfield,graphic) ; create graphic array
|
forrest@0
|
628 |
|
forrest@0
|
629 |
i_year_mod_i = year_ob_i_long(n) - 1990
|
forrest@0
|
630 |
i_year_mod_f = i_year_mod_i + nyear - 1 - year_setback
|
forrest@0
|
631 |
|
forrest@0
|
632 |
i_year_ob_f = nyear - year_setback - 1
|
forrest@0
|
633 |
|
forrest@0
|
634 |
; print (nyear)
|
forrest@0
|
635 |
; print (i_year_ob_f)
|
forrest@0
|
636 |
; print (i_year_mod_i)
|
forrest@0
|
637 |
; print (i_year_mod_f)
|
forrest@0
|
638 |
|
forrest@0
|
639 |
do i = 0,nfield-1
|
forrest@0
|
640 |
plot_data(0,:) = ndtooned(data_ob (i,0:i_year_ob_f,:))
|
forrest@0
|
641 |
plot_data(1,:) = ndtooned(data_mod(i,i_year_mod_i:i_year_mod_f,:,n))
|
forrest@0
|
642 |
plot_data@long_name = field(i)+" ("+field_unit(i)+")"
|
forrest@0
|
643 |
plot(i)=gsn_csm_xy(wks,timeF,plot_data,res) ; create plot
|
forrest@0
|
644 |
end do
|
forrest@0
|
645 |
|
forrest@0
|
646 |
gsn_panel(wks,plot,(/3,2/),pres) ; create panel plot
|
forrest@0
|
647 |
|
forrest@0
|
648 |
system("convert "+plot_name+"."+plot_type+" "+plot_name+"."+plot_type_new+";"+ \
|
forrest@0
|
649 |
"rm "+plot_name+"."+plot_type)
|
forrest@0
|
650 |
|
forrest@0
|
651 |
clear (wks)
|
forrest@0
|
652 |
delete (plot)
|
forrest@0
|
653 |
|
forrest@0
|
654 |
delete (data_ob)
|
forrest@0
|
655 |
delete (timeI)
|
forrest@0
|
656 |
delete (timeF)
|
forrest@0
|
657 |
delete (plot_data)
|
forrest@0
|
658 |
|
forrest@0
|
659 |
end do
|
forrest@0
|
660 |
|
forrest@0
|
661 |
;###################################################################
|
forrest@0
|
662 |
; for the following tables,
|
forrest@0
|
663 |
; sort by latitude in decending order (N->S)
|
forrest@0
|
664 |
|
forrest@0
|
665 |
isort = dim_pqsort(lat_ob_long,-1)
|
forrest@0
|
666 |
|
forrest@0
|
667 |
station_sort = station_long(isort)
|
forrest@0
|
668 |
year_ob_sort = year_ob_long(isort)
|
forrest@0
|
669 |
lat_ob_sort = lat_ob_long(isort)
|
forrest@0
|
670 |
lon_ob_sort = lon_ob_long(isort)
|
forrest@0
|
671 |
|
forrest@0
|
672 |
; print(isort)
|
forrest@0
|
673 |
; print(lat_ob_sort)
|
forrest@0
|
674 |
|
forrest@0
|
675 |
;*******************************************************************
|
forrest@0
|
676 |
; html table of site: observed
|
forrest@0
|
677 |
;*******************************************************************
|
forrest@0
|
678 |
output_html = "tseries_vs_ob.html"
|
forrest@0
|
679 |
|
forrest@0
|
680 |
header = (/"<HTML>" \
|
forrest@0
|
681 |
,"<HEAD>" \
|
forrest@0
|
682 |
,"<TITLE>CLAMP metrics</TITLE>" \
|
forrest@0
|
683 |
,"</HEAD>" \
|
forrest@0
|
684 |
,"<H1>Timeseries at Site: "+model_name+" vs Observation</H1>" \
|
forrest@0
|
685 |
/)
|
forrest@0
|
686 |
footer = "</HTML>"
|
forrest@0
|
687 |
|
forrest@0
|
688 |
table_header = (/ \
|
forrest@0
|
689 |
"<table border=1 cellspacing=0 cellpadding=3 width=60%>" \
|
forrest@0
|
690 |
,"<tr>" \
|
forrest@0
|
691 |
," <th bgcolor=DDDDDD >Site Name</th>" \
|
forrest@0
|
692 |
," <th bgcolor=DDDDDD >Latitude</th>" \
|
forrest@0
|
693 |
," <th bgcolor=DDDDDD >Longitude</th>" \
|
forrest@0
|
694 |
," <th bgcolor=DDDDDD >Observed</th>" \
|
forrest@0
|
695 |
,"</tr>" \
|
forrest@0
|
696 |
/)
|
forrest@0
|
697 |
table_footer = "</table>"
|
forrest@0
|
698 |
row_header = "<tr>"
|
forrest@0
|
699 |
row_footer = "</tr>"
|
forrest@0
|
700 |
|
forrest@0
|
701 |
lines = new(50000,string)
|
forrest@0
|
702 |
nline = 0
|
forrest@0
|
703 |
|
forrest@0
|
704 |
set_line(lines,nline,header)
|
forrest@0
|
705 |
set_line(lines,nline,table_header)
|
forrest@0
|
706 |
;-----------------------------------------------
|
forrest@0
|
707 |
; row of table
|
forrest@0
|
708 |
|
forrest@0
|
709 |
do n = 0,nstation_long-1
|
forrest@0
|
710 |
|
forrest@0
|
711 |
set_line(lines,nline,row_header)
|
forrest@0
|
712 |
|
forrest@0
|
713 |
txt0 = station_sort(n)
|
forrest@0
|
714 |
txt1 = sprintf("%5.2f", lat_ob_sort(n))
|
forrest@0
|
715 |
txt2 = sprintf("%5.2f", lon_ob_sort(n))
|
forrest@0
|
716 |
txt3 = year_ob_sort(n)
|
forrest@0
|
717 |
|
forrest@0
|
718 |
set_line(lines,nline,"<th><a href="+txt0+"_tseries_vs_ob.png>"+txt0+"</a></th>")
|
forrest@0
|
719 |
set_line(lines,nline,"<th>"+txt1+"</th>")
|
forrest@0
|
720 |
set_line(lines,nline,"<th>"+txt2+"</th>")
|
forrest@0
|
721 |
set_line(lines,nline,"<th>"+txt3+"</th>")
|
forrest@0
|
722 |
|
forrest@0
|
723 |
set_line(lines,nline,row_footer)
|
forrest@0
|
724 |
end do
|
forrest@0
|
725 |
;-----------------------------------------------
|
forrest@0
|
726 |
set_line(lines,nline,table_footer)
|
forrest@0
|
727 |
set_line(lines,nline,footer)
|
forrest@0
|
728 |
|
forrest@0
|
729 |
; Now write to an HTML file.
|
forrest@0
|
730 |
idx = ind(.not.ismissing(lines))
|
forrest@0
|
731 |
if(.not.any(ismissing(idx))) then
|
forrest@0
|
732 |
asciiwrite(output_html,lines(idx))
|
forrest@0
|
733 |
else
|
forrest@0
|
734 |
print ("error?")
|
forrest@0
|
735 |
end if
|
forrest@0
|
736 |
delete (idx)
|
forrest@0
|
737 |
|
forrest@0
|
738 |
;***************************************************************************
|
forrest@0
|
739 |
; output plots
|
forrest@0
|
740 |
;***************************************************************************
|
forrest@0
|
741 |
output_dir = model_name+"/ameriflux"
|
forrest@0
|
742 |
|
forrest@0
|
743 |
system("mv *.png *.html " + output_dir)
|
forrest@0
|
744 |
;***************************************************************************
|
forrest@0
|
745 |
end
|