source: trunk/src/interp_erai_ws_1989_2009.pro @ 15

Last change on this file since 15 was 12, checked in by pinsard, 13 years ago

fix for graph in PDF

File size: 4.4 KB
Line 
1;+
2;
3; .. _interp_erai_ws_1989_2009.pro:
4;
5; ============================
6; interp_erai_ws_1989_2009.pro
7; ============================
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;
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;
53; - fplod 20101215T112657Z aedon.locean-ipsl.upmc.fr (Darwin)
54;
55;   * add graph in header
56;
57; - fplod 20101214T093615Z aedon.locean-ipsl.upmc.fr (Darwin)
58;
59;   * minimal header
60;
61; - pbk 2008
62;
63;   * creation
64;
65;-
66pro interp_erai_ws_1989_2009
67@common
68
69st=19880101 & en=20100930
70
71filein='/Volumes/PRAVEEN/ERAI_global/20c3m_erai_u10_TROP_1989_2009.nc'
72initncdf, filein
73u10in=read_ncdf("u10",st, en,file=filein,/nostr)
74
75filein='/Volumes/PRAVEEN/ERAI_global/20c3m_erai_v10_TROP_1989_2009.nc'
76initncdf, filein
77v10in=read_ncdf("v10",st, en,file=filein,/nostr)
78
79gridout='/Volumes/PRAVEEN/work/flux_reconstruction/gridded_data/mask_oaflux_30N30S.nc'
80
81initncdf, filein
82domdef
83latin=reform(gphit(0,*)) & lonin=reform(glamt(*,0))
84print, 'lat grid ',min(latin),max(latin),latin(1)-latin(0)
85print, 'lon grid ',min(lonin),max(lonin),lonin(1)-lonin(0)
86
87timein=time & jptin=jpt
88tab=u10in(*,*,0)
89mskin=glamt*0.+1.
90
91initncdf, gridout
92domdef
93latout=reform(gphit(0,*)) & lonout=reform(glamt(*,0))
94print, 'lat grid ',min(latout),max(latout),latout(1)-latout(0)
95print, 'lon grid ',min(lonout),max(lonout),lonout(1)-lonout(0)
96mskout=read_ncdf("msk", file=gridout,/nostr)
97
98help, u10in, v10in,lonin,latin,mskin,lonout,latout,mskout
99
100si=size(u10in)
101u10out=fltarr(jpi,jpj,jptin)
102v10out=fltarr(jpi,jpj,jptin)
103
104for 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
114endfor
115
116time=timegen(7670, units='days', start=julday(1,1,1989)) & jpt=n_elements(time)
117tt=time & jptin=jpt
118cda0=string(jul2date(tt(0)),format='(i8.8)')
119cda1=string(jul2date(tt(jpt-1)),format='(i8.8)')
120tt=tt-julday(1,1,1950,00,00,00)
121xlon=reform(glamt(*,0) ) & ylat=reform(gphit(0,*))
122
123initncdf, gridout
124valmask=1.e20
125
126ylat=latout
127xlon=lonout
128ncfile='!/Volumes/PRAVEEN/TropFlux/input_uncor/erai_ws_19890101_20091231_oafluxgrid.nc'
129
130lon_attr={units:'degrees_east',long_name:'Longitude'}
131lat_attr={units:'degrees_north',long_name:'Latitude'}
132time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:' 1950-JAN-01 00:00:00'}
133
134u10_attr={units:'m/s',missing_value:valmask,long_name:'10 metre u wind component',short_name:'u10',axis:'TYX'}
135v10_attr={units:'m/s',missing_value:valmask,long_name:'10 metre v wind component',short_name:'v10',axis:'TYX'}
136time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:' 1950-JAN-01 00:00:00'}
137globattr={source:'Tropical ocean winds obtained from ERA Interim',timerange:cda0+' - '+cda1}
138
139help, u10out,v10out,tt,xlon,ylat
140
141ncfields = '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
150return
151end
Note: See TracBrowser for help on using the repository browser.