function [u_sl_top, u_10_interp,x_km,z_axis,u_star] = U10_SL_calculation(input_data,u_star,x_km,u_10_mean);
x_axis=[];
z_axis=[];
u_sl_top=[];
filename=dir(['C:\Documents and Settings\sylvie.lorsolo\My Documents\research\HRD research\Gamache_soft\wfiles\',input_data.hurricane,'\',input_data.jour,'\*.w']) ;
fichier=filename(input_data.file_number).name;
tempo=input_data.file_number;
%load(['C:\Documents and Settings\sylvie.lorsolo\My Documents\research\HRD research\Gamache_soft\wfiles\',input_data.hurricane,'\',input_data.jour(1:2),'\drag_data_',fichier(10:13),'.mat']);

for i=tempo:2:tempo + 2
input_data.file_number=i;
fichier=filename(input_data.file_number).name
[ws,radwind,tangwind,w,tke, x_fill, y_fill, z_fill,L]=read_w_files(input_data);






ws_top=ws(:,2);

z=150*ones(length(x_fill),1);
u_nan = find(isnan(ws(:,2))==1);
ws_top(u_nan,1)=(ws(u_nan,3));
z(u_nan,1)=300;



if length(findstr(fichier,'inbound'))==1
    u_x=find(x_km > 0);
    u_star_input=u_star(u_x);
    xx=x_km(u_x);
    z=flipud(z(1:length(xx)));
   ws_top=flipud(ws_top(1:length(xx)));
elseif length(findstr(fichier,'outbound'))==1
    u_x=find(x_km < 0);
    u_star_input=u_star(u_x);
    xx=x_km(u_x);
    z=z(1:length(xx));
    ws_top=ws_top(1:length(xx));
end

x_axis=[x_axis;xx];
z_axis=[z_axis;z];
u_sl_top = [u_sl_top;ws_top];


end
u_10_interp=u_sl_top + (u_star./0.4).*log(10*ones(length(z_axis),1)./z_axis);

plot(x_km,u_10_interp,'.-g')
hold on
plot(x_km,u_10_mean,'.-r')
plot(x_km,u_sl_top,'.-b')