source: trunk/src/ws_correction_ncdf.pro @ 11

Last change on this file since 11 was 9, checked in by pinsard, 14 years ago

add some graph - io - in headers (cont.)

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