source: trunk/src/TropFlux_swr_NRT_19890101_20091231.pro @ 11

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

add some graph - io - in headers (cont.)

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