1 | ;+ |
---|
2 | ; |
---|
3 | ; .. _q2m_correction_ncdf.pro: |
---|
4 | ; |
---|
5 | ; ======================= |
---|
6 | ; q2m_correction_ncdf.pro |
---|
7 | ; ======================= |
---|
8 | ; |
---|
9 | ; .. only:: man |
---|
10 | ; |
---|
11 | ; Figure is visible on PDF and HTML documents only. |
---|
12 | ; |
---|
13 | ; .. only:: html |
---|
14 | ; |
---|
15 | ; .. graphviz:: |
---|
16 | ; |
---|
17 | ; digraph q2m_correction_ncdf { |
---|
18 | ; graph [ |
---|
19 | ; rankdir="LR", |
---|
20 | ; ] |
---|
21 | ; |
---|
22 | ; file_in [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/TropFlux/input_uncor/erai_q2m_19890101_20091231_oafluxgrid.nc"]; |
---|
23 | ; |
---|
24 | ; ncfile [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/TropFlux/input_cor/full_cor/TropFlux_q2m_19890101_20091231_v20.nc"]; |
---|
25 | ; |
---|
26 | ; q2m_correction_ncdf [shape=box, |
---|
27 | ; fontname=Courier, |
---|
28 | ; color=blue, |
---|
29 | ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/q2m_correction_ncdf.pro", |
---|
30 | ; label="${TROPFLUX}/src/q2m_correction_ncdf.pro"]; |
---|
31 | ; |
---|
32 | ; {file_in} -> {q2m_correction_ncdf} -> {ncfile} |
---|
33 | ; |
---|
34 | ; } |
---|
35 | ; |
---|
36 | ; SEE ALSO |
---|
37 | ; ======== |
---|
38 | ; |
---|
39 | ; EXAMPLES |
---|
40 | ; ======== |
---|
41 | ; |
---|
42 | ; :: |
---|
43 | ; |
---|
44 | ; IDL> q2m_correction_ncdf |
---|
45 | ; |
---|
46 | ; TODO |
---|
47 | ; ==== |
---|
48 | ; |
---|
49 | ; hard coded directory - usage of ${TROPFLUX_ID} |
---|
50 | ; |
---|
51 | ; coding rules |
---|
52 | ; |
---|
53 | ; EVOLUTIONS |
---|
54 | ; ========== |
---|
55 | ; |
---|
56 | ; - fplod 20101215T113945Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
57 | ; |
---|
58 | ; * add graph in header |
---|
59 | ; |
---|
60 | ; - fplod 20101214T093615Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
61 | ; |
---|
62 | ; * minimal header |
---|
63 | ; |
---|
64 | ; - pbk 2008 |
---|
65 | ; |
---|
66 | ; * creation |
---|
67 | ; |
---|
68 | ;- |
---|
69 | pro q2m_correction_ncdf |
---|
70 | @common |
---|
71 | da1=19880101 & da2=20101231 |
---|
72 | |
---|
73 | file='/Volumes/PRAVEEN/TropFlux/input_uncor/erai_q2m_19890101_20091231_oafluxgrid.nc' |
---|
74 | initncdf, file |
---|
75 | q2m=read_ncdf('q2m',da1,da2,file=file,/nostr) |
---|
76 | help, q2m |
---|
77 | |
---|
78 | q2m_mean=grossemoyenne(q2m,'t',/nan) |
---|
79 | help, q2m_mean |
---|
80 | |
---|
81 | tt=time & jpt=n_elements(time) |
---|
82 | caldat, time,mon,day,yea |
---|
83 | q2m_m=q2m*0. |
---|
84 | |
---|
85 | for jt=0,jpt-1 do begin |
---|
86 | jtt=(time(jt)-julday(1,1,yea(jt))) < 364 |
---|
87 | q=reform(q2m_mean(*,*)) |
---|
88 | q2m_m(*,*,jt)=q |
---|
89 | endfor |
---|
90 | help, q2m_m |
---|
91 | |
---|
92 | q2m_ano=q2m-q2m_m |
---|
93 | |
---|
94 | ;; correction for mean based on scatter |
---|
95 | ;q2m_m=q2m_m+0.815445 ;; (2000-2008) |
---|
96 | q2m_m=q2m_m+0.792717 ;; (2000-2009) |
---|
97 | help, q2m_ano |
---|
98 | |
---|
99 | ;; applying the correction for variability based on the scatter |
---|
100 | ;q2m_ano=q2m_ano*(1/0.919333) ;; (2000-2008) |
---|
101 | q2m_ano=q2m_ano*(1/0.924674) ;; (2000-2009) |
---|
102 | |
---|
103 | q2m_new=q2m_m+q2m_ano |
---|
104 | help, q2m_new |
---|
105 | |
---|
106 | ;writing field |
---|
107 | lat=reform(gphit(0,0:jpj-1)) |
---|
108 | lon=reform(glamt(0:jpi-1,0)) |
---|
109 | time=timegen(7670, units='days', start=julday(1,1,1989,0)) & jpt=n_elements(time) |
---|
110 | |
---|
111 | cda0=string(jul2date(time(0)),format='(i8.8)') |
---|
112 | cda1=string(jul2date(time(jpt-1)),format='(i8.8)') |
---|
113 | |
---|
114 | time=time-julday(1,1,1950) & jpt=n_elements(time) |
---|
115 | |
---|
116 | ncfile='!/Volumes/PRAVEEN/TropFlux/input_cor/full_cor/TropFlux_q2m_19890101_20091231_v20.nc' |
---|
117 | lon_attr={units:'degrees_east',long_name:'Longitude'} |
---|
118 | lat_attr={units:'degrees_north',long_name:'Latitude'} |
---|
119 | time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:'1950-JAN-01 00:00:00'} |
---|
120 | q2m_attr={units:'g/kg',missing_value:1.e20,long_name:'Specific humidity at 2m height',short_name:'q2m',axis:'TYX'} |
---|
121 | globattr={source:'Basic data obtained from ERAI. Mean correction for bias and correction for variability are applied',timerange:cda0+' - '+cda1} |
---|
122 | |
---|
123 | |
---|
124 | ncfields = 'q2m[longitude,latitude,time]=q2m_new:q2m_attr; ' $ |
---|
125 | + 'longitude[]=lon:lon_attr; ' $ |
---|
126 | + 'latitude[]=lat:lat_attr; ' $ |
---|
127 | + 'time[*time]=time:time_attr ' $ |
---|
128 | + ' @ globattr' |
---|
129 | |
---|
130 | @ncdf_quickwrite |
---|
131 | |
---|
132 | end |
---|