source: trunk/src/paper01/fig7/sst_validation_scatter_2000_2009_basin.pro @ 46

Last change on this file since 46 was 46, checked in by pinsard, 13 years ago

going on consolidation of paper01 materials

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