source: trunk/src/paper01/fig11/swr_isccp_tropflux_new_v1.pro @ 43

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

add minimal header in paper01 IDL files

File size: 3.7 KB
Line 
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;-
35pro swr_isccp_tropflux_new_v1
36@common
37reinitplt, /z,/invert
38key_portrait = 1
39
40openps, FILENAME = 'idl.ps'
41st=19890101 & en=20071231
42
43file='/Volumes/Iomega_HDD/work/flux_reconstruction/OAFLX_GRID/swr_oafluxgrid_1985_2007.nc'
44initncdf, file
45sw_isccp=read_ncdf("swr", st, en, file=file,/nostr)
46
47file='/Volumes/Iomega_HDD/flux_reconstruction/basic_data/sw_reconstred_1989_2009.nc'
48initncdf, file
49sw_trop=read_ncdf("sw", st, en+1, file=file,/nostr)
50
51file='/Volumes/Iomega_HDD/flux_reconstruction/basic_data/olr_oafluxgrid_30n30s.nc'
52initncdf, file
53olr=read_ncdf("olr", st, en, file=file,/nostr)
54
55help, sw_isccp, sw_trop , olr
56
57;;creating climatology
58
59ny=(2007-1989)+1
60nt=365*ny
61
62olri=total(reform(olr(*,*,0:nt-1),nxt,nyt,365,ny),4)/ny
63swi=total(reform(sw_isccp(*,*,0:nt-1),nxt,nyt,365,ny),4)/ny
64help, olri, swi
65
66;; applying smoothing
67nsmooth=45
68
69swi=[[[swi]],[[swi]],[[swi]]] & olri=[[[olri]],[[olri]],[[olri]]]
70si=size(sw) & n1=si(1) & n2=si(2)
71
72for 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
79endfor
80
81swi=swi[*,*,365:365+364] & olri=olri[*,*,365:365+364]
82help, swi, olri
83
84caldat, time,mon,day,yea
85swm=olr*0. & olrm=olr*0.
86for 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
91endfor
92swa=sw_isccp-swm        ; swr anomaly
93olra=olr-olrm     ; olr anomaly
94help, swa, olra
95m=reform(sw_trop(*,*,0))
96tmask=finite(m)
97cor_olr=fltarr(jpi,jpj)+!values.f_nan & rms_olr=fltarr(jpi,jpj)+!values.f_nan
98
99for 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
112endfor
113
114cor=fltarr(jpi,jpj)+!values.f_nan & rms=fltarr(jpi,jpj)+!values.f_nan
115for 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
121endfor
122
123save, cor, cor_olr, filename='correlation_isccp_olr.idl'
124
125lct=64 & cs=0.9
126marge1=[0,0,-5,0]
127help, cor
128
129plt, 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
134file="/Volumes/Iomega_HDD/TropFlux/input_cor/full_cor/TropFlux_sst_19890101_20091231_v20.nc"
135initncdf, file
136sst=read_ncdf("sst", 19890101, 20091231, file=file,/nostr)
137sst=grossemoyenne(sst, "t",/nan)
138
139plt, 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
145plt, 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
150closeps
151fig='correlation_rmsd_olra_swra_smooth.ps'
152spawn, 'mv '+psdir+'idl.ps '+psdir+fig
153spawn, 'gv '+psdir+fig
154
155return
156
157end
Note: See TracBrowser for help on using the repository browser.