1 | ;+ |
---|
2 | ; |
---|
3 | ; .. _swr_isccp_tropflux_new_v1.pro: |
---|
4 | ; |
---|
5 | ; ============================= |
---|
6 | ; swr_isccp_tropflux_new_v1.pro |
---|
7 | ; ============================= |
---|
8 | ; |
---|
9 | ; DESCRIPTION |
---|
10 | ; =========== |
---|
11 | ; |
---|
12 | ; SEE ALSO |
---|
13 | ; ======== |
---|
14 | ; |
---|
15 | ; :ref:`tropflux_profile.sh` |
---|
16 | ; |
---|
17 | ; EXAMPLES |
---|
18 | ; ======== |
---|
19 | ; |
---|
20 | ; :: |
---|
21 | ; |
---|
22 | ; IDL> @tropflux_init |
---|
23 | ; IDL> swr_isccp_tropflux_new_v1 |
---|
24 | ; |
---|
25 | ; EVOLUTIONS |
---|
26 | ; ========== |
---|
27 | ; |
---|
28 | ; $Id$ |
---|
29 | ; |
---|
30 | ; - fplod 20110411T142955Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
31 | ; |
---|
32 | ; * minimal header |
---|
33 | ; |
---|
34 | ;- |
---|
35 | pro swr_isccp_tropflux_new_v1 |
---|
36 | @common |
---|
37 | reinitplt, /z,/invert |
---|
38 | key_portrait = 1 |
---|
39 | |
---|
40 | openps, FILENAME = 'idl.ps' |
---|
41 | st=19890101 & en=20071231 |
---|
42 | |
---|
43 | file='/Volumes/Iomega_HDD/work/flux_reconstruction/OAFLX_GRID/swr_oafluxgrid_1985_2007.nc' |
---|
44 | initncdf, file |
---|
45 | sw_isccp=read_ncdf("swr", st, en, file=file,/nostr) |
---|
46 | |
---|
47 | file='/Volumes/Iomega_HDD/flux_reconstruction/basic_data/sw_reconstred_1989_2009.nc' |
---|
48 | initncdf, file |
---|
49 | sw_trop=read_ncdf("sw", st, en+1, file=file,/nostr) |
---|
50 | |
---|
51 | file='/Volumes/Iomega_HDD/flux_reconstruction/basic_data/olr_oafluxgrid_30n30s.nc' |
---|
52 | initncdf, file |
---|
53 | olr=read_ncdf("olr", st, en, file=file,/nostr) |
---|
54 | |
---|
55 | help, sw_isccp, sw_trop , olr |
---|
56 | |
---|
57 | ;;creating climatology |
---|
58 | |
---|
59 | ny=(2007-1989)+1 |
---|
60 | nt=365*ny |
---|
61 | |
---|
62 | olri=total(reform(olr(*,*,0:nt-1),nxt,nyt,365,ny),4)/ny |
---|
63 | swi=total(reform(sw_isccp(*,*,0:nt-1),nxt,nyt,365,ny),4)/ny |
---|
64 | help, olri, swi |
---|
65 | |
---|
66 | ;; applying smoothing |
---|
67 | nsmooth=45 |
---|
68 | |
---|
69 | swi=[[[swi]],[[swi]],[[swi]]] & olri=[[[olri]],[[olri]],[[olri]]] |
---|
70 | si=size(sw) & n1=si(1) & n2=si(2) |
---|
71 | |
---|
72 | for j=0,n2-1 do begin |
---|
73 | for i=0,n1-1 do begin |
---|
74 | x=reform(swi(i,j,*)) |
---|
75 | y=reform(olri(i,j,*)) |
---|
76 | swi(i,j,*)=smooth(x,nsmooth) |
---|
77 | olri(i,j,*)=smooth(y,nsmooth) |
---|
78 | endfor |
---|
79 | endfor |
---|
80 | |
---|
81 | swi=swi[*,*,365:365+364] & olri=olri[*,*,365:365+364] |
---|
82 | help, swi, olri |
---|
83 | |
---|
84 | caldat, time,mon,day,yea |
---|
85 | swm=olr*0. & olrm=olr*0. |
---|
86 | for jt=0,jpt-1 do begin |
---|
87 | jtt=(time(jt)-julday(1,1,yea(jt))) < 364 |
---|
88 | swm(*,*,jt)=swi(*,*,jtt) |
---|
89 | olrm(*,*,jt)=olri(*,*,jtt) |
---|
90 | print, jt |
---|
91 | endfor |
---|
92 | swa=sw_isccp-swm ; swr anomaly |
---|
93 | olra=olr-olrm ; olr anomaly |
---|
94 | help, swa, olra |
---|
95 | m=reform(sw_trop(*,*,0)) |
---|
96 | tmask=finite(m) |
---|
97 | cor_olr=fltarr(jpi,jpj)+!values.f_nan & rms_olr=fltarr(jpi,jpj)+!values.f_nan |
---|
98 | |
---|
99 | for jj=0,jpj-1 do begin |
---|
100 | for ji=0,jpi-1 do begin |
---|
101 | if (tmask(ji,jj)) then begin |
---|
102 | print, 'over',jj, '/', jpj-1 |
---|
103 | |
---|
104 | swr_ano=reform(swa(ji,jj,*)) |
---|
105 | olr_ano=reform(olra(ji,jj,*)) |
---|
106 | |
---|
107 | cor_olr(ji,jj)=correlate(swr_ano,olr_ano) |
---|
108 | rms_olr(ji,jj)=(total((swr_ano-olr_ano)^2)/(jpt-1l))^.5 |
---|
109 | |
---|
110 | endif |
---|
111 | endfor |
---|
112 | endfor |
---|
113 | |
---|
114 | cor=fltarr(jpi,jpj)+!values.f_nan & rms=fltarr(jpi,jpj)+!values.f_nan |
---|
115 | for jj=1,jpj-2 do begin |
---|
116 | for ji=1,jpi-2 do begin |
---|
117 | if (tmask(ji,jj)) then begin |
---|
118 | cor(ji,jj)=(cor_olr(ji-1,jj)+cor_olr(ji+1,jj)+cor_olr(ji,jj-1)+cor_olr(ji,jj+1))*tmask(ji,jj)/(tmask(ji-1,jj)+tmask(ji+1,jj)+tmask(ji,jj-1)+tmask(ji,jj+1)) |
---|
119 | endif |
---|
120 | endfor |
---|
121 | endfor |
---|
122 | |
---|
123 | save, cor, cor_olr, filename='correlation_isccp_olr.idl' |
---|
124 | |
---|
125 | lct=64 & cs=0.9 |
---|
126 | marge1=[0,0,-5,0] |
---|
127 | help, cor |
---|
128 | |
---|
129 | plt, cor_olr,0.5,1, lct=lct, $ |
---|
130 | small=[1,4,1],/rempl,/noer,/nocont, $ |
---|
131 | charsize=cs,/nocolorb,marge=marge, $ |
---|
132 | subt='',title='a) Correlation (OLRA, SWRA)',xminor=1,yminor=1 |
---|
133 | |
---|
134 | file="/Volumes/Iomega_HDD/TropFlux/input_cor/full_cor/TropFlux_sst_19890101_20091231_v20.nc" |
---|
135 | initncdf, file |
---|
136 | sst=read_ncdf("sst", 19890101, 20091231, file=file,/nostr) |
---|
137 | sst=grossemoyenne(sst, "t",/nan) |
---|
138 | |
---|
139 | plt, cor_olr,0.5,1, lct=lct, $ |
---|
140 | small=[1,4,3],/rempl,/noer,/nocont, $ |
---|
141 | charsize=cs,marge=marge, $ |
---|
142 | subt='',title='a) Correlation (OLRA, SWRA)',xminor=1,yminor=1, $ |
---|
143 | contour=sst, contmin=26.5, contmax=28.5, contint=1. |
---|
144 | |
---|
145 | plt, rms_olr, lct=lct, $ |
---|
146 | small=[1,4,4],/rempl,/noer,/nocont, $ |
---|
147 | charsize=cs, marge=marge,/nocolorb, $ |
---|
148 | subt='',title='b) RMS Difference (OLRA, SWRA)',xminor=1,yminor=1 |
---|
149 | |
---|
150 | closeps |
---|
151 | fig='correlation_rmsd_olra_swra_smooth.ps' |
---|
152 | spawn, 'mv '+psdir+'idl.ps '+psdir+fig |
---|
153 | spawn, 'gv '+psdir+fig |
---|
154 | |
---|
155 | return |
---|
156 | |
---|
157 | end |
---|