source: trunk/src/interp_erai_dewt_1989_2009.pro @ 11

Last change on this file since 11 was 8, 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_dewt_1989_2009.pro:
4;
5; ==============================
6; interp_erai_dewt_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_dewt_1989_2009 {
19;           graph [
20;           rankdir="LR",
21;           ]
22;           file_in [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/ERAI_global/20c3m_erai_d2_TROP_1989_2009.nc"];
23;           mask [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/work/flux_reconstruction/gridded_data/mask_oaflux_30N30S.nc"];
24;
25;           file_out [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/TropFlux/input_uncor/erai_d2m_19890101_20091231_oafluxgrid.nc"];
26;           interp_erai_dewt_1989_2009 [shape=box,
27;           fontname=Courier,
28;           color=blue,
29;           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/interp_erai_dewt_1989_2009.pro",
30;           label="${TROPFLUX}/src/interp_erai_dewt_1989_2009.pro"];
31;
32;           {file_in mask} -> {interp_erai_dewt_1989_2009} -> {file_out}
33;
34;       }
35;
36; SEE ALSO
37; ========
38;
39; EXAMPLES
40; ========
41;
42; ::
43;
44;  IDL> interp_erai_dewt_1989_2009
45;
46; TODO
47; ====
48;
49; hard coded directory - usage of ${TROPFLUX_ID}
50;
51; coding rules
52;
53; EVOLUTIONS
54; ==========
55;
56; - fplod 20101215T093710Z aedon.locean-ipsl.upmc.fr (Darwin)
57;
58;   * add graph in header
59;
60; - fplod 20101214T093615Z aedon.locean-ipsl.upmc.fr (Darwin)
61;
62;   * minimal header
63;
64; - pbk 2008
65;
66;   * creation
67;
68;-
69pro interp_erai_dewt_1989_2009
70@common
71
72filein='/Volumes/PRAVEEN/ERAI_global/20c3m_erai_d2_TROP_1989_2009.nc'
73gridout='/Volumes/PRAVEEN/work/flux_reconstruction/gridded_data/mask_oaflux_30N30S.nc'
74
75initncdf, filein
76domdef
77latin=reform(gphit(0,*)) & lonin=reform(glamt(*,0))
78print, 'lat grid ',min(latin),max(latin),latin(1)-latin(0)
79print, 'lon grid ',min(lonin),max(lonin),lonin(1)-lonin(0)
80d2min=read_ncdf("d2",19881201,20101231,file=filein,/nostr)
81
82timein=time & jptin=jpt
83tab=d2min(*,*,0)
84mskin=glamt*0.+1.
85
86initncdf, gridout
87domdef
88latout=reform(gphit(0,*)) & lonout=reform(glamt(*,0))
89print, 'lat grid ',min(latout),max(latout),latout(1)-latout(0)
90print, 'lon grid ',min(lonout),max(lonout),lonout(1)-lonout(0)
91mskout=read_ncdf("msk", file=gridout,/nostr)
92
93help, d2min,lonin,latin,mskin,lonout,latout,mskout
94
95si=size(d2min)
96d2mout=fltarr(jpi,jpj,jptin)
97for jt=0,jptin-1 do begin
98  print, 'Interpolation jt=',jt,' / ',jptin-1
99  tab=reform(d2min(*,*,jt))
100  d2mout(*,*,jt)=call_interp2d(tab,lonin,latin,mskin,lonout,latout,method='bilinear')
101  d2mout(*,*,jt)=d2mout(*,*,jt)*mskout+(1.-mskout)*1.e20
102endfor
103
104
105timein=timein & jptin=jpt
106
107initncdf, gridout
108cda0=string(jul2date(timein(0)),format='(i8.8)')
109cda1=string(jul2date(timein(jpt-1)),format='(i8.8)')
110
111time=timegen(7670, units='days', start=julday(1,1,1989)) & jpt=n_elements(time)
112cda0=string(jul2date(time(0)),format='(i8.8)')
113cda1=string(jul2date(time(jpt-1)),format='(i8.8)')
114timein=time-julday(1,1,1950,00,00)
115
116lat=latout
117lon=lonout
118ncfile='!/Volumes/PRAVEEN/TropFlux/input_uncor/erai_d2m_19890101_20091231_oafluxgrid.nc'
119lon_attr={units:'degrees_east',long_name:'Longitude'}
120lat_attr={units:'degrees_north',long_name:'Latitude'}
121time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:' 1950-JAN-01 00:00:00'}
122d2m_attr={units:'degK',missing_value:1e20,long_name:'Dew Point Temperature at 2m',short_name:'d2m',axis:'TYX'}
123globattr={source:'Data are from ECMWF ERA-Interim reanalysis', timerange:cda0+' - '+cda1}
124
125
126ncfields = 'd2m[longitude,latitude,time]=d2mout:d2m_attr; ' $
127                      + 'longitude[]=lon:lon_attr; ' $
128                      + 'latitude[]=lat:lat_attr; ' $
129                      + 'time[*time]=timein:time_attr ' $
130                      + ' @ globattr'
131
132@ncdf_quickwrite
133
134
135end
Note: See TracBrowser for help on using the repository browser.