source: trunk/src/paper01/fig6/icoads_q2m_stats_paper.pro

Last change on this file was 203, checked in by pinsard, 10 years ago

fix thanks to coding rules

  • Property svn:keywords set to Id URL
File size: 7.2 KB
Line 
1;+
2; .. _icoads_q2m_stats_paper.pro:
3;
4; ==========================
5; icoads_q2m_stats_paper.pro
6; ==========================
7;
8; DESCRIPTION
9; ===========
10;
11; .. graphviz::
12;
13;    digraph icoads_q2m_stats_paper {
14;
15;       sphum [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/sphum_monthly_1960_2010_oafluxgrid.nc"];
16;       q2m_tropflux [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/q2m_TropFlux_global_monthly_1989_2009.nc"];
17;       q2m_oaflux [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/q2m_OAFlux_global_monthly_1989_2009.nc"];
18;       q2m_erai [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/q2m_ERAI_global_monthly_1989_2009.nc"];
19;       q2m_ncep2 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/q2m_NCEP2_global_monthly_1989_2009.nc"];
20;       q2m_ncep1 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/q2m_NCEP1_global_monthly_1989_2009.nc"];
21;
22;       figure [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/icoads_q2m_stats_paper.ps"];
23;
24;       icoads_q2m_stats_paper [shape=box,
25;       fontname=Courier,
26;       color=blue,
27;       URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/paper01/fig6/icoads_q2m_stats_paper.pro",
28;       label="${TROPFLUX}/src/paper01/fig6/icoads_q2m_stats_paper.pro"];
29;
30;       {sphum q2m_tropflux q2m_oaflux q2m_erai q2m_ncep2 q2m_ncep1} -> {icoads_q2m_stats_paper} -> {figure}
31;    }
32;
33; SEE ALSO
34; ========
35;
36; :ref:`project_profile.sh`
37; :ref:`project_init.pro`
38;
39; :ref:`statistics.pro`
40;
41; EXAMPLES
42; ========
43;
44; .. code-block:: idl
45;
46;    icoads_q2m_stats_paper
47;
48; TODO
49; ====
50;
51; make it work (missing data, box definition)
52;
53; coding rules
54;
55; complete description
56;
57; handle IO error
58;
59; EVOLUTIONS
60; ==========
61;
62; $Id$
63;
64; $URL$
65;
66; - fplod 20110420T090949Z aedon.locean-ipsl.upmc.fr (Darwin)
67;
68;   * remove hard coding path
69;   * add graphviz
70;
71; - fplod 20110411T142955Z aedon.locean-ipsl.upmc.fr (Darwin)
72;
73;   * minimal header
74;
75;-
76pro icoads_q2m_stats_paper
77@cm_general
78@cm_project
79reinitplt, /z,/invert
80key_portrait = 1
81coefpalit=.9
82;
83openps, FILENAME = project_od_env+"icoads_q2m_stats_paper.ps"
84; partie a changer
85marge=[-2,-2, -4,2]
86st=19890101
87en=20091231
88domdef, box
89;
90file=project_id_env+'sphum_monthly_1960_2010_oafluxgrid.nc'
91initncdf, file
92icoads=read_ncdf("sphum", st, en , file=file,/nostr, box=box)
93help, icoads
94;
95file=project_id_env+'q2m_TropFlux_global_monthly_1989_2009.nc'
96initncdf, file
97trop=read_ncdf("q2m", st, en , file=file,/nostr, box=box)
98help, trop
99;
100file=project_id_env+"q2m_OAFlux_global_monthly_1989_2009.nc"
101initncdf, file
102oaf=read_ncdf("q2m", st, en , file=file,/nostr, box=box)
103help, oaf
104;
105file=project_id_env+"q2m_ERAI_global_monthly_1989_2009.nc"
106initncdf, file
107erai=read_ncdf("q2m", st, en , file=file,/nostr, box=box)
108help, erai
109;
110file=project_id_env+"q2m_NCEP2_global_monthly_1989_2009.nc"
111initncdf, file
112ncep2=1000*read_ncdf("q2m", st, en , file=file,/nostr, box=box)
113help, ncep2
114;
115file=project_id_env+"q2m_NCEP1_global_monthly_1989_2009.nc"
116initncdf, file
117ncep1=1000*read_ncdf("q2m", st, en , file=file,/nostr, box=box)
118help, ncep1
119;
120si=size(trop)
121nt=si(3)
122;
123lat_rama=[67, 55, 55, 80.5, 80.5, 80.5, 80.5, 90, 90, 90, 90, 90, 90, 90, 95]
124lon_rama=[-8, -12, -8,-8, -1.5, 0, 1.5, -1.5, 0, 1.5, 4, 8, 12, 15, -5]
125;
126lat_pirata=[0, 350, 337, 325, 350, 337, 322, 328, 322, 326, 322, 337, 337, 322, 350, 322, 330]
127lon_pirata=[0, 0, 0, 0, -10, 12, 12, -14, 15, -19, 20, 21, 4, 4, -6, 8, -8]
128;
129lat_tao=[165, 180, 205, 235, 250, 265, 156, 165, 180, 190, 205, 220, 235, 250, 265, 156, 165, 180, 190, 205, 220, 235, 250, 265, 147, 156, $
130         165, 180, 190, 205, 220, 235, 250, 265, 147, 156, 165, 180, 190, 205, 220, 235, 250, 265, 147, 156, 165, 190, 205, 220, 235, 250, 265, $
131         156, 165, 180, 190, 220, 235, 250, 265]
132;
133lon_tao=[-8, -8, -8, -8, -8, -8, -5, -5, -5, -5, -5, -5, -5, -5, -5, -2, -2, -2, -2, -2, -2, -2, -2, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $
134          2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, 8, 8, 8, 9, 8, 8, 8]
135;
136lat=[lat_rama, lat_pirata, lat_tao]
137lon=[lon_rama, lon_pirata, lon_tao]
138;
139lat_tao=lat
140lon_tao=lon
141nn=n_elements(lat)
142;
143list=0
144for n=0, nn-1 do begin
145    x=lat_tao(n)
146    y=lon_tao(n)
147    dx=abs(reform(glamt-x))
148    dy=abs(reform(gphit)-y)
149    ind=where((dx le 0.5) and (dy le 0.5))
150    if (total(ind) ge 0.) then begin
151        list=[list,ind]
152    endif
153endfor
154;
155msk=replicate(1,nxt,nyt)
156msk(list)=!Values.f_nan
157;
158mask=trop*0
159for jt=0,jpt-1 do begin
160    t=reform(msk(*,*))
161    mask(*,*,jt)=t
162endfor
163;
164param=icoads*mask
165trop=trop*mask
166oaf=oaf*mask
167erai=erai*mask
168ncep2=ncep2*mask
169ncep1=ncep1*mask
170;
171ind=where(finite(param) and finite(erai) and finite(trop) and finite(oaf) and finite(ncep2) and finite(ncep1))
172x=param(ind)
173y=trop(ind)
174param=param(ind)
175trop=trop(ind)
176erai=erai(ind)
177oaf=oaf(ind)
178ncep2=ncep2(ind)
179ncep1=ncep1(ind)
180;
181statistics, param, trop, $
182cor, bias, std, rmsd
183print, cor, bias, std,  rmsd
184cstat_trop=string(cor, bias, std, rmsd, format='(f4.2,2x,f6.3,2x,f4.2,1x,f6.2)')
185abs_diff=total(abs(trop-param))/n_elements(trop)
186abs_trop=string(abs_diff, format='(f5.2)')
187;
188statistics, param, oaf, $
189cor, bias, std, rmsd
190print, cor, bias, std,  rmsd
191cstat_oaf=string(cor, bias, std, rmsd, format='(f4.2,2x,f6.3,2x,f4.2,1x,f6.2)')
192abs_diff=total(abs(oaf-param))/n_elements(oaf)
193abs_oaf=string(abs_diff, format='(f5.2)')
194;
195statistics, param, erai, $
196cor, bias, std, rmsd
197print, cor, bias, std,  rmsd
198cstat_erai=string(cor, bias, std, rmsd, format='(f4.2,2x,f6.3,2x,f4.2,1x,f6.2)')
199abs_diff=total(abs(erai-param))/n_elements(erai)
200abs_erai=string(abs_diff, format='(f5.2)')
201;
202statistics, param, ncep2, $
203cor, bias, std, rmsd
204print, cor, bias, std,  rmsd
205cstat_ncep2=string(cor, bias, std, rmsd, format='(f4.2,2x,f6.3,2x,f4.2,1x,f6.2)')
206abs_diff=total(abs(ncep2-param))/n_elements(ncep2)
207abs_ncep2=string(abs_diff, format='(f5.2)')
208;
209statistics, param, ncep1, $
210cor, bias, std, rmsd
211print, cor, bias, std,  rmsd
212cstat_ncep1=string(cor, bias, std, rmsd, format='(f4.2,2x,f6.3,2x,f4.2,1x,f6.2)')
213abs_diff=total(abs(ncep1-param))/n_elements(ncep1)
214abs_ncep1=string(abs_diff, format='(f5.2)')
215;
216mio=4
217mao=24
218inx=1
219nx=(mao-mio)/inx+1l
220xx=mio+indgen(nx)*inx
221mis=4
222mas=24
223iny=1
224ny=(mas-mis)/iny+1l
225yy=mis+indgen(ny)*iny
226;
227pdf, param,trop,mio,mao,inx,mis,mas,iny, $
228pdf,xx,yy
229scontour, pdf,xx,yy ,/noer, charsize=1, nlevels=30,/fill, $
230title="q2m - ICOADS/TropFlux", small=[2,3,1]
231xyouts, 10, 6, cstat_trop, charsize=1
232xyouts, 10, 4, abs_trop, charsize=1
233;
234pdf, param,oaf,mio,mao,inx,mis,mas,iny, $
235pdf,xx,yy
236scontour, pdf,xx,yy ,/noer, charsize=1, nlevels=30,/fill, $
237title="q2m - ICOADS/OAFlux", small=[2,3,2]
238xyouts, 10, 6, cstat_oaf, charsize=1
239xyouts, 10, 4, abs_oaf, charsize=1
240;
241pdf, param,erai,mio,mao,inx,mis,mas,iny, $
242pdf,xx,yy
243scontour, pdf,xx,yy ,/noer, charsize=1, nlevels=30,/fill, $
244title="q2m - ICOADS/ERAI", small=[2,3,3]
245xyouts, 10, 6, cstat_erai, charsize=1
246xyouts, 10, 4, abs_erai, charsize=1
247;
248pdf, param,ncep2,mio,mao,inx,mis,mas,iny, $
249pdf,xx,yy
250scontour, pdf,xx,yy ,/noer, charsize=1, nlevels=30,/fill, $
251title="q2m - ICOADS/NCEP2", small=[2,3,4]
252xyouts, 10, 6, cstat_ncep2, charsize=1
253xyouts, 10, 4, abs_ncep2, charsize=1
254;
255pdf, param,ncep1,mio,mao,inx,mis,mas,iny, $
256pdf,xx,yy
257scontour, pdf,xx,yy ,/noer, charsize=1, nlevels=30,/fill, $
258title="q2m - ICOADS/NCEP1", small=[2,3,5]
259xyouts, 10, 6, cstat_ncep1, charsize=1
260xyouts, 10, 4, abs_ncep1, charsize=1
261;
262closeps
263;
264return
265;
266end
Note: See TracBrowser for help on using the repository browser.