source: trunk/src/ws_correction_ncdf.pro @ 8

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

add some graph - io - in headers

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