[6] | 1 | ;+ |
---|
| 2 | ; |
---|
| 3 | ; .. interp_erai_t2m_1989_2009.pro: |
---|
| 4 | ; |
---|
| 5 | ; ============================= |
---|
| 6 | ; interp_erai_t2m_1989_2009.pro |
---|
| 7 | ; ============================= |
---|
| 8 | ; |
---|
| 9 | ; |
---|
[9] | 10 | ; .. graphviz:: |
---|
| 11 | ; |
---|
| 12 | ; digraph interp_erai_t2m_1989_2009 { |
---|
| 13 | ; graph [ |
---|
| 14 | ; rankdir="LR", |
---|
| 15 | ; ] |
---|
| 16 | ; file_in [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/ERAI_global/20c3m_erai_t2_TROP_1989_2009.nc"]; |
---|
| 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="/Volumes/PRAVEEN/TropFlux/input_uncor/erai_t2m_19890101_20091231_oafluxgrid.nc"]; |
---|
| 20 | ; |
---|
| 21 | ; interp_erai_t2m_1989_2009 [shape=box, |
---|
| 22 | ; fontname=Courier, |
---|
| 23 | ; color=blue, |
---|
| 24 | ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/interp_erai_t2m_1989_2009.pro"", |
---|
| 25 | ; label="${TROPFLUX}/src/interp_erai_t2m_1989_2009.pro"]; |
---|
| 26 | ; |
---|
| 27 | ; {file_in mask} -> {interp_erai_t2m_1989_2009} -> {ncfile} |
---|
| 28 | ; |
---|
| 29 | ; } |
---|
| 30 | ; |
---|
| 31 | ; |
---|
[6] | 32 | ; SEE ALSO |
---|
| 33 | ; ======== |
---|
| 34 | ; |
---|
| 35 | ; EXAMPLES |
---|
| 36 | ; ======== |
---|
| 37 | ; |
---|
| 38 | ; :: |
---|
| 39 | ; |
---|
| 40 | ; IDL> interp_erai_t2m_1989_2009 |
---|
| 41 | ; |
---|
| 42 | ; |
---|
| 43 | ; TODO |
---|
| 44 | ; ==== |
---|
| 45 | ; |
---|
| 46 | ; hard coded directory - usage of ${TROPFLUX_ID} |
---|
| 47 | ; |
---|
| 48 | ; coding rules |
---|
| 49 | ; |
---|
| 50 | ; EVOLUTIONS |
---|
| 51 | ; ========== |
---|
| 52 | ; |
---|
[9] | 53 | ; - fplod 20101215T112140Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 54 | ; |
---|
| 55 | ; * add graph in header |
---|
| 56 | ; |
---|
[6] | 57 | ; - fplod 20101214T093615Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 58 | ; |
---|
| 59 | ; * minimal header |
---|
| 60 | ; |
---|
| 61 | ; - pbk 2008 |
---|
| 62 | ; |
---|
| 63 | ; * creation |
---|
| 64 | ; |
---|
| 65 | ;- |
---|
[5] | 66 | pro interp_erai_t2m_1989_2009 |
---|
| 67 | @common |
---|
| 68 | |
---|
| 69 | filein='/Volumes/PRAVEEN/ERAI_global/20c3m_erai_t2_TROP_1989_2009.nc' |
---|
| 70 | gridout='/Volumes/PRAVEEN/work/flux_reconstruction/gridded_data/mask_oaflux_30N30S.nc' |
---|
| 71 | |
---|
| 72 | initncdf, filein |
---|
| 73 | domdef |
---|
| 74 | latin=reform(gphit(0,*)) & lonin=reform(glamt(*,0)) |
---|
| 75 | print, 'lat grid ',min(latin),max(latin),latin(1)-latin(0) |
---|
| 76 | print, 'lon grid ',min(lonin),max(lonin),lonin(1)-lonin(0) |
---|
| 77 | t2min=read_ncdf("t2",19880101,20100930,file=filein,/nostr) |
---|
| 78 | |
---|
| 79 | timein=time & jptin=jpt |
---|
| 80 | tab=t2min(*,*,0) |
---|
| 81 | mskin=glamt*0.+1. |
---|
| 82 | |
---|
| 83 | initncdf, gridout |
---|
| 84 | domdef |
---|
| 85 | latout=reform(gphit(0,*)) & lonout=reform(glamt(*,0)) |
---|
| 86 | print, 'lat grid ',min(latout),max(latout),latout(1)-latout(0) |
---|
| 87 | print, 'lon grid ',min(lonout),max(lonout),lonout(1)-lonout(0) |
---|
| 88 | mskout=read_ncdf("msk", file=gridout,/nostr) |
---|
| 89 | |
---|
| 90 | help, t2min,lonin,latin,mskin,lonout,latout,mskout |
---|
| 91 | si=size(t2min) |
---|
| 92 | t2mout=fltarr(jpi,jpj,jptin) |
---|
| 93 | for jt=0,jptin-1 do begin |
---|
| 94 | print, 'Interpolation jt=',jt,' / ',jptin-1 |
---|
| 95 | tab=reform(t2min(*,*,jt)) |
---|
| 96 | t2mout(*,*,jt)=call_interp2d(tab,lonin,latin,mskin,lonout,latout,method='bilinear') |
---|
| 97 | t2mout(*,*,jt)=t2mout(*,*,jt)*mskout+(1.-mskout)*1.e20 |
---|
| 98 | endfor |
---|
| 99 | |
---|
| 100 | timein=timein & jptin=jpt |
---|
| 101 | |
---|
| 102 | initncdf, gridout |
---|
| 103 | help, t2mout |
---|
| 104 | tt=timein |
---|
| 105 | time=julday(1,1,1989)+lindgen(7670)+0.5 & jpt=n_elements(time) |
---|
| 106 | ;cda0=string(jul2date(time(0)),format='(i8.8)') |
---|
| 107 | ;cda1=string(jul2date(time(jpt-1)),format='(i8.8)') |
---|
| 108 | ;cda0=string('19890101') & cda1=string('20091231') |
---|
| 109 | |
---|
| 110 | timein=time-julday(1,1,1950,00,00) |
---|
| 111 | |
---|
| 112 | lat=latout |
---|
| 113 | lon=lonout |
---|
| 114 | ncfile='!/Volumes/PRAVEEN/TropFlux/input_uncor/erai_t2m_19890101_20091231_oafluxgrid.nc' |
---|
| 115 | lon_attr={units:'degrees_east',long_name:'Longitude'} |
---|
| 116 | lat_attr={units:'degrees_north',long_name:'Latitude'} |
---|
| 117 | time_attr={units:'hours since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:' 1950-JAN-01 00:00:00'} |
---|
| 118 | t2m_attr={units:'degK',missing_value:1e20,long_name:'Air Temperature at 2m',short_name:'t2m',axis:'TYX'} |
---|
| 119 | globattr={source:'Data are from ECMWF ERA-Interim reanalysis', timerange:cda0+' - '+cda1} |
---|
| 120 | |
---|
| 121 | |
---|
| 122 | ncfields = 't2m[longitude,latitude,time]=t2mout:t2m_attr; ' $ |
---|
| 123 | + 'longitude[]=lon:lon_attr; ' $ |
---|
| 124 | + 'latitude[]=lat:lat_attr; ' $ |
---|
| 125 | + 'time[*time]=timein:time_attr ' $ |
---|
| 126 | + ' @ globattr' |
---|
| 127 | |
---|
| 128 | @ncdf_quickwrite |
---|
| 129 | |
---|
| 130 | |
---|
| 131 | end |
---|