[6] | 1 | ;+ |
---|
| 2 | ; |
---|
| 3 | ; .. _interp_olr_30n30s_1989_2009.pro: |
---|
| 4 | ; |
---|
| 5 | ; =============================== |
---|
| 6 | ; interp_olr_30n30s_1989_2009.pro |
---|
| 7 | ; =============================== |
---|
| 8 | ; |
---|
[9] | 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 | ; |
---|
[6] | 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 | ; |
---|
[9] | 51 | ; - fplod 20101215T113118Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 52 | ; |
---|
| 53 | ; * add graph in header |
---|
| 54 | ; |
---|
[6] | 55 | ; - fplod 20101214T093615Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 56 | ; |
---|
| 57 | ; * minimal header |
---|
| 58 | ; |
---|
| 59 | ; - pbk 2008 |
---|
| 60 | ; |
---|
| 61 | ; * creation |
---|
| 62 | ; |
---|
| 63 | ;- |
---|
[5] | 64 | pro interp_olr_30n30s_1989_2009 |
---|
| 65 | @common |
---|
| 66 | |
---|
| 67 | filein='/Users/pkb/data/heat_budget/NOAA_OLR/new/olr.day.mean_new.nc' |
---|
| 68 | gridout='/Volumes/PRAVEEN/work/flux_reconstruction/gridded_data/mask_oaflux_30N30S.nc' |
---|
| 69 | |
---|
| 70 | initncdf, filein |
---|
| 71 | domdef |
---|
| 72 | latin=reform(gphit(0,*)) & lonin=reform(glamt(*,0)) |
---|
| 73 | print, 'lat grid ',min(latin),max(latin),latin(1)-latin(0) |
---|
| 74 | print, 'lon grid ',min(lonin),max(lonin),lonin(1)-lonin(0) |
---|
| 75 | olrin=read_ncdf("olr",19881231, 20091231, file=filein,/nostr) |
---|
| 76 | |
---|
[6] | 77 | mskin=glamt*0.+1. |
---|
| 78 | |
---|
[5] | 79 | timein=time & jptin=jpt |
---|
| 80 | |
---|
| 81 | initncdf, gridout |
---|
| 82 | domdef |
---|
| 83 | latout=reform(gphit(0,*)) & lonout=reform(glamt(*,0)) |
---|
| 84 | print, 'lat grid ',min(latout),max(latout),latout(1)-latout(0) |
---|
| 85 | print, 'lon grid ',min(lonout),max(lonout),lonout(1)-lonout(0) |
---|
| 86 | mskout=read_ncdf("msk", file=gridout,/nostr) |
---|
| 87 | |
---|
| 88 | help, olrin,lonin,latin,mskin,lonout,latout,mskout |
---|
| 89 | |
---|
| 90 | olrout=fltarr(jpi,jpj,jptin) |
---|
| 91 | |
---|
| 92 | for 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 | |
---|
| 101 | endfor |
---|
| 102 | |
---|
| 103 | |
---|
| 104 | timein=timein & jptin=jpt |
---|
| 105 | |
---|
| 106 | timein=timein-julday(1,1,1950,00,00) |
---|
| 107 | |
---|
| 108 | lat=latout |
---|
| 109 | lon=lonout |
---|
| 110 | ncfile='!/Users/pkb/data/heat_budget/NOAA_OLR/newolr_oafluxgrid_30n30s_19890101_20091231.nc' |
---|
| 111 | lon_attr={units:'degrees_east',long_name:'Longitude'} |
---|
| 112 | lat_attr={units:'degrees_north',long_name:'Latitude'} |
---|
| 113 | time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:' 1950-JAN-01 00:00:00'} |
---|
| 114 | olr_attr={units:'w/m^2',missing_value:1e20,long_name:'Outgoing Longwave Radiation',short_name:'olr',axis:'TYX'} |
---|
| 115 | olra_attr={units:'w/m^2',missing_value:1e20,long_name:'Outgoing Longwave Radiation Anomaly',short_name:'olra',axis:'TYX'} |
---|
| 116 | globattr={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 | |
---|
| 119 | ncfields = '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 | |
---|
| 128 | end |
---|