source: trunk/src/TropFlux_NRT_ncdf.pro @ 81

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

progress on swr and olr processing

File size: 4.0 KB
Line 
1;+
2;
3; .. _TropFlux_NRT_ncdf.pro:
4;
5; =====================
6; TropFlux_NRT_ncdf.pro
7; =====================
8;
9;     .. graphviz::
10;
11;        digraph tropflux_nrt_ncdf {
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;
20;           tropflux_nrt_ncdf [shape=box,
21;           fontname=Courier,
22;           color=blue,
23;           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/TropFlux_NRT_ncdf.pro",
24;           label="${PROJECT}/src/TropFlux_NRT_ncdf.pro" ];
25;
26;           {file1 file2 file3} -> {tropflux_nrt_ncdf} -> {ncfile}
27;          }
28;
29; SEE ALSO
30; ========
31;
32; :func:`initncdf <saxo:initncdf>`
33; :func:`read_ncdf <saxo:read_ncdf>`
34; :func:`julday <saxo:julday>`
35; :func:`jul2date <saxo:jul2date>`
36; :func:`ncdf_quickwrite <saxo:ncdf_quickwrite>`
37;
38; EXAMPLES
39; ========
40;
41; ::
42;
43;  IDL> tropflux_nrt_ncdf
44;
45; TODO
46; ====
47;
48; hard coded directory - usage of ${PROJECT_ID}
49;
50; coding rules
51;
52; create 4 files instead of one now
53;
54; EVOLUTIONS
55; ==========
56;
57; $Id$
58;
59; $URL$
60;
61; - fplod 20110809T133815Z cratos (Linux)
62;
63;   * remove v50 from pro name and in the graph
64;
65; - fplod 20101214T112526Z aedon.locean-ipsl.upmc.fr (Darwin)
66;
67;   * add graph
68;
69; - fplod 20101214T093615Z aedon.locean-ipsl.upmc.fr (Darwin)
70;
71;   * minimal header
72;
73; - pbk 2008
74;
75;   * creation
76;
77;-
78pro TropFlux_NRT_ncdf
79@common
80
81dir="/Users/pkb/data/TropFlux/"
82file=dir+"TropFlux_swr_19890101_20091231_BLND.nc"
83initncdf, file
84st=19800101 & en=20101231
85
86swr=read_ncdf("swr", st, en, file=file,/nostr)
87
88file=dir+"TropFlux_lwr_19890101_20091231_v50.nc"
89initncdf, file
90lwr=read_ncdf("lwr", st, en, file=file,/nostr)
91
92file=dir+"TropFlux_19890101_20091231_v51.nc"
93initncdf, file
94lhf=read_ncdf("lhf", st, en, file=file,/nostr)
95shf=read_ncdf("shf", st, en, file=file,/nostr)
96
97help, swr, lwr, lhf, shf
98
99;time=julday(1,1,1989)+lindgen(7670)+0.5 & jpt=n_elements(time)
100time=timegen(7670, units='days', start=julday(1,1,1989,0)) & jpt=n_elements(time)
101
102cda0=string(jul2date(time(0)),format='(i8.8)')
103cda1=string(jul2date(time(jpt-1)),format='(i8.8)')
104
105time=time-julday(1,1,1950,00,00)
106;
107lat=reform(gphit(0,0:jpj-1))
108lon=reform(glamt(0:jpi-1,0))
109
110ncfile='!/Users/pkb/data/TropFlux/TropFlux_19890101_20091231.nc'
111lon_attr={units:'degrees_east',long_name:'Longitude'}
112lat_attr={units:'degrees_north',long_name:'Latitude'}
113time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:'1950-JAN-01 00:00:00'}
114sw_attr={units:'w/m^2',missing_value:1.e20,long_name:'Net Shortwave Radiation',short_name:'swr',axis:'TYX'}
115lw_attr={units:'w/m^2',missing_value:1.e20,long_name:'Net Longwave Radiation',short_name:'lwr',axis:'TYX'}
116sh_attr={units:'w/m^2',missing_value:1.e20,long_name:'Sensible Heat Flux',short_name:'shf',axis:'TYX'}
117lh_attr={units:'w/m^2',missing_value:1.e20,long_name:'Latent Heat Flux',short_name:'lhf',axis:'TYX'}
118
119globattr={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'}
120
121
122ncfields = 'swr[longitude,latitude,time]=swr:sw_attr; ' $
123          +'lwr[longitude,latitude,time]=lwr:lw_attr; ' $
124          +'lhf[longitude,latitude,time]=lhf:lh_attr; ' $
125          +'shf[longitude,latitude,time]=shf:sh_attr; ' $
126                      + 'longitude[]=lon:lon_attr; ' $
127                      + 'latitude[]=lat:lat_attr; ' $
128                      + 'time[*time]=time:time_attr ' $
129                      + ' @ globattr'
130
131@ncdf_quickwrite
132
133end
Note: See TracBrowser for help on using the repository browser.