source: trunk/src/interp_erai_ws_1989_2009.pro @ 11

Last change on this file since 11 was 9, checked in by pinsard, 13 years ago

add some graph - io - in headers (cont.)

File size: 4.5 KB
Line 
1;+
2;
3; .. _interp_erai_ws_1989_2009.pro:
4;
5; ============================
6; interp_erai_ws_1989_2009.pro
7; ============================
8;
9; .. only:: man
10;
11; Figure is visible on PDF and HTML documents only.
12;
13; .. only:: html
14;
15;     .. graphviz::
16;
17;        digraph interp_erai_ws_1989_2009 {
18;           graph [
19;           rankdir="LR",
20;           ]
21;           file_u10 [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/ERAI_global/20c3m_erai_u10_TROP_1989_2009.nc"];
22;           file_v10 [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/ERAI_global/20c3m_erai_v10_TROP_1989_2009.nc"];
23;
24;           mask [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/work/flux_reconstruction/gridded_data/mask_oaflux_30N30S.nc"];
25;
26;           ncfile [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/TropFlux/input_uncor/erai_ws_19890101_20091231_oafluxgrid.nc"];
27;
28;           interp_erai_ws_1989_2009 [shape=box,
29;           fontname=Courier,
30;           color=blue,
31;           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/interp_erai_ws_1989_2009.pro",
32;           label="${TROPFLUX}/src/interp_erai_ws_1989_2009.pro"];
33;
34;           {file_u10 file_v10 mask} -> {interp_erai_ws_1989_2009} -> {ncfile}
35;
36;        }
37;
38; SEE ALSO
39; ========
40;
41; EXAMPLES
42; ========
43;
44; ::
45;
46;  IDL> interp_erai_ws_1989_2009
47;
48;
49; TODO
50; ====
51;
52; hard coded directory - usage of ${TROPFLUX_ID}
53;
54; coding rules
55;
56; EVOLUTIONS
57; ==========
58;
59; - fplod 20101215T112657Z aedon.locean-ipsl.upmc.fr (Darwin)
60;
61;   * add graph in header
62;
63; - fplod 20101214T093615Z aedon.locean-ipsl.upmc.fr (Darwin)
64;
65;   * minimal header
66;
67; - pbk 2008
68;
69;   * creation
70;
71;-
72pro interp_erai_ws_1989_2009
73@common
74
75st=19880101 & en=20100930
76
77filein='/Volumes/PRAVEEN/ERAI_global/20c3m_erai_u10_TROP_1989_2009.nc'
78initncdf, filein
79u10in=read_ncdf("u10",st, en,file=filein,/nostr)
80
81filein='/Volumes/PRAVEEN/ERAI_global/20c3m_erai_v10_TROP_1989_2009.nc'
82initncdf, filein
83v10in=read_ncdf("v10",st, en,file=filein,/nostr)
84
85gridout='/Volumes/PRAVEEN/work/flux_reconstruction/gridded_data/mask_oaflux_30N30S.nc'
86
87initncdf, filein
88domdef
89latin=reform(gphit(0,*)) & lonin=reform(glamt(*,0))
90print, 'lat grid ',min(latin),max(latin),latin(1)-latin(0)
91print, 'lon grid ',min(lonin),max(lonin),lonin(1)-lonin(0)
92
93timein=time & jptin=jpt
94tab=u10in(*,*,0)
95mskin=glamt*0.+1.
96
97initncdf, gridout
98domdef
99latout=reform(gphit(0,*)) & lonout=reform(glamt(*,0))
100print, 'lat grid ',min(latout),max(latout),latout(1)-latout(0)
101print, 'lon grid ',min(lonout),max(lonout),lonout(1)-lonout(0)
102mskout=read_ncdf("msk", file=gridout,/nostr)
103
104help, u10in, v10in,lonin,latin,mskin,lonout,latout,mskout
105
106si=size(u10in)
107u10out=fltarr(jpi,jpj,jptin)
108v10out=fltarr(jpi,jpj,jptin)
109
110for jt=0,jptin-1 do begin
111  print, 'Interpolation jt=',jt,' / ',jptin-1
112  tab=reform(u10in(*,*,jt))
113  u10out(*,*,jt)=call_interp2d(tab,lonin,latin,mskin,lonout,latout,method='bilinear')
114  u10out(*,*,jt)=u10out(*,*,jt)*mskout+(1.-mskout)*1.e20
115
116  tab=reform(v10in(*,*,jt))
117  v10out(*,*,jt)=call_interp2d(tab,lonin,latin,mskin,lonout,latout,method='bilinear')
118  v10out(*,*,jt)=v10out(*,*,jt)*mskout+(1.-mskout)*1.e20
119
120endfor
121
122time=timegen(7670, units='days', start=julday(1,1,1989)) & jpt=n_elements(time)
123tt=time & jptin=jpt
124cda0=string(jul2date(tt(0)),format='(i8.8)')
125cda1=string(jul2date(tt(jpt-1)),format='(i8.8)')
126tt=tt-julday(1,1,1950,00,00,00)
127xlon=reform(glamt(*,0) ) & ylat=reform(gphit(0,*))
128
129initncdf, gridout
130valmask=1.e20
131
132ylat=latout
133xlon=lonout
134ncfile='!/Volumes/PRAVEEN/TropFlux/input_uncor/erai_ws_19890101_20091231_oafluxgrid.nc'
135
136lon_attr={units:'degrees_east',long_name:'Longitude'}
137lat_attr={units:'degrees_north',long_name:'Latitude'}
138time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:' 1950-JAN-01 00:00:00'}
139
140u10_attr={units:'m/s',missing_value:valmask,long_name:'10 metre u wind component',short_name:'u10',axis:'TYX'}
141v10_attr={units:'m/s',missing_value:valmask,long_name:'10 metre v wind component',short_name:'v10',axis:'TYX'}
142time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:' 1950-JAN-01 00:00:00'}
143globattr={source:'Tropical ocean winds obtained from ERA Interim',timerange:cda0+' - '+cda1}
144
145help, u10out,v10out,tt,xlon,ylat
146
147ncfields = 'u10[longitude,latitude,time]=u10out:u10_attr; ' $
148          +'v10[longitude,latitude,time]=v10out:v10_attr; ' $
149                      + 'longitude[]=xlon:lon_attr; ' $
150                      + 'latitude[]=ylat:lat_attr; ' $
151                      + 'tt[*time]=tt:time_attr ' $
152                      + ' @ globattr'
153
154@ncdf_quickwrite
155
156return
157end
Note: See TracBrowser for help on using the repository browser.