source: trunk/src/paper01/fig3/sst_validation_scatter_2000_2009_v50.pro @ 182

Last change on this file since 182 was 182, checked in by pinsard, 12 years ago

fix some svn propset

  • Property svn:executable set to *
  • Property svn:keywords set to Id URL
File size: 15.0 KB
Line 
1;+
2; .. _sst_validation_scatter_2000_2009_v50.pro:
3;
4; ========================================
5; sst_validation_scatter_2000_2009_v50.pro
6; ========================================
7;
8; DESCRIPTION
9; ===========
10;
11; .. graphviz::
12;
13;    digraph sst_validation_scatter_2000_2009_v50 {
14;
15;       sst_erai [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/sst_2000_2009_erai_v50.txt"];
16;       sst_tropflux [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/sst_2000_2009_trop_v50.txt"];
17;       sst_oaflux [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/sst_2000_2009_oaflx_v50.txt"];
18;       sst_tmi [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/sst_2000_2009_tmi_v50.txt"];
19;       sst_ncep [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/sst_2000_2009_ncep_v50.txt"];
20;       sst_ncep1 [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/sst_2000_2009_ncep1_v50.txt"];
21;       sst_erai_oafluxgrid [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/erai_sst_19890101_20091231_oafluxgrid.nc"];
22;       sst_tropflux_2 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/TropFlux_sst_19890101_20091231_v20.nc"];
23;       oaflux_basic [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/OAFlux_basic_variables_1985_2009.nc"];
24;       sst_ncep2 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/sst_NCEP2_global_monthly_1989_2009.nc"];
25;       sst_tmi_2 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/tmi_OI_oafluxgrid_30N30S.nc"];
26;       sst_ncep1_2 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/sst_ncep1_19890101_20091231.nc"];
27;
28;       figure [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/WHOTS_validation_net_2004_2007_all_v10.ps"];
29;
30;       sst_validation_scatter_2000_2009_v50 [shape=box,
31;       fontname=Courier,
32;       color=blue,
33;       URL="http://forge.ipsl.jussieu.fr/tropflux/broswrer/trunk/src/paper01/fig3/sst_validation_scatter_2000_2009_v50.pro",
34;       label="${TROPFLUX}/src/paper01/fig3/sst_validation_scatter_2000_2009_v50.pro"];
35;
36;       {sst_erai sst_erai_oafluxgrid sst_tropflux_2 oaflux_basic sst_ncep2 sst_tmi_2 sst_ncep1_2} -> {sst_validation_scatter_2000_2009_v50} -> {sst_tropflux sst_oaflux sst_tmi sst_ncep sst_ncep figure}
37;    }
38;
39; SEE ALSO
40; ========
41;
42; :ref:`project_profile.sh`
43; :ref:`project_init.pro`
44; :ref:`cm_project.pro`
45;
46; :func:`x_site_location`
47; :func:`y_site_location`
48;
49; :ref:`read_variables_v2.pro`
50; :ref:`statistics_3var_v1.pro`
51;
52; EXAMPLES
53; ========
54;
55; ::
56;
57;  date1 = 19890101L
58;  date2 = 20091231L
59;  sst_validation_scatter_2000_2009_v50, date1, date2
60;
61; TODO
62; ====
63;
64; make it work on cratos : missing data
65;
66; ++ mooring data in graphviz
67;
68; coding rules
69;
70; complete description
71;
72; handle IO error
73;
74; EVOLUTIONS
75; ==========
76;
77; $Id$
78;
79; $URL$
80;
81; - fplod 20110420T131533Z aedon.locean-ipsl.upmc.fr (Darwin)
82;
83;   * remove hard coding path
84;   * add graphviz
85;   * externalize functions
86;
87; - fplod 20110411T142955Z aedon.locean-ipsl.upmc.fr (Darwin)
88;
89;   * minimal header
90;
91;-
92pro sst_validation_scatter_2000_2009_v50, date1, date2
93@cm_general
94@cm_project
95reinitplt, /z,/invert
96key_portrait = 1
97;
98openps, FILENAME = project_od_env+'sst_validation_scatter_2000_2009_v50.ps'
99;
100; Give the location of mooring for validation of basic meteorological variables
101;
102sitelist=['8s67e','12s55e', '8s55e', '8s80.5e', '1.5s80.5e', '0n80.5e', '1.5n80.5e', '1.5s90e', $
103           '0n90e', '1.5n90e', '4n90e','8n90e','12n90e', '15n90e', '5s95e', $
104           '8s165e', '8s180w',  '8s155w', '8s125w', '8s110w', '8s95w',  '5s156e', '5s165e', '5s180w', '5s170w', $
105          '5s155w', '5s140w', '5s125w', '5s110w', '5s95w', '2s156e', '2s165e', '2s180w', '2s170w', '2s155w', '2s140w', $
106          '2s125w', '2s110w', '2s95w', '0n147e', '0n156e', '0n165e', '0n180w', '0n170w', '0n155w', '0n140w', '0n125w', $
107          '0n110w', '0n95w', '2n147e', '2n156e', '2n165e', '2n180w', '2n170w', '2n155w', '2n140w', '2n125w', '2n110w', $
108          '2n95w', '5n147e', '5n156e', '5n165e', '5n170w', '5n155w', '5n140w', '5n125w', '5n110w', '5n95w', $
109          '8n156e', '8n165e', '8n180w', '8n170w', '9n140w', '8n125w', '8n110w', '8n95w', $
110          '0n0e', '0n10w', '0n23w', '0n35w', '10s10w', '12n23w', '12n38w', '14s32w', '15n38w', '19s34w', '20n38w', $
111          '21n23w', '4n23w', '4n38w', '6s10w', '8n38w', '8s30w']
112;
113ocean='global'
114;
115nsmooth=1.    ; statistics are with 7 day smoothed
116;   This program will create the following text files with statistics of respective variables
117close,/all
118;
119fi_sst_erai=project_id_env+'sst_2000_2009_erai_v50.txt'
120openw,1,fi_sst_erai
121fi_sst_trop=project_id_env+'sst_2000_2009_trop_v50.txt'
122openw,2,fi_sst_trop
123fi_sst_oaflx=project_id_env+'sst_2000_2009_oaflx_v50.txt'
124openw,3,fi_sst_oaflx
125fi_sst_ncep=project_id_env+'sst_2000_2009_ncep_v50.txt'
126openw,4,fi_sst_ncep
127fi_sst_tmi=project_id_env+'sst_2000_2009_tmi_v50.txt'
128openw,5,fi_sst_tmi
129fi_sst_ncep1=project_id_env+'sst_2000_2009_ncep1_v50.txt'
130openw,6,fi_sst_ncep1
131;
132printf,1, 'x     y      cor    bias     std     rmsd      mean_tao'
133printf,2, 'x     y      cor    bias     std     rmsd      mean_tao'
134printf,3, 'x     y      cor    bias     std     rmsd      mean_tao'
135printf,4, 'x     y      cor    bias     std     rmsd      mean_tao'
136printf,5, 'x     y      cor    bias     std     rmsd      mean_tao'
137printf,6, 'x     y      cor    bias     std     rmsd      mean_tao'
138;
139; first reading the whole ERAI uncorrected and corrected data
140;
141file=project_id_env+'erai_sst_19890101_20091231_oafluxgrid.nc'
142initncdf, file
143unc=read_ncdf('sst',date1,date2,file=file,/nostr)
144unc=unc-273.15
145help, unc
146;
147file=project_id_env+'TropFlux_sst_19890101_20091231_v20.nc'
148initncdf, file
149cor=read_ncdf('sst',date1,date2,file=file,/nostr)
150cor=cor-273.15
151help, cor
152;
153file=project_id_env+'OAFlux_basic_variables_1985_2009.nc'
154initncdf, file
155oaf=read_ncdf("sst", date1, date2, file=file,/nostr)
156help, oaf
157;
158fi=project_id_env+'sst_ncep2_oafluxgrid_19890101_20091231.nc'
159initncdf, fi
160nce=read_ncdf("sst", date1-1, date2, file=fi,/nostr)
161nce=nce-273.15
162help, nce
163;
164fi=project_id_env+'tmi_OI_oafluxgrid_30N30S.nc'
165initncdf, fi
166sst_tmi=read_ncdf("sst", date1, date2, file=fi,/nostr)
167help, sst_tmi
168;
169file=project_id_env+'sst_ncep1_19890101_20091231.nc'
170initncdf, file
171nce1=read_ncdf("sst", date1, date2, file=file,/nostr)
172nce1=nce1-273.15
173help, nce1
174;
175nn=n_elements(sitelist)
176for n=0, nn-1 do begin
177;
178; reading data from mooring
179;
180    site=sitelist(n)
181    csite=site
182    print, csite
183    x=x_site_location(site)
184    y=y_site_location(site)
185    if (y ge 0. and y le 30.) then y=y+360.
186    dx=0.5
187    dy=0.5
188    box=[y-dy, y+dy, x-dx, x+dx]
189    read_variables_v2, csite,date1,date2,nsmooth, $
190         at, sw,rh,sst,wu,wv,ws,lh
191;
192    ind=where(finite(sst))
193    valid=n_elements(ind)
194;
195    if (valid ge 180) then begin
196;
197      ;  extracting the corrected and uncorrected ERAI data at the locations
198      nsmooth=1.
199;
200      extract_flux_tropflux,unc,box, $
201        tropflux
202      uncr=tropflux
203;
204      extract_flux_tropflux,cor,box, $
205        tropflux
206      corr=tropflux
207;
208      extract_flux_tropflux,oaf,box, $
209        tropflux
210      oafl=tropflux
211;
212      extract_flux_tropflux,nce,box, $
213        tropflux
214      ncep=tropflux
215;
216      extract_flux_tropflux,sst_tmi,box, $
217        tropflux
218      tmi=tropflux
219;
220      extract_flux_tropflux,nce1,box, $
221        tropflux
222      ncep1=tropflux
223;
224      ind=where(finite(sst))
225      sst=sst(ind)
226      uncr_sst=uncr(ind)
227      corr_sst=corr(ind)
228      oafl=oafl(ind)
229      ncep=ncep(ind)
230      tmi=tmi(ind)
231      ncep1=ncep1(ind)
232      mean_tao=total(sst,/nan)/n_elements(ind)
233;
234      statistics_3var_v1, sst, uncr_sst, corr_sst, $
235         cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
236;
237      printf, 1, x, y, cor1, bias1, std1, rmsd1, mean_tao, format='(f6.2, 3x, f6.2, 3x, f5.2,3x,f5.2,3x,f4.2,3x,f4.2,3x,f6.2)'
238      printf, 2, x, y, cor2, bias2, std2, rmsd2, mean_tao, format='(f6.2, 3x, f6.2, 3x, f5.2,3x,f5.2,3x,f4.2,3x,f4.2,3x,f6.2)'
239;
240      statistics_3var_v1, sst, oafl, ncep, $
241         cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
242      printf, 3, x, y, cor1, bias1, std1, rmsd1, mean_tao, format='(f6.2, 3x, f6.2, 3x, f5.2,3x,f5.2,3x,f4.2,3x,f4.2,3x,f6.2)'
243      printf, 4, x, y, cor2, bias2, std2, rmsd2, mean_tao, format='(f6.2, 3x, f6.2, 3x, f5.2,3x,f6.2,3x,f4.2,3x,f4.2,3x,f6.2)'
244;
245      statistics_3var_v1, sst, tmi, ncep1, $
246         cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
247      printf, 5, x, y, cor1, bias1, std1, rmsd1, mean_tao, format='(f6.2, 3x, f6.2, 3x, f5.2,3x,f5.2,3x,f4.2,3x,f4.2,3x,f6.2)'
248      printf, 6, x, y, cor2, bias2, std2, rmsd2, mean_tao, format='(f6.2, 3x, f6.2, 3x, f5.2,3x,f5.2,3x,f4.2,3x,f4.2,3x,f6.2)'
249;
250  endif
251;
252endfor
253close,/all
254;
255fi_sst_erai=project_id_env+'sst_2000_2009_v50_erai.txt'
256res=read_ascii(fi_sst_erai,data_start=1)
257ff=res.field1
258lat=reform(ff(0,*))
259lon=reform(ff(1,*))
260cor_era=reform(ff(2,*))
261cor_erai=total(cor_era)/n_elements(cor_era)
262bias_era=reform(ff(3,*))
263bias_erai=total(bias_era)/n_elements(bias_era)
264std_era=reform(ff(4,*))
265std_erai=total(std_era)/n_elements(std_era)
266rmsd_era=reform(ff(5,*))
267rmsd_erai=total(rmsd_era)/n_elements(rmsd_era)
268mean_tao=reform(ff(6,*))
269mean_erai=bias_era+mean_tao
270;
271print, ''
272print, 'ERAI'
273print, cor_erai, bias_erai, std_erai, rmsd_erai
274cstat=string(cor_erai, bias_erai, std_erai, rmsd_erai, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
275splot, mean_tao, mean_erai, title='SST - TAO Vs ERAI', subtitle='', $
276     charsize=1.1, xtitle='TAO SST', ytitle='ERAI SST', small=[2,3,1], psym=2, $
277     xrange=[22,31], yrange=[22,31], xmin=1,ymin=1
278xyouts, 22.3,30.2, cstat, charsize=0.9
279xyouts, 22.3,29.5, 'cor   bias   std   rmsd', charsize=0.9
280;
281oplot, [22,31], [22,31]
282ab=linfit(mean_tao, mean_erai,yfit=yfit)
283a=float(ab(0))
284b=float(ab(1))
285oplot, mean_tao, yfit, color=250, thick=2
286;
287fi_sst_trop=project_id_env+'sst_2000_2009_v50_trop.txt'
288res=read_ascii(fi_sst_trop,data_start=1)
289ff=res.field1
290lat=reform(ff(0,*))
291lon=reform(ff(1,*))
292cor_tro=reform(ff(2,*))
293cor_trop=total(cor_tro)/n_elements(cor_tro)
294bias_tro=reform(ff(3,*))
295bias_trop=total(bias_tro)/n_elements(bias_tro)
296std_tro=reform(ff(4,*))
297std_trop=total(std_tro)/n_elements(std_tro)
298rmsd_tro=reform(ff(5,*))
299rmsd_trop=total(rmsd_tro)/n_elements(rmsd_tro)
300mean_tao=reform(ff(6,*))
301mean_trop=bias_tro+mean_tao
302;
303print, ''
304print, 'TropFlux'
305print, cor_trop, bias_trop, std_trop, rmsd_trop
306cstat=string(cor_trop, bias_trop, std_trop, rmsd_trop, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
307;
308splot, mean_tao, mean_trop, title='SST - TAO Vs TropFlux', subtitle='', $
309     charsize=1.1, xtitle='TAO SST', ytitle='TropFlux SST', small=[2,3,2],/noer, psym=2, $
310     xrange=[22,31], yrange=[22,31], xmin=1,ymin=1
311oplot, [22,31], [22,31]
312xyouts, 22.3,30.2, cstat, charsize=0.9
313xyouts, 22.3,29.5, 'cor   bias   std   rmsd', charsize=0.9
314;
315ab=linfit(mean_tao, mean_trop,yfit=yfit)
316a=float(ab(0))
317b=float(ab(1))
318oplot, mean_tao, yfit, color=250, thick=2
319;
320fi_sst_oaflx=project_id_env+'sst_2000_2009_v50_oaflx.txt'
321res=read_ascii(fi_sst_oaflx,data_start=1)
322ff=res.field1
323lat=reform(ff(0,*))
324lon=reform(ff(1,*))
325cor_oaf=reform(ff(2,*))
326cor_oafl=total(cor_oaf)/n_elements(cor_oaf)
327bias_oaf=reform(ff(3,*))
328bias_oafl=total(bias_oaf)/n_elements(bias_oaf)
329std_oaf=reform(ff(4,*))
330std_oafl=total(std_oaf)/n_elements(std_oaf)
331rmsd_oaf=reform(ff(5,*))
332rmsd_oafl=total(rmsd_oaf)/n_elements(rmsd_oaf)
333mean_tao=reform(ff(6,*))
334mean_oafl=bias_oaf+mean_tao
335;
336print, ''
337print, 'OAFlux'
338print, cor_oafl, bias_oafl, std_oafl, rmsd_oafl
339cstat=string(cor_oafl, bias_oafl, std_oafl, rmsd_oafl, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
340;
341splot, mean_tao, mean_oafl, title='SST - TAO Vs OAFlux', subtitle='', $
342     charsize=1.1, xtitle='TAO SST', ytitle='OAFlux SST', small=[2,3,3],/noer, psym=2, $
343     xrange=[22,31], yrange=[22,31], xmin=1,ymin=1
344oplot, [22,31], [22,31]
345xyouts, 22.3,30.2, cstat, charsize=0.9
346xyouts, 22.3,29.5, 'cor   bias   std   rmsd', charsize=0.9
347;
348ab=linfit(mean_tao, mean_oafl,yfit=yfit)
349a=float(ab(0))
350b=float(ab(1))
351oplot, mean_tao, yfit, color=250, thick=2
352;
353fi_sst_ncep=project_id_env+'sst_2000_2009_v50_ncep.txt'
354res=read_ascii(fi_sst_ncep,data_start=1)
355ff=res.field1
356lat=reform(ff(0,*))
357lon=reform(ff(1,*))
358cor_nce=reform(ff(2,*))
359cor_ncep=total(cor_nce)/n_elements(cor_nce)
360bias_nce=reform(ff(3,*))
361bias_ncep=total(bias_nce)/n_elements(bias_nce)
362std_nce=reform(ff(4,*))
363std_ncep=total(std_nce)/n_elements(std_nce)
364rmsd_nce=reform(ff(5,*))
365rmsd_ncep=total(rmsd_nce)/n_elements(rmsd_nce)
366mean_tao=reform(ff(6,*))
367mean_ncep=bias_nce+mean_tao
368;
369print, ''
370print, 'NCEP2'
371print, cor_ncep, bias_ncep, std_ncep, rmsd_ncep
372cstat=string(cor_ncep, bias_ncep, std_ncep, rmsd_ncep, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
373;
374splot, mean_tao, mean_ncep, title='SST - TAO Vs NCEP2', subtitle='', $
375     charsize=1.1, xtitle='TAO SST', ytitle='NCEP2 SST', small=[2,3,4],/noer, psym=2, $
376     xrange=[22,31], yrange=[22,31], xmin=1,ymin=1
377oplot, [22,31], [22,31]
378xyouts, 22.3,30.2, cstat, charsize=0.9
379xyouts, 22.3,29.5, 'cor   bias   std   rmsd', charsize=0.9
380;
381ab=linfit(mean_tao, mean_ncep,yfit=yfit)
382a=float(ab(0))
383b=float(ab(1))
384oplot, mean_tao, yfit, color=250, thick=2
385;
386fi_sst_tmi=project_id_env+'sst_2000_2009_v50_tmi.txt'
387res=read_ascii(fi_sst_tmi,data_start=1)
388ff=res.field1
389lat=reform(ff(0,*))
390lon=reform(ff(1,*))
391cor_tm=reform(ff(2,*))
392cor_tmi=total(cor_tm)/n_elements(cor_tm)
393bias_tm=reform(ff(3,*))
394bias_tmi=total(bias_tm)/n_elements(bias_tm)
395std_tm=reform(ff(4,*))
396std_tmi=total(std_tm)/n_elements(std_tm)
397rmsd_tm=reform(ff(5,*))
398rmsd_tmi=total(rmsd_tm)/n_elements(rmsd_tm)
399mean_tao=reform(ff(6,*))
400mean_tmi=bias_tm+mean_tao
401;
402print, ''
403print, 'TMI'
404print, cor_tmi, bias_tmi, std_tmi, rmsd_tmi
405cstat=string(cor_tmi, bias_tmi, std_tmi, rmsd_tmi, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
406;
407splot, mean_tao, mean_tmi, title='SST - TAO Vs TMI', subtitle='', $
408     charsize=1.1, xtitle='TAO SST', ytitle='TMI SST', small=[2,3,5],/noer, psym=2, $
409     xrange=[22,31], yrange=[22,31], xmin=1,ymin=1
410oplot, [22,31], [22,31]
411xyouts, 22.3,30.2, cstat, charsize=0.9
412xyouts, 22.3,29.5, 'cor   bias   std   rmsd', charsize=0.9
413;
414ab=linfit(mean_tao, mean_tmi,yfit=yfit)
415a=float(ab(0))
416b=float(ab(1))
417oplot, mean_tao, yfit, color=250, thick=2
418;
419fi_sst_ncep1=project_id_env+'sst_2000_2009_v50_ncep1.txt'
420res=read_ascii(fi_sst_ncep1,data_start=1)
421ff=res.field1
422lat=reform(ff(0,*))
423lon=reform(ff(1,*))
424cor_nce=reform(ff(2,*))
425cor_ncep=total(cor_nce)/n_elements(cor_nce)
426bias_nce=reform(ff(3,*))
427bias_ncep=total(bias_nce)/n_elements(bias_nce)
428std_nce=reform(ff(4,*))
429std_ncep=total(std_nce)/n_elements(std_nce)
430rmsd_nce=reform(ff(5,*))
431rmsd_ncep=total(rmsd_nce)/n_elements(rmsd_nce)
432mean_tao=reform(ff(6,*))
433mean_ncep=bias_nce+mean_tao
434;
435print, ''
436print, 'NCEP1'
437print, cor_ncep, bias_ncep, std_ncep, rmsd_ncep
438cstat=string(cor_ncep, bias_ncep, std_ncep, rmsd_ncep, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
439;
440splot, mean_tao, mean_ncep, title='SST - TAO Vs NCEP_NCAR', subtitle='', $
441     charsize=1.1, xtitle='TAO SST', ytitle='NCEP SST', small=[2,3,6],/noer, psym=2, $
442     xrange=[22,31], yrange=[22,31], xmin=1,ymin=1
443oplot, [22,31], [22,31]
444xyouts, 22.3,30.2, cstat, charsize=0.9
445xyouts, 22.3,29.5, 'cor   bias   std   rmsd', charsize=0.9
446;
447ab=linfit(mean_tao, mean_ncep,yfit=yfit)
448a=float(ab(0))
449b=float(ab(1))
450oplot, mean_tao, yfit, color=250, thick=2
451;
452closeps
453;
454end
Note: See TracBrowser for help on using the repository browser.