1 | ;+ |
---|
2 | ; |
---|
3 | ; .. _TropFlux_swr_NRT_19890101_20091231.pro: |
---|
4 | ; |
---|
5 | ; ====================================== |
---|
6 | ; TropFlux_swr_NRT_19890101_20091231.pro |
---|
7 | ; ====================================== |
---|
8 | ; |
---|
9 | ; |
---|
10 | ; .. graphviz:: |
---|
11 | ; |
---|
12 | ; digraph TropFlux_swr_NRT_19890101_200912311 { |
---|
13 | ; graph [ |
---|
14 | ; rankdir="LR", |
---|
15 | ; ] |
---|
16 | ; file_sw [shape=ellipse,fontname=Courier,label="/Users/pkb/data/TropFlux/TropFlux_swr_19890101_20071231_DT_v50.nc"]; |
---|
17 | ; file_olr [shape=ellipse,fontname=Courier,label="/Users/pkb/data/heat_budget/NOAA_OLR/olr_oafluxgrid_30n30s_19890101_20091231.nc"]; |
---|
18 | ; ncfile [shape=ellipse,fontname=Courier,label="/Users/pkb/data/TropFlux/TropFlux_swr_19890101_20091231_NRT_v50.nc"]; |
---|
19 | ; TropFlux_swr_NRT_19890101_200912311 [shape=box, |
---|
20 | ; fontname=Courier, |
---|
21 | ; color=blue, |
---|
22 | ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/TropFlux_swr_NRT_19890101_200912311.pro", |
---|
23 | ; label="${PROJECT}/src/TropFlux_swr_NRT_19890101_200912311.pro"]; |
---|
24 | ; {file_sw file_olr}-> {TropFlux_swr_NRT_19890101_200912311} -> {ncfile} |
---|
25 | ; } |
---|
26 | ; |
---|
27 | ; SEE ALSO |
---|
28 | ; ======== |
---|
29 | ; |
---|
30 | ; :func:`initncdf <saxo:initncdf>` |
---|
31 | ; :func:`read_ncdf <saxo:read_ncdf>` |
---|
32 | ; :func:`julday <saxo:julday>` |
---|
33 | ; :func:`ncdf_quickwrite <saxo:ncdf_quickwrite>` |
---|
34 | ; |
---|
35 | ; EXAMPLES |
---|
36 | ; ======== |
---|
37 | ; |
---|
38 | ; :: |
---|
39 | ; |
---|
40 | ; IDL> tropflux_swr_nrt_19890101_20091231 |
---|
41 | ; |
---|
42 | ; TODO |
---|
43 | ; ==== |
---|
44 | ; |
---|
45 | ; hard coded directory - usage of ${PROJECT_ID} |
---|
46 | ; |
---|
47 | ; coding rules |
---|
48 | ; |
---|
49 | ; EVOLUTIONS |
---|
50 | ; ========== |
---|
51 | ; |
---|
52 | ; - fplod 20101215T092145Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
53 | ; |
---|
54 | ; * add graph in header |
---|
55 | ; |
---|
56 | ; - fplod 20101214T093615Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
57 | ; |
---|
58 | ; * minimal header |
---|
59 | ; |
---|
60 | ; - pbk 2008 |
---|
61 | ; |
---|
62 | ; * creation |
---|
63 | ; |
---|
64 | ;- |
---|
65 | pro TropFlux_swr_NRT_19890101_20091231 |
---|
66 | @common |
---|
67 | file='/Users/pkb/data/TropFlux/TropFlux_swr_19890101_20071231_DT_v50.nc' |
---|
68 | initncdf, file |
---|
69 | sw=read_ncdf("swr", 19890101, 20071231, file=file,/nostr) |
---|
70 | |
---|
71 | swi=sw |
---|
72 | file_olr='/Users/pkb/data/heat_budget/NOAA_OLR/olr_oafluxgrid_30n30s_19890101_20091231.nc' |
---|
73 | |
---|
74 | initncdf,file_olr |
---|
75 | olr=read_ncdf('olr',19890100, 20071231,file=file_olr,/nost) |
---|
76 | |
---|
77 | help, sw, olr |
---|
78 | |
---|
79 | ;;creating climatology |
---|
80 | |
---|
81 | ny=(2007-1989)+1 |
---|
82 | nt=365*ny |
---|
83 | olri=total(reform(olr(*,*,0:nt-1),nxt,nyt,365,ny),4)/ny |
---|
84 | swi=total(reform(swi(*,*,0:nt-1),nxt,nyt,365,ny),4)/ny |
---|
85 | |
---|
86 | help, olri, swi |
---|
87 | |
---|
88 | ;; applying smoothing |
---|
89 | nsmooth=45 |
---|
90 | |
---|
91 | swi=[[[swi]],[[swi]],[[swi]]] & olri=[[[olri]],[[olri]],[[olri]]] |
---|
92 | si=size(sw) & n1=si(1) & n2=si(2) |
---|
93 | |
---|
94 | for j=0,n2-1 do begin |
---|
95 | for i=0,n1-1 do begin |
---|
96 | x=reform(swi(i,j,*)) |
---|
97 | y=reform(olri(i,j,*)) |
---|
98 | swi(i,j,*)=smooth(x,nsmooth) |
---|
99 | olri(i,j,*)=smooth(y,nsmooth) |
---|
100 | endfor |
---|
101 | endfor |
---|
102 | |
---|
103 | swi=swi[*,*,365:365+364] & olri=olri[*,*,365:365+364] |
---|
104 | help, swi |
---|
105 | |
---|
106 | initncdf, file_olr |
---|
107 | olr=read_ncdf('olr', 19890100, 20091231, box=box, file=file_olr,/nostr) |
---|
108 | tt=time & jpt=n_elements(time) |
---|
109 | caldat, time,mon,day,yea |
---|
110 | swm=olr*0. & olrm=olr*0. |
---|
111 | for jt=0,jpt-1 do begin |
---|
112 | jtt=(time(jt)-julday(1,1,yea(jt))) < 364 |
---|
113 | swm(*,*,jt)=swi(*,*,jtt) |
---|
114 | olrm(*,*,jt)=olri(*,*,jtt) |
---|
115 | endfor |
---|
116 | |
---|
117 | help, swm, olrm |
---|
118 | |
---|
119 | olra=olr-olrm ; olr anomaly |
---|
120 | rec=swm+(olra/0.760364) ; reconstructed sw |
---|
121 | ;writing field |
---|
122 | time=julday(1,1,1989)+lindgen(7670) |
---|
123 | cda0=string(jul2date(tt(0)),format='(i8.8)') |
---|
124 | cda1=string(jul2date(tt(jpt-1)),format='(i8.8)') |
---|
125 | |
---|
126 | lat=reform(gphit(0,0:jpj-1)) |
---|
127 | lon=reform(glamt(0:jpi-1,0)) |
---|
128 | time=time-julday(1,1,1950) & jpt=n_elements(time) |
---|
129 | |
---|
130 | ncfile='!/Users/pkb/data/TropFlux/TropFlux_swr_19890101_20091231_NRT_v50.nc' |
---|
131 | lon_attr={units:'degrees_east',long_name:'Longitude'} |
---|
132 | lat_attr={units:'degrees_north',long_name:'Latitude'} |
---|
133 | time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:''} |
---|
134 | sw_attr={units:'w/m^2',missing_value:1.e20,long_name:'Net Shortwave Radiation',short_name:'swr',axis:'TYX'} |
---|
135 | globattr={source:'Reconstructed from corrected OLR anomalies and TropFlux mean SWR climatology',timerange:cda0+' - '+cda1} |
---|
136 | |
---|
137 | |
---|
138 | ncfields = 'sw[longitude,latitude,time]=rec:sw_attr; ' $ |
---|
139 | + 'longitude[]=lon:lon_attr; ' $ |
---|
140 | + 'latitude[]=lat:lat_attr; ' $ |
---|
141 | + 'time[*time]=time:time_attr ' $ |
---|
142 | + ' @ globattr' |
---|
143 | |
---|
144 | @ncdf_quickwrite |
---|
145 | |
---|
146 | end |
---|