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

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

replace TROPFLUX by PROJECT

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