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