1 | ;+ |
---|
2 | ; |
---|
3 | ; .. _interp_erai_ws_1989_2009.pro: |
---|
4 | ; |
---|
5 | ; ============================ |
---|
6 | ; interp_erai_ws_1989_2009.pro |
---|
7 | ; ============================ |
---|
8 | ; SEE ALSO |
---|
9 | ; ======== |
---|
10 | ; |
---|
11 | ; EXAMPLES |
---|
12 | ; ======== |
---|
13 | ; |
---|
14 | ; :: |
---|
15 | ; |
---|
16 | ; IDL> interp_erai_ws_1989_2009 |
---|
17 | ; |
---|
18 | ; |
---|
19 | ; TODO |
---|
20 | ; ==== |
---|
21 | ; |
---|
22 | ; hard coded directory - usage of ${TROPFLUX_ID} |
---|
23 | ; |
---|
24 | ; coding rules |
---|
25 | ; |
---|
26 | ; EVOLUTIONS |
---|
27 | ; ========== |
---|
28 | ; |
---|
29 | ; - fplod 20101214T093615Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
30 | ; |
---|
31 | ; * minimal header |
---|
32 | ; |
---|
33 | ; - pbk 2008 |
---|
34 | ; |
---|
35 | ; * creation |
---|
36 | ; |
---|
37 | ;- |
---|
38 | pro interp_erai_ws_1989_2009 |
---|
39 | @common |
---|
40 | |
---|
41 | st=19880101 & en=20100930 |
---|
42 | |
---|
43 | filein='/Volumes/PRAVEEN/ERAI_global/20c3m_erai_u10_TROP_1989_2009.nc' |
---|
44 | initncdf, filein |
---|
45 | u10in=read_ncdf("u10",st, en,file=filein,/nostr) |
---|
46 | |
---|
47 | filein='/Volumes/PRAVEEN/ERAI_global/20c3m_erai_v10_TROP_1989_2009.nc' |
---|
48 | initncdf, filein |
---|
49 | v10in=read_ncdf("v10",st, en,file=filein,/nostr) |
---|
50 | |
---|
51 | gridout='/Volumes/PRAVEEN/work/flux_reconstruction/gridded_data/mask_oaflux_30N30S.nc' |
---|
52 | |
---|
53 | initncdf, filein |
---|
54 | domdef |
---|
55 | latin=reform(gphit(0,*)) & lonin=reform(glamt(*,0)) |
---|
56 | print, 'lat grid ',min(latin),max(latin),latin(1)-latin(0) |
---|
57 | print, 'lon grid ',min(lonin),max(lonin),lonin(1)-lonin(0) |
---|
58 | |
---|
59 | timein=time & jptin=jpt |
---|
60 | tab=u10in(*,*,0) |
---|
61 | mskin=glamt*0.+1. |
---|
62 | |
---|
63 | initncdf, gridout |
---|
64 | domdef |
---|
65 | latout=reform(gphit(0,*)) & lonout=reform(glamt(*,0)) |
---|
66 | print, 'lat grid ',min(latout),max(latout),latout(1)-latout(0) |
---|
67 | print, 'lon grid ',min(lonout),max(lonout),lonout(1)-lonout(0) |
---|
68 | mskout=read_ncdf("msk", file=gridout,/nostr) |
---|
69 | |
---|
70 | help, u10in, v10in,lonin,latin,mskin,lonout,latout,mskout |
---|
71 | |
---|
72 | si=size(u10in) |
---|
73 | u10out=fltarr(jpi,jpj,jptin) |
---|
74 | v10out=fltarr(jpi,jpj,jptin) |
---|
75 | |
---|
76 | for jt=0,jptin-1 do begin |
---|
77 | print, 'Interpolation jt=',jt,' / ',jptin-1 |
---|
78 | tab=reform(u10in(*,*,jt)) |
---|
79 | u10out(*,*,jt)=call_interp2d(tab,lonin,latin,mskin,lonout,latout,method='bilinear') |
---|
80 | u10out(*,*,jt)=u10out(*,*,jt)*mskout+(1.-mskout)*1.e20 |
---|
81 | |
---|
82 | tab=reform(v10in(*,*,jt)) |
---|
83 | v10out(*,*,jt)=call_interp2d(tab,lonin,latin,mskin,lonout,latout,method='bilinear') |
---|
84 | v10out(*,*,jt)=v10out(*,*,jt)*mskout+(1.-mskout)*1.e20 |
---|
85 | |
---|
86 | endfor |
---|
87 | |
---|
88 | time=timegen(7670, units='days', start=julday(1,1,1989)) & jpt=n_elements(time) |
---|
89 | tt=time & jptin=jpt |
---|
90 | cda0=string(jul2date(tt(0)),format='(i8.8)') |
---|
91 | cda1=string(jul2date(tt(jpt-1)),format='(i8.8)') |
---|
92 | tt=tt-julday(1,1,1950,00,00,00) |
---|
93 | xlon=reform(glamt(*,0) ) & ylat=reform(gphit(0,*)) |
---|
94 | |
---|
95 | initncdf, gridout |
---|
96 | valmask=1.e20 |
---|
97 | |
---|
98 | ylat=latout |
---|
99 | xlon=lonout |
---|
100 | ncfile='!/Volumes/PRAVEEN/TropFlux/input_uncor/erai_ws_19890101_20091231_oafluxgrid.nc' |
---|
101 | |
---|
102 | lon_attr={units:'degrees_east',long_name:'Longitude'} |
---|
103 | lat_attr={units:'degrees_north',long_name:'Latitude'} |
---|
104 | time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:' 1950-JAN-01 00:00:00'} |
---|
105 | |
---|
106 | u10_attr={units:'m/s',missing_value:valmask,long_name:'10 metre u wind component',short_name:'u10',axis:'TYX'} |
---|
107 | v10_attr={units:'m/s',missing_value:valmask,long_name:'10 metre v wind component',short_name:'v10',axis:'TYX'} |
---|
108 | time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:' 1950-JAN-01 00:00:00'} |
---|
109 | globattr={source:'Tropical ocean winds obtained from ERA Interim',timerange:cda0+' - '+cda1} |
---|
110 | |
---|
111 | help, u10out,v10out,tt,xlon,ylat |
---|
112 | |
---|
113 | ncfields = 'u10[longitude,latitude,time]=u10out:u10_attr; ' $ |
---|
114 | +'v10[longitude,latitude,time]=v10out:v10_attr; ' $ |
---|
115 | + 'longitude[]=xlon:lon_attr; ' $ |
---|
116 | + 'latitude[]=ylat:lat_attr; ' $ |
---|
117 | + 'tt[*time]=tt:time_attr ' $ |
---|
118 | + ' @ globattr' |
---|
119 | |
---|
120 | @ncdf_quickwrite |
---|
121 | |
---|
122 | return |
---|
123 | end |
---|