function [rms, rre, corr_coeff]=osse_eval(file_wrf,folder_name, file_number, trackp, displace,pasx,pasz)
folder_wrf='C:\Documents and Settings\lorsolo\My Documents\research\HRD research\wind field Simulation (Ping)\';
filename=dir(['C:\Documents and Settings\lorsolo\My Documents\research\HRD research\Gamache_soft\wfiles\',folder_name,'\*.w']);
name1=filename(file_number).name
load([folder_wrf,file_wrf]);
[ws_analys,wd_analys,w_analys,dbz, x_fill, y_fill, z_fill]=read_w_files(folder_name, file_number);
w_analys=squeeze(w_analys(:,3,:));
[u_alongy,v_alongy]=wind_decomposition(squeeze(wd_analys(:,3,:)),squeeze(ws_analys(:,3,:)));
wd_analys=squeeze(wd_analys(:,3,:))+trackp;
ws_analys=squeeze(ws_analys(:,3,:));
[u_analys,v_analys]=wind_decomposition(wd_analys,ws_analys);

ws_grid=(u_grid.^2 +v_grid.^2).^0.5;
[hd,zd,uu]=cross_sect_maker(u_grid,x_3dgrid,y_3dgrid,z_3dgrid,displace,trackp,pasx,pasz);
[hd,zd,vv]=cross_sect_maker(v_grid,x_3dgrid,y_3dgrid,z_3dgrid,displace,trackp,pasx,pasz);
[hd,zd,ww]=cross_sect_maker(w_grid,x_3dgrid,y_3dgrid,z_3dgrid,displace,trackp,pasx,pasz);
[hd,zd,wws]=cross_sect_maker(ws_grid,x_3dgrid,y_3dgrid,z_3dgrid,displace,trackp,pasx,pasz);

[li_analys,col_analys]=size(u_analys);
[li_true,col_true]=size(ww);

if li_true> li_analys
    li=li_analys;
else
    li=li_true;
end

if col_true> col_analys
    col=col_analys;
else
    col=col_true;
end
%li=21;
    w_analys=[NaN*ones(1,col);w_analys];
   ws_analys=[NaN*ones(1,col);ws_analys];
   v_alongy=[NaN*ones(1,col);v_alongy];
    u_edge=find(w_analys>5| w_analys <-5);
    w_analys(u_edge)=NaN;
    v_alongy(u_edge)=NaN;
temp=(u_analys(1:li,1:col)-uu(1:li,1:col));
temp=find(isnan(temp)~=1);
N=length(temp);

 rms(1)= ((nansum(nansum((u_analys(1:li,1:col)-uu(1:li,1:col)).^2)) + nansum(nansum((v_analys(1:li,1:col)-vv(1:li,1:col)).^2)))/(2*N))^0.5;
 rms(2)=((nansum(nansum((w_analys(1:li,1:col)-ww(1:li,1:col)).^2)))/N)^0.5;

rre(1)=((nansum(nansum((u_analys(1:li,1:col)-uu(1:li,1:col)).^2)) + nansum(nansum((v_analys(1:li,1:col)-vv(1:li,1:col)).^2)))/(nansum(nansum((uu(1:li,1:col)).^2)) + nansum(nansum((vv(1:li,1:col)).^2))))^0.5;
rre(2)=((nansum(nansum((w_analys(1:li,1:col)-ww(1:li,1:col)).^2)))/nansum(nansum((ww(1:li,1:col)).^2)))^0.5;

% contourf(y_fill(1:li),z_fill(1:col),(ws_analys(1:li,1:col)-wws(1:li,1:col))',20);
% shading flat
% figure 
% contourf(y_fill(1:li),z_fill(1:col),(w_analys(1:li,1:col)-ww(1:li,1:col))',20);
% shading flat



tempu=corrcoef(reshape(u_analys(1:li,1:col),li*col,1),reshape(uu(1:li,1:col),li*col,1),'rows','complete');

tempv=corrcoef(reshape(v_analys(1:li,1:col),li*col,1),reshape(vv(1:li,1:col),li*col,1),'rows','complete');


corr_coeff(1)=(tempu(1,2)+tempv(1,2))/2;
tempw=corrcoef(reshape(w_analys(1:li,1:col),li*col,1),reshape(ww(1:li,1:col),li*col,1),'rows','complete');;
corr_coeff(2)=tempw(1,2);


%--------------------Plot

h=figure;
subplot(2,1,1)
contourf(y_fill(1:li),z_fill(1:col),ws_analys(1:li,1:col)',20);
shading flat
caxis([35 78]);%caxis([25 80]); %
colorbar
hold on
[yf,zf]=meshgrid(y_fill(1:li),z_fill(1:col));
quiver(yf(2:col,1:li),zf(2:col,1:li),v_alongy(1:li,2:col)',w_analys(1:li,2:col)');
  xlabel('Along track distance (m)','FontSize',11,'FontWeigh','bold')
    ylabel('Height (m)','FontSize',11,'FontWeigh','bold')
    
    subplot(2,1,2)
    contourf(y_fill(1:li),z_fill(1:col),wws(1:li,1:col)',20);
shading flat
caxis([35 78]);%caxis([25 82]) %
vh=uu(1:li,1:col)*cos(deg2rad(90-trackp))+vv(1:li,1:col)*sin(deg2rad(90-trackp));
hold on
 quiver(yf,zf,vh',ww(1:li,1:col)');
colorbar
 xlabel('Along track distance (m)','FontSize',11,'FontWeigh','bold')
    ylabel('Height (m)','FontSize',11,'FontWeigh','bold')
    saveas(h,['C:\Documents and Settings\lorsolo\My Documents\research\HRD research\Gamache_soft\wfiles\',folder_name,'\',name1(7:12),'_ws.jpg'])
    
    
    vh=uu(1:li,1:col)*cos(deg2rad(90-trackp))+vv(1:li,1:col)*sin(deg2rad(90-trackp));
    
h=figure;
subplot(2,1,1)
 contourf(y_fill(1:li),z_fill(1:col),w_analys(1:li,1:col)',20);
 shading flat

hold on
quiver(yf,zf,vh',ww(1:li,1:col)');
caxis([-4 4]);
colorbar
 xlabel('Along track distance (m)','FontSize',11,'FontWeigh','bold')
    ylabel('Height (m)','FontSize',11,'FontWeigh','bold')
    subplot(2,1,2)
    contourf(y_fill(1:li),z_fill(1:col),ww(1:li,1:col)',20)
shading flat
hold on 
quiver(yf,zf,vh',ww(1:li,1:col)');
caxis([-4 4]);
colorbar 
xlabel('Along track distance (m)','FontSize',11,'FontWeigh','bold')
    ylabel('Height (m)','FontSize',11,'FontWeigh','bold')
    saveas(h,['C:\Documents and Settings\lorsolo\My Documents\research\HRD research\Gamache_soft\wfiles\',folder_name,'\',name1(7:12),'_w.jpg'])
    
% h=figure
% contourf(y_fill(1:li),z_fill(1:col),wws(1:li,1:col)',20);
% shading flat
% caxis([35 78]);%caxis([25 82]) %
% vh=uu(1:li,1:col)*cos(deg2rad(90-trackp))+vv(1:li,1:col)*sin(deg2rad(90-trackp));
% hold on
%  quiver(yf,zf,vh',ww(1:li,1:col)');
% colorbar
%  xlabel('Along track distance (m)','FontSize',11,'FontWeigh','bold')
%     ylabel('Height (m)','FontSize',11,'FontWeigh','bold')
%     saveas(h,['C:\Documents and Settings\lorsolo\My Documents\research\HRD research\Gamache_soft\wfiles\',folder_name,'\',name1(7:12),'_ws_t.jpg'])

% h=figure
% contourf(y_fill(1:li),z_fill(1:col),ww(1:li,1:col)',20)
% shading flat
% hold on 
% quiver(yf,zf,vh',ww(1:li,1:col)');
% caxis([-5 5]);
% colorbar 
% xlabel('Along track distance (m)','FontSize',11,'FontWeigh','bold')
%     ylabel('Height (m)','FontSize',11,'FontWeigh','bold')
%     saveas(h,['C:\Documents and Settings\lorsolo\My Documents\research\HRD research\Gamache_soft\wfiles\',folder_name,'\',name1(7:12),'_w_t.jpg'])
% 























