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 | ;- |
---|
51 | function tropflux_wind_stress $ |
---|
52 | , yyyymmddb $ |
---|
53 | , yyyymmdde |
---|
54 | ; |
---|
55 | compile_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 |
---|
65 | ON_ERROR, 2 |
---|
66 | ; |
---|
67 | result = -1 |
---|
68 | ; |
---|
69 | usage = 'result = tropflux_swr_dt(yyyymmddb, yyyymmdde)' |
---|
70 | nparam = N_PARAMS() |
---|
71 | IF (nparam NE 2) THEN BEGIN |
---|
72 | ras = report(['Incorrect number of arguments.' $ |
---|
73 | + '!C' $ |
---|
74 | + 'Usage : ' + usage]) |
---|
75 | return, result |
---|
76 | ENDIF |
---|
77 | |
---|
78 | dir=project_od_env |
---|
79 | file=dir + 'TropFlux_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc' |
---|
80 | initncdf, file |
---|
81 | tau=read_ncdf("tau", yyyymmddb-.5d,yyyymmdde, file=file,/nostr) |
---|
82 | tau=reform(tau) |
---|
83 | help, tau |
---|
84 | ; |
---|
85 | file_wind=dir+'TropFlux_ws_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc' |
---|
86 | file_wg=dir+'gustiness_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc' |
---|
87 | initncdf, file_wind |
---|
88 | ; |
---|
89 | ws=read_ncdf('ws',yyyymmddb-.5d,yyyymmdde,file=file_wind,/nostr) |
---|
90 | wg=read_ncdf('wg',yyyymmddb-.5d,yyyymmdde,file=file_wg,/nostr) |
---|
91 | s=sqrt((ws*ws)+(wg*wg)) |
---|
92 | s=reform(s) |
---|
93 | help, s |
---|
94 | ; |
---|
95 | file=dir+'erai_ws_+ string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc' |
---|
96 | initncdf, file |
---|
97 | u=read_ncdf('u10',yyyymmddb-.5d,yyyymmdde,file=file,/nostr) |
---|
98 | v=read_ncdf('v10',yyyymmddb-.5d,yyyymmdde,file=file,/nostr) |
---|
99 | ; |
---|
100 | u=reform(u) |
---|
101 | v=reform(v) |
---|
102 | help, u,v |
---|
103 | taux=tau*u/s |
---|
104 | tauy=tau*v/s |
---|
105 | ; |
---|
106 | help, taux, tauy |
---|
107 | ; |
---|
108 | time=timegen(8035, start=julday(1,1,1989,0), units='days') |
---|
109 | jpt=n_elements(time) |
---|
110 | ;------------------------------------------------------------ |
---|
111 | cda0=string(jul2date(time(0)),format='(i8.8)') |
---|
112 | cda1=string(jul2date(time(jpt-1)),format='(i8.8)') |
---|
113 | time=time-julday(1,1,1950,00,00,00) |
---|
114 | xlon=reform(glamt(*,0) ) |
---|
115 | ylat=reform(gphit(0,*)) |
---|
116 | ; |
---|
117 | ncfile='!/Volumes/PAYASAM/TropFlux/ERA_C_1989_2010/tau_tropflux_1d_19890101_20101231.nc' |
---|
118 | lon_attr={units:'degrees_east',long_name:'Longitude'} |
---|
119 | lat_attr={units:'degrees_north',long_name:'Latitude'} |
---|
120 | time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:'1950-JAN-01 00:00:00'} |
---|
121 | globattr={Source:'TropFlux - Momentum Fluxes for the Global Tropics', Methodology:'Praveen Kumar et al., Clim. Dyn 2011', Producer_Agency:'Joint research colloboration between IPSL, Paris and NIO, India', Time_range:cda0+' - '+cda1, Creation_date:'20110707', Website:'http://www.locean-ipsl.upmc.fr/tropflux/'} |
---|
122 | tau_attr={units:'N/m2',missing_value:valmask,long_name:'wind stress magnitude',short_name:'tau',axis:'TYX'} |
---|
123 | taux_attr={units:'N/m2',missing_value:valmask,long_name:'zonal wind stress',short_name:'taux',axis:'TYX'} |
---|
124 | tauy_attr={units:'N/m2',missing_value:valmask,long_name:'meridional wind stress',short_name:'tauy',axis:'TYX'} |
---|
125 | ; |
---|
126 | ; |
---|
127 | help, xlon,ylat, taux, tauy, tau |
---|
128 | ; |
---|
129 | ncfields = '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 | ; |
---|
139 | result = 0 |
---|
140 | return, result |
---|
141 | ; |
---|
142 | end |
---|