source: trunk/src/TropFlux_NRT_ncdf.pro @ 18

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

fix for graph in PDF

File size: 3.7 KB
Line 
1;+
2;
3; .. _TropFlux_NRT_ncdf_v50.pro:
4;
5; =========================
6; TropFlux_NRT_ncdf_v50.pro
7; =========================
8;
9;     .. graphviz::
10;
11;        digraph TropFlux_NRT_ncdf_v50 {
12;           graph [
13;           rankdir="LR",
14;           ]
15;           file1 [shape=ellipse,fontname=Courier,label="/Users/pkb/data/TropFlux/TropFlux_swr_19890101_20091231_BLND.nc"];
16;           file2 [shape=ellipse,fontname=Courier,label="/Users/pkb/data/TropFlux/TropFlux_lwr_19890101_20091231_v50.nc"];
17;           file3 [shape=ellipse,fontname=Courier,label="/Users/pkb/data/TropFlux/TropFlux_19890101_20091231_v51.nc"];
18;           ncfile [shape=ellipse,fontname=Courier,label="/Users/pkb/data/TropFlux/TropFlux_19890101_20091231.nc"];
19;           TropFlux_NRT_ncdf_v50  [shape=box,
20;           fontname=Courier,
21;           color=blue,
22;           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/TropFlux_NRT_ncdf_v50.pro",
23;           label="${TROPFLUX}/src/TropFlux_NRT_ncdf_v50.pro" ];
24;           {file1 file2 file3} -> {TropFlux_NRT_ncdf_v50} -> {ncfile}
25;          }
26;
27; SEE ALSO
28; ========
29;
30; EXAMPLES
31; ========
32;
33; ::
34;
35;  IDL> tropflux_nrt_ncdf_v50
36;
37; TODO
38; ====
39;
40; hard coded directory - usage of ${TROPFLUX_ID}
41;
42; coding rules
43;
44; EVOLUTIONS
45; ==========
46;
47; - fplod 20101214T112526Z aedon.locean-ipsl.upmc.fr (Darwin)
48;
49;   * add graph
50; - fplod 20101214T093615Z aedon.locean-ipsl.upmc.fr (Darwin)
51;
52;   * minimal header
53;
54; - pbk 2008
55;
56;   * creation
57;
58;-
59pro TropFlux_NRT_ncdf_v50
60@common
61
62dir="/Users/pkb/data/TropFlux/"
63file=dir+"TropFlux_swr_19890101_20091231_BLND.nc"
64initncdf, file
65st=19800101 & en=20101231
66
67swr=read_ncdf("swr", st, en, file=file,/nostr)
68
69file=dir+"TropFlux_lwr_19890101_20091231_v50.nc"
70initncdf, file
71lwr=read_ncdf("lwr", st, en, file=file,/nostr)
72
73file=dir+"TropFlux_19890101_20091231_v51.nc"
74initncdf, file
75lhf=read_ncdf("lhf", st, en, file=file,/nostr)
76shf=read_ncdf("shf", st, en, file=file,/nostr)
77
78help, swr, lwr, lhf, shf
79
80;time=julday(1,1,1989)+lindgen(7670)+0.5 & jpt=n_elements(time)
81time=timegen(7670, units='days', start=julday(1,1,1989,0)) & jpt=n_elements(time)
82
83cda0=string(jul2date(time(0)),format='(i8.8)')
84cda1=string(jul2date(time(jpt-1)),format='(i8.8)')
85
86time=time-julday(1,1,1950,00,00)
87;
88lat=reform(gphit(0,0:jpj-1))
89lon=reform(glamt(0:jpi-1,0))
90
91ncfile='!/Users/pkb/data/TropFlux/TropFlux_19890101_20091231.nc'
92lon_attr={units:'degrees_east',long_name:'Longitude'}
93lat_attr={units:'degrees_north',long_name:'Latitude'}
94time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:'1950-JAN-01 00:00:00'}
95sw_attr={units:'w/m^2',missing_value:1.e20,long_name:'Net Shortwave Radiation',short_name:'swr',axis:'TYX'}
96lw_attr={units:'w/m^2',missing_value:1.e20,long_name:'Net Longwave Radiation',short_name:'lwr',axis:'TYX'}
97sh_attr={units:'w/m^2',missing_value:1.e20,long_name:'Sensible Heat Flux',short_name:'shf',axis:'TYX'}
98lh_attr={units:'w/m^2',missing_value:1.e20,long_name:'Latent Heat Flux',short_name:'lhf',axis:'TYX'}
99
100globattr={Source:'TropFlux - Air-Sea Fluxes for the Global Tropics', Resolution:'1 x 1 degree and daily', IDL_program_name:'TropFlux_ncdf.pro',Timerange:cda0+' - '+cda1, More_Info:'ISCCP based SWR until 2007 and OLR based SWR after that with a 90 day linear transition between the two'}
101
102
103ncfields = 'swr[longitude,latitude,time]=swr:sw_attr; ' $
104          +'lwr[longitude,latitude,time]=lwr:lw_attr; ' $
105          +'lhf[longitude,latitude,time]=lhf:lh_attr; ' $
106          +'shf[longitude,latitude,time]=shf:sh_attr; ' $
107                      + 'longitude[]=lon:lon_attr; ' $
108                      + 'latitude[]=lat:lat_attr; ' $
109                      + 'time[*time]=time:time_attr ' $
110                      + ' @ globattr'
111
112@ncdf_quickwrite
113
114end
Note: See TracBrowser for help on using the repository browser.