source: trunk/src/ws_tropflux_1d_to_1m_ncdf.pro @ 82

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

add new tools from PK

  • Property svn:keywords set to URL
File size: 1.9 KB
Line 
1pro ws_tropflux_1d_to_1m_ncdf
2@common
3;-----------------------------------------------------------------------------
4file="/Volumes/PAYASAM/TropFlux/ERA_C_1989_2010/ws_tropflux_1d_1989_2010.nc"
5initncdf, file
6st=19890101 & en=20101231
7ws=read_ncdf("ws", st, en, file=file,/nostr)
8
9help, ws
10
11tt=time
12;
13;; Monthly data
14;
15jpt=22*12. & time=timegen(jpt,start=julday(1,15,1989),units='Months')
16caldat, tt,m,d,y
17caldat, time, mon,day,yea
18
19wsm=fltarr(nxt,nyt,jpt)
20
21for jt=0,jpt-1 do begin
22
23   ind=where((m eq mon(jt)) and (y eq yea(jt)))
24   wsm(*,*,jt)=total(ws(*,*,ind),3)/n_elements(ind)
25
26endfor
27
28
29;-----------------------------------------------------------------------------
30cda0=string(jul2date(time(0)),format='(i8.8)')
31cda1=string(jul2date(time(jpt-1)),format='(i8.8)')
32time=time-julday(1,1,1950,00,00,00)
33xlon=reform(glamt(firstxt:lastxt,0) ) & ylat=reform(gphit(0,firstyt:lastyt))
34
35ncfile='!/Volumes/PAYASAM/TropFlux/ERA_C_1989_2010/ws_tropflux_1m_1989_2010.nc'
36
37lon_attr={units:'degrees_east',long_name:'Longitude'}
38lat_attr={units:'degrees_north',long_name:'Latitude'}
39
40time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:'1950-JAN-01 00:00:00'}
41ws_attr={units:'m/s',missing_value:1.e20,long_name:'Mean wind speed at 10m height',short_name:'ws',axis:'TYX'}
42globattr={Source:'TropFlux - Air-Sea Fluxes for the Global Tropics', Metodology:'Praveen Kumar et al., Clim. Dyn 2011', Producer_Agency:'Joint research colloboration between IPSL, Paris and NIO, India', Time_range:cda0+' - '+cda1, Creation_date:'20110815', Website:'http://www.locean-ipsl.upmc.fr/tropflux/'}
43
44
45ncfields = 'ws[longitude,latitude,time]=wsm:ws_attr; ' $
46                      + 'longitude[]=xlon:lon_attr; ' $
47                      + 'latitude[]=ylat:lat_attr; ' $
48                      + 'time[*time]=time:time_attr ' $
49                      + ' @ globattr'
50
51@ncdf_quickwrite
52
53;------------------------------------------------------------
54return
55
56end
57
Note: See TracBrowser for help on using the repository browser.