[6] | 1 | ;+ |
---|
| 2 | ; |
---|
| 3 | ; .. _interp_erai_ws_1989_2009.pro: |
---|
| 4 | ; |
---|
| 5 | ; ============================ |
---|
| 6 | ; interp_erai_ws_1989_2009.pro |
---|
| 7 | ; ============================ |
---|
[9] | 8 | ; |
---|
| 9 | ; .. graphviz:: |
---|
| 10 | ; |
---|
| 11 | ; digraph interp_erai_ws_1989_2009 { |
---|
| 12 | ; graph [ |
---|
| 13 | ; rankdir="LR", |
---|
| 14 | ; ] |
---|
| 15 | ; file_u10 [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/ERAI_global/20c3m_erai_u10_TROP_1989_2009.nc"]; |
---|
| 16 | ; file_v10 [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/ERAI_global/20c3m_erai_v10_TROP_1989_2009.nc"]; |
---|
| 17 | ; |
---|
| 18 | ; mask [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/work/flux_reconstruction/gridded_data/mask_oaflux_30N30S.nc"]; |
---|
| 19 | ; |
---|
| 20 | ; ncfile [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/TropFlux/input_uncor/erai_ws_19890101_20091231_oafluxgrid.nc"]; |
---|
| 21 | ; |
---|
| 22 | ; interp_erai_ws_1989_2009 [shape=box, |
---|
| 23 | ; fontname=Courier, |
---|
| 24 | ; color=blue, |
---|
| 25 | ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/interp_erai_ws_1989_2009.pro", |
---|
| 26 | ; label="${TROPFLUX}/src/interp_erai_ws_1989_2009.pro"]; |
---|
| 27 | ; |
---|
| 28 | ; {file_u10 file_v10 mask} -> {interp_erai_ws_1989_2009} -> {ncfile} |
---|
| 29 | ; |
---|
| 30 | ; } |
---|
| 31 | ; |
---|
[6] | 32 | ; SEE ALSO |
---|
| 33 | ; ======== |
---|
| 34 | ; |
---|
| 35 | ; EXAMPLES |
---|
| 36 | ; ======== |
---|
| 37 | ; |
---|
| 38 | ; :: |
---|
| 39 | ; |
---|
| 40 | ; IDL> interp_erai_ws_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 20101215T112657Z 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_ws_1989_2009 |
---|
| 67 | @common |
---|
| 68 | |
---|
| 69 | st=19880101 & en=20100930 |
---|
| 70 | |
---|
| 71 | filein='/Volumes/PRAVEEN/ERAI_global/20c3m_erai_u10_TROP_1989_2009.nc' |
---|
| 72 | initncdf, filein |
---|
| 73 | u10in=read_ncdf("u10",st, en,file=filein,/nostr) |
---|
| 74 | |
---|
| 75 | filein='/Volumes/PRAVEEN/ERAI_global/20c3m_erai_v10_TROP_1989_2009.nc' |
---|
| 76 | initncdf, filein |
---|
| 77 | v10in=read_ncdf("v10",st, en,file=filein,/nostr) |
---|
| 78 | |
---|
| 79 | gridout='/Volumes/PRAVEEN/work/flux_reconstruction/gridded_data/mask_oaflux_30N30S.nc' |
---|
| 80 | |
---|
| 81 | initncdf, filein |
---|
| 82 | domdef |
---|
| 83 | latin=reform(gphit(0,*)) & lonin=reform(glamt(*,0)) |
---|
| 84 | print, 'lat grid ',min(latin),max(latin),latin(1)-latin(0) |
---|
| 85 | print, 'lon grid ',min(lonin),max(lonin),lonin(1)-lonin(0) |
---|
| 86 | |
---|
| 87 | timein=time & jptin=jpt |
---|
| 88 | tab=u10in(*,*,0) |
---|
| 89 | mskin=glamt*0.+1. |
---|
| 90 | |
---|
| 91 | initncdf, gridout |
---|
| 92 | domdef |
---|
| 93 | latout=reform(gphit(0,*)) & lonout=reform(glamt(*,0)) |
---|
| 94 | print, 'lat grid ',min(latout),max(latout),latout(1)-latout(0) |
---|
| 95 | print, 'lon grid ',min(lonout),max(lonout),lonout(1)-lonout(0) |
---|
| 96 | mskout=read_ncdf("msk", file=gridout,/nostr) |
---|
| 97 | |
---|
| 98 | help, u10in, v10in,lonin,latin,mskin,lonout,latout,mskout |
---|
| 99 | |
---|
| 100 | si=size(u10in) |
---|
| 101 | u10out=fltarr(jpi,jpj,jptin) |
---|
| 102 | v10out=fltarr(jpi,jpj,jptin) |
---|
| 103 | |
---|
| 104 | for jt=0,jptin-1 do begin |
---|
| 105 | print, 'Interpolation jt=',jt,' / ',jptin-1 |
---|
| 106 | tab=reform(u10in(*,*,jt)) |
---|
| 107 | u10out(*,*,jt)=call_interp2d(tab,lonin,latin,mskin,lonout,latout,method='bilinear') |
---|
| 108 | u10out(*,*,jt)=u10out(*,*,jt)*mskout+(1.-mskout)*1.e20 |
---|
| 109 | |
---|
| 110 | tab=reform(v10in(*,*,jt)) |
---|
| 111 | v10out(*,*,jt)=call_interp2d(tab,lonin,latin,mskin,lonout,latout,method='bilinear') |
---|
| 112 | v10out(*,*,jt)=v10out(*,*,jt)*mskout+(1.-mskout)*1.e20 |
---|
| 113 | |
---|
| 114 | endfor |
---|
| 115 | |
---|
| 116 | time=timegen(7670, units='days', start=julday(1,1,1989)) & jpt=n_elements(time) |
---|
| 117 | tt=time & jptin=jpt |
---|
| 118 | cda0=string(jul2date(tt(0)),format='(i8.8)') |
---|
| 119 | cda1=string(jul2date(tt(jpt-1)),format='(i8.8)') |
---|
| 120 | tt=tt-julday(1,1,1950,00,00,00) |
---|
| 121 | xlon=reform(glamt(*,0) ) & ylat=reform(gphit(0,*)) |
---|
| 122 | |
---|
| 123 | initncdf, gridout |
---|
| 124 | valmask=1.e20 |
---|
| 125 | |
---|
| 126 | ylat=latout |
---|
| 127 | xlon=lonout |
---|
| 128 | ncfile='!/Volumes/PRAVEEN/TropFlux/input_uncor/erai_ws_19890101_20091231_oafluxgrid.nc' |
---|
| 129 | |
---|
| 130 | lon_attr={units:'degrees_east',long_name:'Longitude'} |
---|
| 131 | lat_attr={units:'degrees_north',long_name:'Latitude'} |
---|
| 132 | time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:' 1950-JAN-01 00:00:00'} |
---|
| 133 | |
---|
| 134 | u10_attr={units:'m/s',missing_value:valmask,long_name:'10 metre u wind component',short_name:'u10',axis:'TYX'} |
---|
| 135 | v10_attr={units:'m/s',missing_value:valmask,long_name:'10 metre v wind component',short_name:'v10',axis:'TYX'} |
---|
| 136 | time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:' 1950-JAN-01 00:00:00'} |
---|
| 137 | globattr={source:'Tropical ocean winds obtained from ERA Interim',timerange:cda0+' - '+cda1} |
---|
| 138 | |
---|
| 139 | help, u10out,v10out,tt,xlon,ylat |
---|
| 140 | |
---|
| 141 | ncfields = 'u10[longitude,latitude,time]=u10out:u10_attr; ' $ |
---|
| 142 | +'v10[longitude,latitude,time]=v10out:v10_attr; ' $ |
---|
| 143 | + 'longitude[]=xlon:lon_attr; ' $ |
---|
| 144 | + 'latitude[]=ylat:lat_attr; ' $ |
---|
| 145 | + 'tt[*time]=tt:time_attr ' $ |
---|
| 146 | + ' @ globattr' |
---|
| 147 | |
---|
| 148 | @ncdf_quickwrite |
---|
| 149 | |
---|
| 150 | return |
---|
| 151 | end |
---|