source: trunk/src/TropFlux_swr_NRT_19890101_20091231.pro @ 73

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

replace TROPFLUX by PROJECT

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;     .. 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;-
65pro TropFlux_swr_NRT_19890101_20091231
66@common
67file='/Users/pkb/data/TropFlux/TropFlux_swr_19890101_20071231_DT_v50.nc'
68initncdf, file
69sw=read_ncdf("swr", 19890101, 20071231, file=file,/nostr)
70
71swi=sw
72file_olr='/Users/pkb/data/heat_budget/NOAA_OLR/olr_oafluxgrid_30n30s_19890101_20091231.nc'
73
74initncdf,file_olr
75olr=read_ncdf('olr',19890100, 20071231,file=file_olr,/nost)
76
77help, sw, olr
78
79;;creating climatology
80
81ny=(2007-1989)+1
82nt=365*ny
83olri=total(reform(olr(*,*,0:nt-1),nxt,nyt,365,ny),4)/ny
84swi=total(reform(swi(*,*,0:nt-1),nxt,nyt,365,ny),4)/ny
85
86help, olri, swi
87
88;; applying smoothing
89nsmooth=45
90
91swi=[[[swi]],[[swi]],[[swi]]] & olri=[[[olri]],[[olri]],[[olri]]]
92si=size(sw) & n1=si(1) & n2=si(2)
93
94for 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
101endfor
102
103swi=swi[*,*,365:365+364] & olri=olri[*,*,365:365+364]
104help, swi
105
106initncdf, file_olr
107olr=read_ncdf('olr', 19890100, 20091231, box=box, file=file_olr,/nostr)
108tt=time & jpt=n_elements(time)
109caldat, time,mon,day,yea
110swm=olr*0. & olrm=olr*0.
111for 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)
115endfor
116
117help, swm, olrm
118
119olra=olr-olrm                       ; olr anomaly
120rec=swm+(olra/0.760364)             ; reconstructed sw
121;writing field
122time=julday(1,1,1989)+lindgen(7670)
123cda0=string(jul2date(tt(0)),format='(i8.8)')
124cda1=string(jul2date(tt(jpt-1)),format='(i8.8)')
125
126lat=reform(gphit(0,0:jpj-1))
127lon=reform(glamt(0:jpi-1,0))
128time=time-julday(1,1,1950) & jpt=n_elements(time)
129
130ncfile='!/Users/pkb/data/TropFlux/TropFlux_swr_19890101_20091231_NRT_v50.nc'
131lon_attr={units:'degrees_east',long_name:'Longitude'}
132lat_attr={units:'degrees_north',long_name:'Latitude'}
133time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:''}
134sw_attr={units:'w/m^2',missing_value:1.e20,long_name:'Net Shortwave Radiation',short_name:'swr',axis:'TYX'}
135globattr={source:'Reconstructed from corrected OLR anomalies and TropFlux mean SWR climatology',timerange:cda0+' - '+cda1}
136
137
138ncfields = '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
146end
Note: See TracBrowser for help on using the repository browser.