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