source: trunk/src/tropflux_wind_stress.pro

Last change on this file was 204, checked in by pinsard, 10 years ago

fix thanks to coding rules; typo

  • Property svn:keywords set to Id URL
File size: 3.8 KB
Line 
1;+
2;
3; .. _tropflux_wind_stress.pro:
4;
5; ========================
6; tropflux_wind_stress.pro
7; ========================
8;
9; DESCRIPTION
10; ===========
11;
12; SEE ALSO
13; ========
14;
15; TODO
16; ====
17;
18; integration to the whole process
19;
20; check existence protection
21;
22; complete header, complete data_contents.rst
23;
24; graphviz
25;
26; EVOLUTIONS
27; ==========
28;
29; $Id$
30;
31; $URL$
32;
33; - fplod 20120329
34;
35;   * pro -> func
36;   * rename with lower case TropFlux_wind_stress_19890101_20101231.pro become
37;     tropflux_wind_stress.pro
38;   * hard coded st and en replaced by yyyymmddb and yyyymmdde parameters
39;   * add compile_opt
40;   * get rid of hard coded path
41;
42; - fplod 20110830T153220Z cratos (Linux)
43;
44;   * remove multiple line statements
45;
46; - pk 20110830
47;
48;   * creation
49;
50;-
51function tropflux_wind_stress $
52, yyyymmddb $
53, yyyymmdde
54;
55compile_opt idl2, strictarrsubs, logical_predicate
56;
57@cm_4cal
58@cm_4data
59@cm_4mesh
60@cm_4data
61@cm_project
62;
63;
64; Return to caller if errors
65ON_ERROR, 2
66;
67result = -1
68;
69usage = 'result = tropflux_swr_dt(yyyymmddb, yyyymmdde)'
70nparam = N_PARAMS()
71IF (nparam NE 2) THEN BEGIN
72    ras = report(['Incorrect number of arguments.' $
73          + '!C' $
74          + 'Usage : ' + usage])
75    return, result
76ENDIF
77
78dir=project_od_env
79file=dir + 'TropFlux_' +  string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc'
80initncdf, file
81tau=read_ncdf("tau", yyyymmddb-.5d,yyyymmdde, file=file,/nostr)
82tau=reform(tau)
83help, tau
84;
85file_wind=dir+'TropFlux_ws_' +  string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc'
86file_wg=dir+'gustiness_' +  string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc'
87initncdf, file_wind
88;
89ws=read_ncdf('ws',yyyymmddb-.5d,yyyymmdde,file=file_wind,/nostr)
90wg=read_ncdf('wg',yyyymmddb-.5d,yyyymmdde,file=file_wg,/nostr)
91s=sqrt((ws*ws)+(wg*wg))
92s=reform(s)
93help, s
94;
95file=dir+'erai_ws_+  string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc'
96initncdf, file
97u=read_ncdf('u10',yyyymmddb-.5d,yyyymmdde,file=file,/nostr)
98v=read_ncdf('v10',yyyymmddb-.5d,yyyymmdde,file=file,/nostr)
99;
100u=reform(u)
101v=reform(v)
102help, u,v
103taux=tau*u/s
104tauy=tau*v/s
105;
106help, taux, tauy
107;
108time=timegen(8035, start=julday(1,1,1989,0), units='days')
109jpt=n_elements(time)
110;------------------------------------------------------------
111cda0=string(jul2date(time(0)),format='(i8.8)')
112cda1=string(jul2date(time(jpt-1)),format='(i8.8)')
113time=time-julday(1,1,1950,00,00,00)
114xlon=reform(glamt(*,0) )
115ylat=reform(gphit(0,*))
116;
117ncfile='!/Volumes/PAYASAM/TropFlux/ERA_C_1989_2010/tau_tropflux_1d_19890101_20101231.nc'
118lon_attr={units:'degrees_east',long_name:'Longitude'}
119lat_attr={units:'degrees_north',long_name:'Latitude'}
120time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:'1950-JAN-01 00:00:00'}
121globattr={Source:'TropFlux - Momentum Fluxes for the Global Tropics', Methodology:'Praveen Kumar et al., Clim. Dyn 2011', Producer_Agency:'Joint research collaboration between IPSL, Paris and NIO, India', Time_range:cda0+' - '+cda1, Creation_date:'20110707', Website:'http://www.locean-ipsl.upmc.fr/tropflux/'}
122tau_attr={units:'N/m2',missing_value:valmask,long_name:'wind stress magnitude',short_name:'tau',axis:'TYX'}
123taux_attr={units:'N/m2',missing_value:valmask,long_name:'zonal wind stress',short_name:'taux',axis:'TYX'}
124tauy_attr={units:'N/m2',missing_value:valmask,long_name:'meridional wind stress',short_name:'tauy',axis:'TYX'}
125;
126;
127help, xlon,ylat, taux, tauy, tau
128;
129ncfields = 'tau[longitude,latitude,time]=tau:tau_attr; ' $
130+'taux[longitude,latitude,time]=taux:taux_attr; ' $
131+'tauy[longitude,latitude,time]=tauy:tauy_attr; ' $
132+ 'longitude[]=xlon:lon_attr; ' $
133+ 'latitude[]=ylat:lat_attr; ' $
134+ 'time[*time]=time:time_attr ' $
135+ ' @ globattr'
136;
137@ncdf_quickwrite
138;
139result = 0
140return, result
141;
142end
Note: See TracBrowser for help on using the repository browser.