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