source: trunk/src/interp_erai_sst_1989_2009.pro @ 16

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

fix for graph in PDF

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