source: trunk/src/interp_olr_30n30s_1989_2009.pro @ 17

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

fix for graph in PDF

File size: 3.6 KB
Line 
1;+
2;
3; .. _interp_olr_30n30s_1989_2009.pro:
4;
5; ===============================
6; interp_olr_30n30s_1989_2009.pro
7; ===============================
8;
9;     .. graphviz::
10;
11;        digraph interp_olr_30n30s_1989_2009{
12;           graph [
13;           rankdir="LR",
14;           ]
15;           file_in [shape=ellipse,fontname=Courier,label="/Users/pkb/data/heat_budget/NOAA_OLR/new/olr.day.mean_new.nc"];
16;
17;           mask [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/work/flux_reconstruction/gridded_data/mask_oaflux_30N30S.nc"];
18;
19;           ncfile [shape=ellipse,fontname=Courier,label="/Users/pkb/data/heat_budget/NOAA_OLR/newolr_oafluxgrid_30n30s_19890101_20091231.nc"];
20;
21;           interp_olr_30n30s_1989_2009 [shape=box,
22;           fontname=Courier,
23;           color=blue,
24;           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/interp_olr_30n30s_1989_2009.pro",
25;           label="${TROPFLUX}/src/interp_olr_30n30s_1989_2009.pro"];
26;
27;           {file_in mask} -> {interp_olr_30n30s_1989_2009} -> {ncfile}
28;
29;         }
30;
31; SEE ALSO
32; ========
33;
34; EXAMPLES
35; ========
36;
37; ::
38;
39;  IDL> interp_olr_30n30s_1989_2009
40;
41; TODO
42; ====
43;
44; hard coded directory - usage of ${TROPFLUX_ID}
45;
46; coding rules
47;
48; EVOLUTIONS
49; ==========
50;
51; - fplod 20101215T113118Z aedon.locean-ipsl.upmc.fr (Darwin)
52;
53;   * add graph in header
54;
55; - fplod 20101214T093615Z aedon.locean-ipsl.upmc.fr (Darwin)
56;
57;   * minimal header
58;
59; - pbk 2008
60;
61;   * creation
62;
63;-
64pro interp_olr_30n30s_1989_2009
65@common
66
67filein='/Users/pkb/data/heat_budget/NOAA_OLR/new/olr.day.mean_new.nc'
68gridout='/Volumes/PRAVEEN/work/flux_reconstruction/gridded_data/mask_oaflux_30N30S.nc'
69
70initncdf, filein
71domdef
72latin=reform(gphit(0,*)) & lonin=reform(glamt(*,0))
73print, 'lat grid ',min(latin),max(latin),latin(1)-latin(0)
74print, 'lon grid ',min(lonin),max(lonin),lonin(1)-lonin(0)
75olrin=read_ncdf("olr",19881231, 20091231, file=filein,/nostr)
76
77mskin=glamt*0.+1.
78
79timein=time & jptin=jpt
80
81initncdf, gridout
82domdef
83latout=reform(gphit(0,*)) & lonout=reform(glamt(*,0))
84print, 'lat grid ',min(latout),max(latout),latout(1)-latout(0)
85print, 'lon grid ',min(lonout),max(lonout),lonout(1)-lonout(0)
86mskout=read_ncdf("msk", file=gridout,/nostr)
87
88help, olrin,lonin,latin,mskin,lonout,latout,mskout
89
90olrout=fltarr(jpi,jpj,jptin)
91
92for jt=0,jptin-1 do begin
93
94  print, 'Interpolation jt=',jt,' / ',jptin-1
95  tab_olr=reform(olrin(*,*,jt))
96
97  olrout(*,*,jt)=call_interp2d(tab_olr,lonin,latin,mskin,lonout,latout,method='bilinear')
98
99  olrout(*,*,jt)=olrout(*,*,jt)*mskout+(1.-mskout)*1.e20
100
101endfor
102
103
104timein=timein & jptin=jpt
105
106timein=timein-julday(1,1,1950,00,00)
107
108lat=latout
109lon=lonout
110ncfile='!/Users/pkb/data/heat_budget/NOAA_OLR/newolr_oafluxgrid_30n30s_19890101_20091231.nc'
111lon_attr={units:'degrees_east',long_name:'Longitude'}
112lat_attr={units:'degrees_north',long_name:'Latitude'}
113time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:' 1950-JAN-01 00:00:00'}
114olr_attr={units:'w/m^2',missing_value:1e20,long_name:'Outgoing Longwave Radiation',short_name:'olr',axis:'TYX'}
115olra_attr={units:'w/m^2',missing_value:1e20,long_name:'Outgoing Longwave Radiation Anomaly',short_name:'olra',axis:'TYX'}
116globattr={source:'NOAA OLR, cf http://www.cdc.noaa.gov/cdc/data.interp_OLR.html, interpolated to 1x1 degree grid and with oaflux mask'}
117
118
119ncfields = 'olr[longitude,latitude,time]=olrout:olr_attr; ' $
120                      + 'longitude[]=lon:lon_attr; ' $
121                      + 'latitude[]=lat:lat_attr; ' $
122                      + 'time[*time]=timein:time_attr ' $
123                      + ' @ globattr'
124
125@ncdf_quickwrite
126
127
128end
Note: See TracBrowser for help on using the repository browser.