source: trunk/src/TropFlux_swr_NRT_19890101_20091231.pro @ 12

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

fix for graph in PDF

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