1 | pro interp_olr_30n30s_1989_2009 |
---|
2 | @common |
---|
3 | |
---|
4 | filein='/Users/pkb/data/heat_budget/NOAA_OLR/new/olr.day.mean_new.nc' |
---|
5 | gridout='/Volumes/PRAVEEN/work/flux_reconstruction/gridded_data/mask_oaflux_30N30S.nc' |
---|
6 | |
---|
7 | initncdf, filein |
---|
8 | domdef |
---|
9 | latin=reform(gphit(0,*)) & lonin=reform(glamt(*,0)) |
---|
10 | print, 'lat grid ',min(latin),max(latin),latin(1)-latin(0) |
---|
11 | print, 'lon grid ',min(lonin),max(lonin),lonin(1)-lonin(0) |
---|
12 | olrin=read_ncdf("olr",19881231, 20091231, file=filein,/nostr) |
---|
13 | |
---|
14 | mskin=glamt*0.+1. |
---|
15 | |
---|
16 | timein=time & jptin=jpt |
---|
17 | |
---|
18 | initncdf, gridout |
---|
19 | domdef |
---|
20 | latout=reform(gphit(0,*)) & lonout=reform(glamt(*,0)) |
---|
21 | print, 'lat grid ',min(latout),max(latout),latout(1)-latout(0) |
---|
22 | print, 'lon grid ',min(lonout),max(lonout),lonout(1)-lonout(0) |
---|
23 | mskout=read_ncdf("msk", file=gridout,/nostr) |
---|
24 | |
---|
25 | help, olrin,lonin,latin,mskin,lonout,latout,mskout |
---|
26 | |
---|
27 | olrout=fltarr(jpi,jpj,jptin) |
---|
28 | |
---|
29 | for jt=0,jptin-1 do begin |
---|
30 | |
---|
31 | print, 'Interpolation jt=',jt,' / ',jptin-1 |
---|
32 | tab_olr=reform(olrin(*,*,jt)) |
---|
33 | |
---|
34 | olrout(*,*,jt)=call_interp2d(tab_olr,lonin,latin,mskin,lonout,latout,method='bilinear') |
---|
35 | |
---|
36 | olrout(*,*,jt)=olrout(*,*,jt)*mskout+(1.-mskout)*1.e20 |
---|
37 | |
---|
38 | endfor |
---|
39 | |
---|
40 | |
---|
41 | timein=timein & jptin=jpt |
---|
42 | |
---|
43 | timein=timein-julday(1,1,1950,00,00) |
---|
44 | |
---|
45 | lat=latout |
---|
46 | lon=lonout |
---|
47 | ncfile='!/Users/pkb/data/heat_budget/NOAA_OLR/newolr_oafluxgrid_30n30s_19890101_20091231.nc' |
---|
48 | lon_attr={units:'degrees_east',long_name:'Longitude'} |
---|
49 | lat_attr={units:'degrees_north',long_name:'Latitude'} |
---|
50 | time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:' 1950-JAN-01 00:00:00'} |
---|
51 | olr_attr={units:'w/m^2',missing_value:1e20,long_name:'Outgoing Longwave Radiation',short_name:'olr',axis:'TYX'} |
---|
52 | olra_attr={units:'w/m^2',missing_value:1e20,long_name:'Outgoing Longwave Radiation Anomaly',short_name:'olra',axis:'TYX'} |
---|
53 | globattr={source:'NOAA OLR, cf http://www.cdc.noaa.gov/cdc/data.interp_OLR.html, interpolated to 1x1 degree grid and with oaflux mask'} |
---|
54 | |
---|
55 | |
---|
56 | ncfields = 'olr[longitude,latitude,time]=olrout:olr_attr; ' $ |
---|
57 | + 'longitude[]=lon:lon_attr; ' $ |
---|
58 | + 'latitude[]=lat:lat_attr; ' $ |
---|
59 | + 'time[*time]=timein:time_attr ' $ |
---|
60 | + ' @ globattr' |
---|
61 | |
---|
62 | @ncdf_quickwrite |
---|
63 | |
---|
64 | |
---|
65 | end |
---|