source: trunk/src/interp_erai_lwr_1989_2009.pro @ 9

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

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

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