source: trunk/src/interp_erai_t2m_1989_2009.pro @ 14

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

fix for graph in PDF

File size: 3.6 KB
Line 
1;+
2;
3; .. interp_erai_t2m_1989_2009.pro:
4;
5; =============================
6; interp_erai_t2m_1989_2009.pro
7; =============================
8;
9;
10;     .. graphviz::
11;
12;        digraph interp_erai_t2m_1989_2009 {
13;           graph [
14;           rankdir="LR",
15;           ]
16;           file_in [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/ERAI_global/20c3m_erai_t2_TROP_1989_2009.nc"];
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_t2m_19890101_20091231_oafluxgrid.nc"];
20;
21;           interp_erai_t2m_1989_2009 [shape=box,
22;           fontname=Courier,
23;           color=blue,
24;           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/interp_erai_t2m_1989_2009.pro"",
25;           label="${TROPFLUX}/src/interp_erai_t2m_1989_2009.pro"];
26;
27;           {file_in mask} -> {interp_erai_t2m_1989_2009} -> {ncfile}
28;
29;          }
30;
31;
32; SEE ALSO
33; ========
34;
35; EXAMPLES
36; ========
37;
38; ::
39;
40;  IDL> interp_erai_t2m_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 20101215T112140Z 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_t2m_1989_2009
67@common
68
69filein='/Volumes/PRAVEEN/ERAI_global/20c3m_erai_t2_TROP_1989_2009.nc'
70gridout='/Volumes/PRAVEEN/work/flux_reconstruction/gridded_data/mask_oaflux_30N30S.nc'
71
72initncdf, filein
73domdef
74latin=reform(gphit(0,*)) & lonin=reform(glamt(*,0))
75print, 'lat grid ',min(latin),max(latin),latin(1)-latin(0)
76print, 'lon grid ',min(lonin),max(lonin),lonin(1)-lonin(0)
77t2min=read_ncdf("t2",19880101,20100930,file=filein,/nostr)
78
79timein=time & jptin=jpt
80tab=t2min(*,*,0)
81mskin=glamt*0.+1.
82
83initncdf, gridout
84domdef
85latout=reform(gphit(0,*)) & lonout=reform(glamt(*,0))
86print, 'lat grid ',min(latout),max(latout),latout(1)-latout(0)
87print, 'lon grid ',min(lonout),max(lonout),lonout(1)-lonout(0)
88mskout=read_ncdf("msk", file=gridout,/nostr)
89
90help, t2min,lonin,latin,mskin,lonout,latout,mskout
91si=size(t2min)
92t2mout=fltarr(jpi,jpj,jptin)
93for jt=0,jptin-1 do begin
94  print, 'Interpolation jt=',jt,' / ',jptin-1
95  tab=reform(t2min(*,*,jt))
96  t2mout(*,*,jt)=call_interp2d(tab,lonin,latin,mskin,lonout,latout,method='bilinear')
97  t2mout(*,*,jt)=t2mout(*,*,jt)*mskout+(1.-mskout)*1.e20
98endfor
99
100timein=timein & jptin=jpt
101
102initncdf, gridout
103help, t2mout
104tt=timein
105time=julday(1,1,1989)+lindgen(7670)+0.5 & jpt=n_elements(time)
106;cda0=string(jul2date(time(0)),format='(i8.8)')
107;cda1=string(jul2date(time(jpt-1)),format='(i8.8)')
108;cda0=string('19890101') & cda1=string('20091231')
109
110timein=time-julday(1,1,1950,00,00)
111
112lat=latout
113lon=lonout
114ncfile='!/Volumes/PRAVEEN/TropFlux/input_uncor/erai_t2m_19890101_20091231_oafluxgrid.nc'
115lon_attr={units:'degrees_east',long_name:'Longitude'}
116lat_attr={units:'degrees_north',long_name:'Latitude'}
117time_attr={units:'hours since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:' 1950-JAN-01 00:00:00'}
118t2m_attr={units:'degK',missing_value:1e20,long_name:'Air Temperature at 2m',short_name:'t2m',axis:'TYX'}
119globattr={source:'Data are from ECMWF ERA-Interim reanalysis', timerange:cda0+' - '+cda1}
120
121
122ncfields = 't2m[longitude,latitude,time]=t2mout:t2m_attr; ' $
123                      + 'longitude[]=lon:lon_attr; ' $
124                      + 'latitude[]=lat:lat_attr; ' $
125                      + 'time[*time]=timein:time_attr ' $
126                      + ' @ globattr'
127
128@ncdf_quickwrite
129
130
131end
Note: See TracBrowser for help on using the repository browser.