source: trunk/src/lwr_correction_ncdf.pro @ 6

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

minimal header in .pro

File size: 2.5 KB
Line 
1;+
2;
3; .. _lwr_correction_ncdf.pro:
4;
5; =======================
6; lwr_correction_ncdf.pro
7; =======================
8;
9; SEE ALSO
10; ========
11;
12; EXAMPLES
13; ========
14;
15; ::
16;
17;  IDL> lwr_correction_ncdf
18;
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 lwr_correction_ncdf
40@common
41;----------------------------------------------------------------------
42da1=19880101 & da2=20091231
43
44file='/Volumes/PRAVEEN/TropFlux/input_uncor/erai_lwr_19890102_20091231_oafluxgrid.nc'
45initncdf, file
46lwr=read_ncdf('lwr',da1,da2,file=file,/nostr)
47help, lwr
48
49lwr_mean=grossemoyenne(lwr,'t',/nan)
50help,lwr_mean
51;----------------------------------------------------------------------
52
53tt=time & jpt=n_elements(time)
54caldat, time,mon,day,yea
55lwr_m=lwr*0.
56
57for jt=0,jpt-1 do begin
58  jtt=(time(jt)-julday(1,1,yea(jt))) < 364
59  t=reform(lwr_mean(*,*))
60  lwr_m(*,*,jt)=t
61endfor
62help, lwr_m
63
64lwr_ano=lwr-lwr_m
65
66;; correction for mean based on scatter
67lwr_m=lwr_m+4.61667
68
69help, lwr_ano
70
71;; applying the correction for varyability based on the scatter
72lwr_ano=lwr_ano*(1/0.760667)
73
74;; applying the correction for varyability based on the scatter
75
76lwr_new=lwr_m+lwr_ano
77help, lwr_new
78
79;----------------------------------------------------------------------
80;writing field
81lat=reform(gphit(0,0:jpj-1))
82lon=reform(glamt(0:jpi-1,0))
83time=timegen(7669, units='days', start=julday(1,2,1989)) & 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_lwr_19890101_20091231_v1.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'}
94lwr_attr={units:'degK',missing_value:1.e20,long_name:'Air Temperature at 2m',short_name:'lwr',axis:'TYX'}
95globattr={source:'Basic data obtained from ERAI.  Mean correction for  bias and correction for variability are applied',timerange:cda0+' - '+cda1}
96
97
98ncfields = 'lwr[longitude,latitude,time]=lwr_new:lwr_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.