1 | pro q2m_correction_ncdf |
---|
2 | @common |
---|
3 | ;---------------------------------------------------------------------- |
---|
4 | da1=19880101 & da2=20101231 |
---|
5 | |
---|
6 | file='/Volumes/PRAVEEN/TropFlux/input_uncor/erai_q2m_19890101_20091231_oafluxgrid.nc' |
---|
7 | initncdf, file |
---|
8 | q2m=read_ncdf('q2m',da1,da2,file=file,/nostr) |
---|
9 | help, q2m |
---|
10 | |
---|
11 | q2m_mean=grossemoyenne(q2m,'t',/nan) |
---|
12 | help, q2m_mean |
---|
13 | ;---------------------------------------------------------------------- |
---|
14 | |
---|
15 | tt=time & jpt=n_elements(time) |
---|
16 | caldat, time,mon,day,yea |
---|
17 | q2m_m=q2m*0. |
---|
18 | |
---|
19 | for jt=0,jpt-1 do begin |
---|
20 | jtt=(time(jt)-julday(1,1,yea(jt))) < 364 |
---|
21 | q=reform(q2m_mean(*,*)) |
---|
22 | q2m_m(*,*,jt)=q |
---|
23 | endfor |
---|
24 | help, q2m_m |
---|
25 | |
---|
26 | q2m_ano=q2m-q2m_m |
---|
27 | |
---|
28 | ;; correction for mean based on scatter |
---|
29 | ;q2m_m=q2m_m+0.815445 ;; (2000-2008) |
---|
30 | q2m_m=q2m_m+0.792717 ;; (2000-2009) |
---|
31 | help, q2m_ano |
---|
32 | |
---|
33 | ;; applying the correction for varyability based on the scatter |
---|
34 | ;q2m_ano=q2m_ano*(1/0.919333) ;; (2000-2008) |
---|
35 | q2m_ano=q2m_ano*(1/0.924674) ;; (2000-2009) |
---|
36 | |
---|
37 | q2m_new=q2m_m+q2m_ano |
---|
38 | help, q2m_new |
---|
39 | |
---|
40 | ;---------------------------------------------------------------------- |
---|
41 | ;writing field |
---|
42 | lat=reform(gphit(0,0:jpj-1)) |
---|
43 | lon=reform(glamt(0:jpi-1,0)) |
---|
44 | time=timegen(7670, units='days', start=julday(1,1,1989,0)) & jpt=n_elements(time) |
---|
45 | |
---|
46 | cda0=string(jul2date(time(0)),format='(i8.8)') |
---|
47 | cda1=string(jul2date(time(jpt-1)),format='(i8.8)') |
---|
48 | |
---|
49 | time=time-julday(1,1,1950) & jpt=n_elements(time) |
---|
50 | |
---|
51 | ncfile='!/Volumes/PRAVEEN/TropFlux/input_cor/full_cor/TropFlux_q2m_19890101_20091231_v20.nc' |
---|
52 | lon_attr={units:'degrees_east',long_name:'Longitude'} |
---|
53 | lat_attr={units:'degrees_north',long_name:'Latitude'} |
---|
54 | time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:'1950-JAN-01 00:00:00'} |
---|
55 | q2m_attr={units:'g/kg',missing_value:1.e20,long_name:'Specific humidity at 2m height',short_name:'q2m',axis:'TYX'} |
---|
56 | globattr={source:'Basic data obtained from ERAI. Mean correction for bias and correction for variability are applied',timerange:cda0+' - '+cda1} |
---|
57 | |
---|
58 | |
---|
59 | ncfields = 'q2m[longitude,latitude,time]=q2m_new:q2m_attr; ' $ |
---|
60 | + 'longitude[]=lon:lon_attr; ' $ |
---|
61 | + 'latitude[]=lat:lat_attr; ' $ |
---|
62 | + 'time[*time]=time:time_attr ' $ |
---|
63 | + ' @ globattr' |
---|
64 | |
---|
65 | @ncdf_quickwrite |
---|
66 | |
---|
67 | end |
---|
68 | |
---|
69 | |
---|