source: trunk/src/interp_erai_lwr_1989_2009.pro @ 13

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

fix for graph in PDF

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