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