;+ ; ; .. _ws_correction_ncdf.pro: ; ; ====================== ; ws_correction_ncdf.pro ; ====================== ; ; .. graphviz:: ; ; digraph ws_correction_ncdf { ; graph [ ; rankdir="LR", ; ] ; file_in [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/TropFlux/input_uncor/erai_ws_19890101_20091231_oafluxgrid.nc"]; ; ncfile [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/TropFlux/input_cor/full_cor/TropFlux_ws_19890101_20091231_v20.nc"]; ; ws_correction_ncdf [shape=box, ; fontname=Courier, ; color=blue, ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/ws_correction_ncdf.pro", ; label="${TROPFLUX}/src/ws_correction_ncdf.pro"]; ; ; {file_in} -> {ws_correction_ncdf} -> {ncfile} ; ; } ; ; SEE ALSO ; ======== ; ; EXAMPLES ; ======== ; ; :: ; ; IDL> ws_correction_ncdf ; ; TODO ; ==== ; ; hard coded directory - usage of ${TROPFLUX_ID} ; ; coding rules ; ; EVOLUTIONS ; ========== ; ; - fplod 20101215T115916Z aedon.locean-ipsl.upmc.fr (Darwin) ; ; * add graph in header ; ; - fplod 20101214T093615Z aedon.locean-ipsl.upmc.fr (Darwin) ; ; * minimal header ; ; - pbk 2008 ; ; * creation ; ;- pro ws_correction_ncdf @common da1=19880101 & da2=20101231 file='/Volumes/PRAVEEN/TropFlux/input_uncor/erai_ws_19890101_20091231_oafluxgrid.nc' initncdf, file u=read_ncdf('u10',da1,da2,file=file,/nostr) v=read_ncdf('v10',da1,da2,file=file,/nostr) w=sqrt(u*u+v*v) help, w w_mean=grossemoyenne(w,'t',/nan) help, w_mean tt=time & jpt=n_elements(time) caldat, time,mon,day,yea w_m=w*0. for jt=0,jpt-1 do begin jtt=(time(jt)-julday(1,1,yea(jt))) < 364 q=reform(w_mean(*,*)) w_m(*,*,jt)=q endfor help, w_m w_ano=w-w_m ;; correction for mean based on scatter ;w_m=w_m+0.282667 ;; (2000-2008) w_m=w_m+0.276739 ;; (2000-2009) help, w_ano ;; applying the correction for varyability based on the scatter ;w_ano=w_ano*(1/0.897667) ;; (2000-2008) w_ano=w_ano*(1/0.903587) ;; (2000-2009) w_new=w_m+w_ano help, w_new ;writing field lat=reform(gphit(0,0:jpj-1)) lon=reform(glamt(0:jpi-1,0)) time=timegen(7670, units='days', start=julday(1,1,1989,0)) & 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) & jpt=n_elements(time) ncfile='!/Volumes/PRAVEEN/TropFlux/input_cor/full_cor/TropFlux_ws_19890101_20091231_v20.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'} w_attr={units:'m/s',missing_value:1.e20,long_name:'mean wind speed',short_name:'w',axis:'TYX'} globattr={source:'Basic data obtained from ERAI. Bias and variability correction are applied',timerange:cda0+' - '+cda1} ncfields = 'ws[longitude,latitude,time]=w_new:w_attr; ' $ + 'longitude[]=lon:lon_attr; ' $ + 'latitude[]=lat:lat_attr; ' $ + 'time[*time]=time:time_attr ' $ + ' @ globattr' @ncdf_quickwrite end