;+ ; ; .. _tropflux_wind_stress.pro: ; ; ======================== ; tropflux_wind_stress.pro ; ======================== ; ; DESCRIPTION ; =========== ; ; SEE ALSO ; ======== ; ; TODO ; ==== ; ; integration to the whole process ; ; check existence protection ; ; complete header, complete data_contents.rst ; ; graphviz ; ; EVOLUTIONS ; ========== ; ; $Id$ ; ; $URL$ ; ; - fplod 20120329 ; ; * pro -> func ; * rename with lower case TropFlux_wind_stress_19890101_20101231.pro become ; tropflux_wind_stress.pro ; * hard coded st and en replaced by yyyymmddb and yyyymmdde parameters ; * add compile_opt ; * get rid of hard coded path ; ; - fplod 20110830T153220Z cratos (Linux) ; ; * remove multiple line statements ; ; - pk 20110830 ; ; * creation ; ;- function tropflux_wind_stress $ , yyyymmddb $ , yyyymmdde ; compile_opt idl2, strictarrsubs, logical_predicate ; @cm_4cal @cm_4data @cm_4mesh @cm_4data @cm_project ; ; ; Return to caller if errors ON_ERROR, 2 ; result = -1 ; usage = 'result = tropflux_swr_dt(yyyymmddb, yyyymmdde)' nparam = N_PARAMS() IF (nparam NE 2) THEN BEGIN ras = report(['Incorrect number of arguments.' $ + '!C' $ + 'Usage : ' + usage]) return, result ENDIF dir=project_od_env file=dir + 'TropFlux_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc' initncdf, file tau=read_ncdf("tau", yyyymmddb-.5d,yyyymmdde, file=file,/nostr) tau=reform(tau) help, tau ; file_wind=dir+'TropFlux_ws_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc' file_wg=dir+'gustiness_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc' initncdf, file_wind ; ws=read_ncdf('ws',yyyymmddb-.5d,yyyymmdde,file=file_wind,/nostr) wg=read_ncdf('wg',yyyymmddb-.5d,yyyymmdde,file=file_wg,/nostr) s=sqrt((ws*ws)+(wg*wg)) s=reform(s) help, s ; file=dir+'erai_ws_+ string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc' initncdf, file u=read_ncdf('u10',yyyymmddb-.5d,yyyymmdde,file=file,/nostr) v=read_ncdf('v10',yyyymmddb-.5d,yyyymmdde,file=file,/nostr) ; u=reform(u) v=reform(v) help, u,v taux=tau*u/s tauy=tau*v/s ; help, taux, tauy ; time=timegen(8035, start=julday(1,1,1989,0), units='days') jpt=n_elements(time) ;------------------------------------------------------------ cda0=string(jul2date(time(0)),format='(i8.8)') cda1=string(jul2date(time(jpt-1)),format='(i8.8)') time=time-julday(1,1,1950,00,00,00) xlon=reform(glamt(*,0) ) ylat=reform(gphit(0,*)) ; ncfile='!/Volumes/PAYASAM/TropFlux/ERA_C_1989_2010/tau_tropflux_1d_19890101_20101231.nc' lon_attr={units:'degrees_east',long_name:'Longitude'} lat_attr={units:'degrees_north',long_name:'Latitude'} time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:'1950-JAN-01 00:00:00'} globattr={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/'} tau_attr={units:'N/m2',missing_value:valmask,long_name:'wind stress magnitude',short_name:'tau',axis:'TYX'} taux_attr={units:'N/m2',missing_value:valmask,long_name:'zonal wind stress',short_name:'taux',axis:'TYX'} tauy_attr={units:'N/m2',missing_value:valmask,long_name:'meridional wind stress',short_name:'tauy',axis:'TYX'} ; ; help, xlon,ylat, taux, tauy, tau ; ncfields = 'tau[longitude,latitude,time]=tau:tau_attr; ' $ +'taux[longitude,latitude,time]=taux:taux_attr; ' $ +'tauy[longitude,latitude,time]=tauy:tauy_attr; ' $ + 'longitude[]=xlon:lon_attr; ' $ + 'latitude[]=ylat:lat_attr; ' $ + 'time[*time]=time:time_attr ' $ + ' @ globattr' ; @ncdf_quickwrite ; result = 0 return, result ; end