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