source: trunk/src/lwr_correction_ncdf.pro @ 5

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

first commit with original work of Praveen

File size: 2.1 KB
Line 
1pro lwr_correction_ncdf
2@common
3;----------------------------------------------------------------------
4da1=19880101 & da2=20091231
5
6file='/Volumes/PRAVEEN/TropFlux/input_uncor/erai_lwr_19890102_20091231_oafluxgrid.nc'
7initncdf, file
8lwr=read_ncdf('lwr',da1,da2,file=file,/nostr)
9help, lwr
10
11lwr_mean=grossemoyenne(lwr,'t',/nan)
12help,lwr_mean
13;----------------------------------------------------------------------
14
15tt=time & jpt=n_elements(time)
16caldat, time,mon,day,yea
17lwr_m=lwr*0.
18
19for jt=0,jpt-1 do begin
20  jtt=(time(jt)-julday(1,1,yea(jt))) < 364
21  t=reform(lwr_mean(*,*))
22  lwr_m(*,*,jt)=t
23endfor
24help, lwr_m
25
26lwr_ano=lwr-lwr_m
27
28;; correction for mean based on scatter
29lwr_m=lwr_m+4.61667
30
31help, lwr_ano
32
33;; applying the correction for varyability based on the scatter
34lwr_ano=lwr_ano*(1/0.760667)
35
36;; applying the correction for varyability based on the scatter
37
38lwr_new=lwr_m+lwr_ano
39help, lwr_new
40
41;----------------------------------------------------------------------
42;writing field
43lat=reform(gphit(0,0:jpj-1))
44lon=reform(glamt(0:jpi-1,0))
45time=timegen(7669, units='days', start=julday(1,2,1989)) & jpt=n_elements(time)
46
47cda0=string(jul2date(time(0)),format='(i8.8)')
48cda1=string(jul2date(time(jpt-1)),format='(i8.8)')
49
50time=time-julday(1,1,1950) & jpt=n_elements(time)
51
52ncfile='!/Volumes/PRAVEEN/TropFlux/input_cor/full_cor/TropFlux_lwr_19890101_20091231_v1.nc'
53lon_attr={units:'degrees_east',long_name:'Longitude'}
54lat_attr={units:'degrees_north',long_name:'Latitude'}
55time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:'1950-JAN-01 00:00:00'}
56lwr_attr={units:'degK',missing_value:1.e20,long_name:'Air Temperature at 2m',short_name:'lwr',axis:'TYX'}
57globattr={source:'Basic data obtained from ERAI.  Mean correction for  bias and correction for variability are applied',timerange:cda0+' - '+cda1}
58
59
60ncfields = 'lwr[longitude,latitude,time]=lwr_new:lwr_attr; ' $
61                      + 'longitude[]=lon:lon_attr; ' $
62                      + 'latitude[]=lat:lat_attr; ' $
63                      + 'time[*time]=time:time_attr ' $
64                      + ' @ globattr'
65
66@ncdf_quickwrite
67
68end
69
70
Note: See TracBrowser for help on using the repository browser.