disp('fastpro1.m')

if length(Ustream(1:firstq)) > 8191,specsize_1=8192;else,specsize_1=256;end;
if length(Ustream(firstq+1:seconq)) > 8191,specsize_2=8192;else,specsize_2=256;end;
if length(Ustream(seconq+1:thirdq)) > 8191,specsize_3=8192;else,specsize_3=256;end;
if length(Ustream(thirdq+1:fourtq)) > 8191,specsize_4=8192;else,specsize_4=256;end;
if length(Ustream(fourtq+1:fifthq)) > 8191,specsize_5=8192;else,specsize_5=256;end;
if length(Ustream(fifthq+1:sixthq)) > 8191,specsize_6=8192;else,specsize_6=256;end;

[Su_1,Fson]=psd(detrend(Ustream(1:firstq)),specsize_1,20);[Su_1,Fson]=specsmoo(Su_1,20);
[Su_2,Fson]=psd(detrend(Ustream(firstq+1:seconq)),specsize_2,20);[Su_2,Fson]=specsmoo(Su_2,20);
[Su_3,Fson]=psd(detrend(Ustream(seconq+1:thirdq)),specsize_3,20);[Su_3,Fson]=specsmoo(Su_3,20);
[Su_4,Fson]=psd(detrend(Ustream(thirdq+1:fourtq)),specsize_4,20);[Su_4,Fson]=specsmoo(Su_4,20);
[Su_5,Fson]=psd(detrend(Ustream(fourtq+1:fifthq)),specsize_5,20);[Su_5,Fson]=specsmoo(Su_5,20);
[Su_6,Fson]=psd(detrend(Ustream(fifthq+1:sixthq)),specsize_6,20);[Su_6,Fson]=specsmoo(Su_6,20);

[Sw_1,Fson]=psd(detrend(Wstream(1:firstq)),specsize_1,20);[Sw_1,Fson]=specsmoo(Sw_1,20);
[Sw_2,Fson]=psd(detrend(Wstream(firstq+1:seconq)),specsize_2,20);[Sw_2,Fson]=specsmoo(Sw_2,20);
[Sw_3,Fson]=psd(detrend(Wstream(seconq+1:thirdq)),specsize_3,20);[Sw_3,Fson]=specsmoo(Sw_3,20);
[Sw_4,Fson]=psd(detrend(Wstream(thirdq+1:fourtq)),specsize_4,20);[Sw_4,Fson]=specsmoo(Sw_4,20);
[Sw_5,Fson]=psd(detrend(Wstream(fourtq+1:fifthq)),specsize_5,20);[Sw_5,Fson]=specsmoo(Sw_5,20);
[Sw_6,Fson]=psd(detrend(Wstream(fifthq+1:sixthq)),specsize_6,20);[Sw_6,Fson]=specsmoo(Sw_6,20);

[St_1,Fson]=psd(detrend(sst(1:firstq)),specsize_1,20);[St_1,Fson_1]=specsmoo(St_1,20);
[St_2,Fson]=psd(detrend(sst(firstq+1:seconq)),specsize_2,20);[St_2,Fson]=specsmoo(St_2,20);
[St_3,Fson]=psd(detrend(sst(seconq+1:thirdq)),specsize_3,20);[St_3,Fson]=specsmoo(St_3,20);
[St_4,Fson]=psd(detrend(sst(thirdq+1:fourtq)),specsize_4,20);[St_4,Fson]=specsmoo(St_4,20);
[St_5,Fson]=psd(detrend(sst(fourtq+1:fifthq)),specsize_5,20);[St_5,Fson]=specsmoo(St_5,20);
[St_6,Fson]=psd(detrend(sst(fifthq+1:sixthq)),specsize_6,20);[St_6,Fson]=specsmoo(St_6,20);

[Sq_1,Fson]=psd(detrend(abshum(1:firstq))/rho_1,specsize_1,20);[Sq_1,Fson]=specsmoo(Sq_1,20);
[Sq_2,Fson]=psd(detrend(abshum(firstq+1:seconq))/rho_2,specsize_2,20);[Sq_2,Fson]=specsmoo(Sq_2,20);
[Sq_3,Fson]=psd(detrend(abshum(seconq+1:thirdq))/rho_3,specsize_3,20);[Sq_3,Fson]=specsmoo(Sq_3,20);
[Sq_4,Fson]=psd(detrend(abshum(thirdq+1:fourtq))/rho_4,specsize_4,20);[Sq_4,Fson]=specsmoo(Sq_4,20);
[Sq_5,Fson]=psd(detrend(abshum(fourtq+1:fifthq))/rho_5,specsize_5,20);[Sq_5,Fson]=specsmoo(Sq_5,20);
[Sq_6,Fson]=psd(detrend(abshum(fifthq+1:sixthq))/rho_6,specsize_6,20);[Sq_6,Fson]=specsmoo(Sq_6,20);

%subtract noise

if length(Su_1)>5,sev=5;else;sev=1;end;
Su_1=Su_1-median(Su_1(length(Su_1)-sev:length(Su_1)));
Su_2=Su_2-median(Su_2(length(Su_2)-sev:length(Su_2)));
Su_3=Su_3-median(Su_3(length(Su_3)-sev:length(Su_3)));
Su_4=Su_4-median(Su_4(length(Su_4)-sev:length(Su_4)));
Su_5=Su_5-median(Su_5(length(Su_5)-sev:length(Su_5)));
Su_6=Su_6-median(Su_6(length(Su_6)-sev:length(Su_6)));

if length(Sw_1)>5,sev=5;else;sev=1;end;
Sw_1=Sw_1-median(Sw_1(length(Sw_1)-sev:length(Sw_1)));
Sw_2=Sw_2-median(Sw_2(length(Sw_2)-sev:length(Sw_2)));
Sw_3=Sw_3-median(Sw_3(length(Sw_3)-sev:length(Sw_3)));
Sw_4=Sw_4-median(Sw_4(length(Sw_4)-sev:length(Sw_4)));
Sw_5=Sw_5-median(Sw_5(length(Sw_5)-sev:length(Sw_5)));
Sw_6=Sw_6-median(Sw_6(length(Sw_6)-sev:length(Sw_6)));

if length(St_1)>5,sev=5;else;sev=1;end;
St_1=St_1-median(St_1(length(St_1)-sev:length(St_1)));
St_2=St_2-median(St_2(length(St_2)-sev:length(St_2)));
St_3=St_3-median(St_3(length(St_3)-sev:length(St_3)));
St_4=St_4-median(St_4(length(St_4)-sev:length(St_4)));
St_5=St_5-median(St_5(length(St_5)-sev:length(St_5)));
St_6=St_6-median(St_6(length(St_6)-sev:length(St_6)));

if length(Sq_1)>5,sev=5;else;sev=1;end;
Sq_1=Sq_1-median(Sq_1(length(Sq_1)-sev:length(Sq_1)));
Sq_2=Sq_2-median(Sq_2(length(Sq_2)-sev:length(Sq_2)));
Sq_3=Sq_3-median(Sq_3(length(Sq_3)-sev:length(Sq_3)));
Sq_4=Sq_4-median(Sq_4(length(Sq_4)-sev:length(Sq_4)));
Sq_5=Sq_5-median(Sq_5(length(Sq_5)-sev:length(Sq_5)));
Sq_6=Sq_6-median(Sq_6(length(Sq_6)-sev:length(Sq_6)));

fminU=min(find(Fson>.8));
fminU=fminU-2;if fminU<1,fminU=1,end;
fmaxU=fminU+2;if fmaxU>length(Fson),fmaxU=length(Fson);end;

cS=4*2/20;

%_level_time_method

Cu2_1_1=median(cS*((2*pi/Ubar_1)^(2/3))*Su_1(fminU:fmaxU).*Fson(fminU:fmaxU).^(5/3));
Cu2_2_1=median(cS*((2*pi/Ubar_2)^(2/3))*Su_2(fminU:fmaxU).*Fson(fminU:fmaxU).^(5/3));
Cu2_3_1=median(cS*((2*pi/Ubar_3)^(2/3))*Su_3(fminU:fmaxU).*Fson(fminU:fmaxU).^(5/3));
Cu2_4_1=median(cS*((2*pi/Ubar_4)^(2/3))*Su_4(fminU:fmaxU).*Fson(fminU:fmaxU).^(5/3));
Cu2_5_1=median(cS*((2*pi/Ubar_5)^(2/3))*Su_5(fminU:fmaxU).*Fson(fminU:fmaxU).^(5/3));
Cu2_6_1=median(cS*((2*pi/Ubar_6)^(2/3))*Su_6(fminU:fmaxU).*Fson(fminU:fmaxU).^(5/3));

Cw2_1_1=median(cS*((2*pi/Ubar_1)^(2/3))*Sw_1(fminU:fmaxU).*Fson(fminU:fmaxU).^(5/3));
Cw2_2_1=median(cS*((2*pi/Ubar_2)^(2/3))*Sw_2(fminU:fmaxU).*Fson(fminU:fmaxU).^(5/3));
Cw2_3_1=median(cS*((2*pi/Ubar_3)^(2/3))*Sw_3(fminU:fmaxU).*Fson(fminU:fmaxU).^(5/3));
Cw2_4_1=median(cS*((2*pi/Ubar_4)^(2/3))*Sw_4(fminU:fmaxU).*Fson(fminU:fmaxU).^(5/3));
Cw2_5_1=median(cS*((2*pi/Ubar_5)^(2/3))*Sw_5(fminU:fmaxU).*Fson(fminU:fmaxU).^(5/3));
Cw2_6_1=median(cS*((2*pi/Ubar_6)^(2/3))*Sw_6(fminU:fmaxU).*Fson(fminU:fmaxU).^(5/3));

fminT=min(find(Fson>.35));
fminT=fminT-2;if fminT<1,fminT=1,end;
fmaxT=fminT+2;if fmaxT>length(Fson),fmaxT=length(Fson);end;

Ct2_1_1=median(cS*((2*pi/Ubar_1)^(2/3))*St_1(fminT:fmaxT).*Fson(fminT:fmaxT).^(5/3));
Ct2_2_1=median(cS*((2*pi/Ubar_2)^(2/3))*St_2(fminT:fmaxT).*Fson(fminT:fmaxT).^(5/3));
Ct2_3_1=median(cS*((2*pi/Ubar_3)^(2/3))*St_3(fminT:fmaxT).*Fson(fminT:fmaxT).^(5/3));
Ct2_4_1=median(cS*((2*pi/Ubar_4)^(2/3))*St_4(fminT:fmaxT).*Fson(fminT:fmaxT).^(5/3));
Ct2_5_1=median(cS*((2*pi/Ubar_5)^(2/3))*St_5(fminT:fmaxT).*Fson(fminT:fmaxT).^(5/3));
Ct2_6_1=median(cS*((2*pi/Ubar_6)^(2/3))*St_6(fminT:fmaxT).*Fson(fminT:fmaxT).^(5/3));

fminO=min(find(Fson>0.7));
fminO=fminO-2;if fminO<1,fminO=1,end;
fmaxO=fminO+2;if fmaxO>length(Fson),fmaxO=length(Fson);end;

cO=4*2/20;

%_level_time_method

Cq2_1_1=median(cO*((2*pi/Ubar_1)^(2/3))*Sq_1(fminO:fmaxO).*Fson(fminO:fmaxO).^(5/3));
Cq2_2_1=median(cO*((2*pi/Ubar_2)^(2/3))*Sq_2(fminO:fmaxO).*Fson(fminO:fmaxO).^(5/3));
Cq2_3_1=median(cO*((2*pi/Ubar_3)^(2/3))*Sq_3(fminO:fmaxO).*Fson(fminO:fmaxO).^(5/3));
Cq2_4_1=median(cO*((2*pi/Ubar_4)^(2/3))*Sq_4(fminO:fmaxO).*Fson(fminO:fmaxO).^(5/3));
Cq2_5_1=median(cO*((2*pi/Ubar_5)^(2/3))*Sq_5(fminO:fmaxO).*Fson(fminO:fmaxO).^(5/3));
Cq2_6_1=median(cO*((2*pi/Ubar_6)^(2/3))*Sq_6(fminO:fmaxO).*Fson(fminO:fmaxO).^(5/3));

%figure;loglog(Fson,Fson.*Su_1,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cu2_1_1*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cu^2 1 1');
%figure;loglog(Fson,Fson.*Su_2,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cu2_2_1*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cu^2 2 1');
%figure;loglog(Fson,Fson.*Su_3,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cu2_3_1*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cu^2 3 1');
%figure;loglog(Fson,Fson.*Su_4,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cu2_4_1*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cu^2 4 1');
%figure;loglog(Fson,Fson.*Su_5,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cu2_5_1*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cu^2 5 1');
%figure;loglog(Fson,Fson.*Su_6,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cu2_6_1*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cu^2 6 1');
%figure;loglog(Fson,Fson.*Sw_1,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cw2_1_1*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cw^2 1 1');
%figure;loglog(Fson,Fson.*Sw_2,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cw2_2_1*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cw^2 2 1');
%figure;loglog(Fson,Fson.*Sw_3,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cw2_3_1*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cw^2 3 1');
%figure;loglog(Fson,Fson.*Sw_4,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cw2_4_1*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cw^2 4 1');
%figure;loglog(Fson,Fson.*Sw_5,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cw2_5_1*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cw^2 5 1');
%figure;loglog(Fson,Fson.*Sw_6,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cw2_6_1*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cw^2 6 1');
%figure;loglog(Fson,Fson.*St_1,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Ct2_1_1*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Ct^2 1 1');
%figure;loglog(Fson,Fson.*St_2,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Ct2_2_1*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Ct^2 2 1');
%figure;loglog(Fson,Fson.*St_3,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Ct2_3_1*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Ct^2 3 1');
%figure;loglog(Fson,Fson.*St_4,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Ct2_4_1*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Ct^2 4 1');
%figure;loglog(Fson,Fson.*St_5,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Ct2_5_1*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Ct^2 5 1');
%figure;loglog(Fson,Fson.*St_6,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Ct2_6_1*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Ct^2 6 1');
%figure;loglog(Fson,Fson.*Sq_1,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cq2_1_1*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cq^2 1 1');
%figure;loglog(Fson,Fson.*Sq_2,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cq2_2_1*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cq^2 2 1');
%figure;loglog(Fson,Fson.*Sq_3,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cq2_3_1*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cq^2 3 1');
%figure;loglog(Fson,Fson.*Sq_4,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cq2_4_1*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cq^2 4 1');
%figure;loglog(Fson,Fson.*Sq_5,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cq2_5_1*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cq^2 5 1');
%figure;loglog(Fson,Fson.*Sq_6,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cq2_6_1*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cq^2 6 1');

y=y_1;x=x_1;Cu2=Cu2_1_1;Ct2=Ct2_1_1;Cq2=Cq2_1_1;Q=Qbar_1;idiss;usid_1_1=us0;tsid_1_1=ts_ib;qsid_1_1=qs_ib;Lid_1_1=z_u/zet;
y=y_2;x=x_2;Cu2=Cu2_2_1;Ct2=Ct2_2_1;Cq2=Cq2_2_1;Q=Qbar_2;idiss;usid_2_1=us0;tsid_2_1=ts_ib;qsid_2_1=qs_ib;Lid_2_1=z_u/zet;
y=y_3;x=x_3;Cu2=Cu2_3_1;Ct2=Ct2_3_1;Cq2=Cq2_3_1;Q=Qbar_3;idiss;usid_3_1=us0;tsid_3_1=ts_ib;qsid_3_1=qs_ib;Lid_3_1=z_u/zet;
y=y_4;x=x_4;Cu2=Cu2_4_1;Ct2=Ct2_4_1;Cq2=Cq2_4_1;Q=Qbar_4;idiss;usid_4_1=us0;tsid_4_1=ts_ib;qsid_4_1=qs_ib;Lid_4_1=z_u/zet;
y=y_5;x=x_5;Cu2=Cu2_5_1;Ct2=Ct2_5_1;Cq2=Cq2_5_1;Q=Qbar_5;idiss;usid_5_1=us0;tsid_5_1=ts_ib;qsid_5_1=qs_ib;Lid_5_1=z_u/zet;
y=y_6;x=x_6;Cu2=Cu2_6_1;Ct2=Ct2_6_1;Cq2=Cq2_6_1;Q=Qbar_6;idiss;usid_6_1=us0;tsid_6_1=ts_ib;qsid_6_1=qs_ib;Lid_6_1=z_u/zet;

fminU=min(find(Fson>.6));if fminU<1,fminU=1,end;
fmaxU=max(find(Fson<3.5));if fmaxU>length(Fson),fmaxU=length(Fson);end;
cS=4*2/20;
if fminU>fmaxU,fminU=fmaxU-4;end;

Zpoly=polyfit(log(Fson(fminU:fmaxU)),log(cS*((2*pi/Ubar_1)^(2/3))*Su_1(fminU:fmaxU).*(Fson(fminU:fmaxU).^(2/3))),4);
if Zpoly(4)<0.25,
   Cu2_1_2=exp(Zpoly(5));
else,
   plus=0;
   while 1
      zold=Zpoly(4);
      plus=plus+1;
      if fminU+plus+4==fmaxU,
         if fmaxU<4;fmaxU=4;end;
         Zpoly=polyfit(log(Fson(fmaxU-4:fmaxU)),log(cS*((2*pi/Ubar_1)^(2/3))*Su_1(fmaxU-4:fmaxU).*(Fson(fmaxU-4:fmaxU).^(2/3))),4);
         break;
      end;            
      Zpoly=polyfit(log(Fson(fminU+plus:fmaxU)),log(cS*((2*pi/Ubar_1)^(2/3))*Su_1(fminU+plus:fmaxU).*(Fson(fminU+plus:fmaxU).^(2/3))),4);
      if Zpoly(4)>zold,break,end
   end;
   Cu2_1_2=exp(Zpoly(5));
end;
Zpoly=polyfit(log(Fson(fminU:fmaxU)),log(cS*((2*pi/Ubar_2)^(2/3))*Su_2(fminU:fmaxU).*(Fson(fminU:fmaxU).^(2/3))),4);
if Zpoly(4)<0.25,
   Cu2_2_2=exp(Zpoly(5));
else,
   plus=0;
   while 1
      zold=Zpoly(4);
      plus=plus+1;
      if fminU+plus+4==fmaxU,
         if fmaxU<4;fmaxU=4;end;
         Zpoly=polyfit(log(Fson(fmaxU-4:fmaxU)),log(cS*((2*pi/Ubar_2)^(2/3))*Su_2(fmaxU-4:fmaxU).*(Fson(fmaxU-4:fmaxU).^(2/3))),4);
         break;
      end;            
      Zpoly=polyfit(log(Fson(fminU+plus:fmaxU)),log(cS*((2*pi/Ubar_2)^(2/3))*Su_2(fminU+plus:fmaxU).*(Fson(fminU+plus:fmaxU).^(2/3))),4);
      if Zpoly(4)>zold,break,end
   end;
   Cu2_2_2=exp(Zpoly(5));
end;
Zpoly=polyfit(log(Fson(fminU:fmaxU)),log(cS*((2*pi/Ubar_3)^(2/3))*Su_3(fminU:fmaxU).*(Fson(fminU:fmaxU).^(2/3))),4);
if Zpoly(4)<0.25,
   Cu2_3_2=exp(Zpoly(5));
else,
   plus=0;
   while 1
      zold=Zpoly(4);
      plus=plus+1;
      if fminU+plus+4==fmaxU,
         if fmaxU<4;fmaxU=4;end;
         Zpoly=polyfit(log(Fson(fmaxU-4:fmaxU)),log(cS*((2*pi/Ubar_3)^(2/3))*Su_3(fmaxU-4:fmaxU).*(Fson(fmaxU-4:fmaxU).^(2/3))),4);
         break;
      end;            
      Zpoly=polyfit(log(Fson(fminU+plus:fmaxU)),log(cS*((2*pi/Ubar_3)^(2/3))*Su_3(fminU+plus:fmaxU).*(Fson(fminU+plus:fmaxU).^(2/3))),4);
      if Zpoly(4)>zold,break,end
   end;
   Cu2_3_2=exp(Zpoly(5));
end;
Zpoly=polyfit(log(Fson(fminU:fmaxU)),log(cS*((2*pi/Ubar_4)^(2/3))*Su_4(fminU:fmaxU).*(Fson(fminU:fmaxU).^(2/3))),4);
if Zpoly(4)<0.25,
   Cu2_4_2=exp(Zpoly(5));
else,
   plus=0;
   while 1
      zold=Zpoly(4);
      plus=plus+1;
      if fminU+plus+4==fmaxU,
         if fmaxU<4;fmaxU=4;end;
         Zpoly=polyfit(log(Fson(fmaxU-4:fmaxU)),log(cS*((2*pi/Ubar_4)^(2/3))*Su_4(fmaxU-4:fmaxU).*(Fson(fmaxU-4:fmaxU).^(2/3))),4);
         break;
      end;            
      Zpoly=polyfit(log(Fson(fminU+plus:fmaxU)),log(cS*((2*pi/Ubar_4)^(2/3))*Su_4(fminU+plus:fmaxU).*(Fson(fminU+plus:fmaxU).^(2/3))),4);
      if Zpoly(4)>zold,break,end
   end;
   Cu2_4_2=exp(Zpoly(5));
end;
Zpoly=polyfit(log(Fson(fminU:fmaxU)),log(cS*((2*pi/Ubar_5)^(2/3))*Su_5(fminU:fmaxU).*(Fson(fminU:fmaxU).^(2/3))),4);
if Zpoly(4)<0.25,
   Cu2_5_2=exp(Zpoly(5));
else,
   plus=0;
   while 1
      zold=Zpoly(4);
      plus=plus+1;
      if fminU+plus+4==fmaxU,
         if fmaxU<4;fmaxU=4;end;
         Zpoly=polyfit(log(Fson(fmaxU-4:fmaxU)),log(cS*((2*pi/Ubar_5)^(2/3))*Su_5(fmaxU-4:fmaxU).*(Fson(fmaxU-4:fmaxU).^(2/3))),4);
         break;
      end;            
      Zpoly=polyfit(log(Fson(fminU+plus:fmaxU)),log(cS*((2*pi/Ubar_5)^(2/3))*Su_5(fminU+plus:fmaxU).*(Fson(fminU+plus:fmaxU).^(2/3))),4);
      if Zpoly(4)>zold,break,end
   end;
   Cu2_5_2=exp(Zpoly(5));
end;
Zpoly=polyfit(log(Fson(fminU:fmaxU)),log(cS*((2*pi/Ubar_6)^(2/3))*Su_6(fminU:fmaxU).*(Fson(fminU:fmaxU).^(2/3))),4);
if Zpoly(4)<0.25,
   Cu2_6_2=exp(Zpoly(5));
else,
   plus=0;
   while 1
      zold=Zpoly(4);
      plus=plus+1;
      if fminU+plus+4==fmaxU,
         if fmaxU<4;fmaxU=4;end;
         Zpoly=polyfit(log(Fson(fmaxU-4:fmaxU)),log(cS*((2*pi/Ubar_6)^(2/3))*Su_6(fmaxU-4:fmaxU).*(Fson(fmaxU-4:fmaxU).^(2/3))),4);
         break;
      end;            
      Zpoly=polyfit(log(Fson(fminU+plus:fmaxU)),log(cS*((2*pi/Ubar_6)^(2/3))*Su_6(fminU+plus:fmaxU).*(Fson(fminU+plus:fmaxU).^(2/3))),4);
      if Zpoly(4)>zold,break,end
   end;
   Cu2_6_2=exp(Zpoly(5));
end;

Zpoly=polyfit(log(Fson(fminU:fmaxU)),log(cS*((2*pi/Ubar_1)^(2/3))*Sw_1(fminU:fmaxU).*(Fson(fminU:fmaxU).^(2/3))),4);
if Zpoly(4)<0.25,
   Cw2_1_2=exp(Zpoly(5));
else,
   plus=0;
   while 1
      zold=Zpoly(4);
      plus=plus+1;
      if fminU+plus+4==fmaxU,
         if fmaxU<4;fmaxU=4;end;
         Zpoly=polyfit(log(Fson(fmaxU-4:fmaxU)),log(cS*((2*pi/Ubar_1)^(2/3))*Sw_1(fmaxU-4:fmaxU).*(Fson(fmaxU-4:fmaxU).^(2/3))),4);
         break;
      end;            
      Zpoly=polyfit(log(Fson(fminU+plus:fmaxU)),log(cS*((2*pi/Ubar_1)^(2/3))*Sw_1(fminU+plus:fmaxU).*(Fson(fminU+plus:fmaxU).^(2/3))),4);
      if Zpoly(4)>zold,break,end
   end;
   Cw2_1_2=exp(Zpoly(5));
end;
Zpoly=polyfit(log(Fson(fminU:fmaxU)),log(cS*((2*pi/Ubar_2)^(2/3))*Sw_2(fminU:fmaxU).*(Fson(fminU:fmaxU).^(2/3))),4);
if Zpoly(4)<0.25,
   Cw2_2_2=exp(Zpoly(5));
else,
   plus=0;
   while 1
      zold=Zpoly(4);
      plus=plus+1;
      if fminU+plus+4==fmaxU,
         if fmaxU<4;fmaxU=4;end;
         Zpoly=polyfit(log(Fson(fmaxU-4:fmaxU)),log(cS*((2*pi/Ubar_2)^(2/3))*Sw_2(fmaxU-4:fmaxU).*(Fson(fmaxU-4:fmaxU).^(2/3))),4);
         break;
      end;            
      Zpoly=polyfit(log(Fson(fminU+plus:fmaxU)),log(cS*((2*pi/Ubar_2)^(2/3))*Sw_2(fminU+plus:fmaxU).*(Fson(fminU+plus:fmaxU).^(2/3))),4);
      if Zpoly(4)>zold,break,end
   end;
   Cw2_2_2=exp(Zpoly(5));
end;
Zpoly=polyfit(log(Fson(fminU:fmaxU)),log(cS*((2*pi/Ubar_3)^(2/3))*Sw_3(fminU:fmaxU).*(Fson(fminU:fmaxU).^(2/3))),4);
if Zpoly(4)<0.25,
   Cw2_3_2=exp(Zpoly(5));
else,
   plus=0;
   while 1
      zold=Zpoly(4);
      plus=plus+1;
      if fminU+plus+4==fmaxU,
         if fmaxU<4;fmaxU=4;end;
         Zpoly=polyfit(log(Fson(fmaxU-4:fmaxU)),log(cS*((2*pi/Ubar_3)^(2/3))*Sw_3(fmaxU-4:fmaxU).*(Fson(fmaxU-4:fmaxU).^(2/3))),4);
         break;
      end;            
      Zpoly=polyfit(log(Fson(fminU+plus:fmaxU)),log(cS*((2*pi/Ubar_3)^(2/3))*Sw_3(fminU+plus:fmaxU).*(Fson(fminU+plus:fmaxU).^(2/3))),4);
      if Zpoly(4)>zold,break,end
   end;
   Cw2_3_2=exp(Zpoly(5));
end;
Zpoly=polyfit(log(Fson(fminU:fmaxU)),log(cS*((2*pi/Ubar_4)^(2/3))*Sw_4(fminU:fmaxU).*(Fson(fminU:fmaxU).^(2/3))),4);
if Zpoly(4)<0.25,
   Cw2_4_2=exp(Zpoly(5));
else,
   plus=0;
   while 1
      zold=Zpoly(4);
      plus=plus+1;
      if fminU+plus+4==fmaxU,
         if fmaxU<4;fmaxU=4;end;
         Zpoly=polyfit(log(Fson(fmaxU-4:fmaxU)),log(cS*((2*pi/Ubar_4)^(2/3))*Sw_4(fmaxU-4:fmaxU).*(Fson(fmaxU-4:fmaxU).^(2/3))),4);
         break;
      end;            
      Zpoly=polyfit(log(Fson(fminU+plus:fmaxU)),log(cS*((2*pi/Ubar_4)^(2/3))*Sw_4(fminU+plus:fmaxU).*(Fson(fminU+plus:fmaxU).^(2/3))),4);
      if Zpoly(4)>zold,break,end
   end;
   Cw2_4_2=exp(Zpoly(5));
end;
Zpoly=polyfit(log(Fson(fminU:fmaxU)),log(cS*((2*pi/Ubar_5)^(2/3))*Sw_5(fminU:fmaxU).*(Fson(fminU:fmaxU).^(2/3))),4);
if Zpoly(4)<0.25,
   Cw2_5_2=exp(Zpoly(5));
else,
   plus=0;
   while 1
      zold=Zpoly(4);
      plus=plus+1;
      if fminU+plus+4==fmaxU,
         if fmaxU<4;fmaxU=4;end;
         Zpoly=polyfit(log(Fson(fmaxU-4:fmaxU)),log(cS*((2*pi/Ubar_5)^(2/3))*Sw_5(fmaxU-4:fmaxU).*(Fson(fmaxU-4:fmaxU).^(2/3))),4);
         break;
      end;            
      Zpoly=polyfit(log(Fson(fminU+plus:fmaxU)),log(cS*((2*pi/Ubar_5)^(2/3))*Sw_5(fminU+plus:fmaxU).*(Fson(fminU+plus:fmaxU).^(2/3))),4);
      if Zpoly(4)>zold,break,end
   end;
   Cw2_5_2=exp(Zpoly(5));
end;
Zpoly=polyfit(log(Fson(fminU:fmaxU)),log(cS*((2*pi/Ubar_6)^(2/3))*Sw_6(fminU:fmaxU).*(Fson(fminU:fmaxU).^(2/3))),4);
if Zpoly(4)<0.25,
   Cw2_6_2=exp(Zpoly(5));
else,
   plus=0;
   while 1
      zold=Zpoly(4);
      plus=plus+1;
      if fminU+plus+4==fmaxU,
         if fmaxU<4;fmaxU=4;end;
         Zpoly=polyfit(log(Fson(fmaxU-4:fmaxU)),log(cS*((2*pi/Ubar_6)^(2/3))*Sw_6(fmaxU-4:fmaxU).*(Fson(fmaxU-4:fmaxU).^(2/3))),4);
         break;
      end;            
      Zpoly=polyfit(log(Fson(fminU+plus:fmaxU)),log(cS*((2*pi/Ubar_6)^(2/3))*Sw_6(fminU+plus:fmaxU).*(Fson(fminU+plus:fmaxU).^(2/3))),4);
      if Zpoly(4)>zold,break,end
   end;
   Cw2_6_2=exp(Zpoly(5));
end;

fminT=min(find(Fson>.35));if fminT<1,fminT=1,end;
fmaxT=max(find(Fson<3));if fmaxT>length(Fson),fmaxT=length(Fson);end;
cS=4*2/20;
if fminT>fmaxT,fminT=fmaxT-4;end;

Zpoly=polyfit(log(Fson(fminT:fmaxT)),log(cS*((2*pi/Ubar_1)^(2/3))*St_1(fminT:fmaxT).*(Fson(fminT:fmaxT).^(2/3))),4);
if Zpoly(4)<0.25,
   Ct2_1_2=exp(Zpoly(5));
else,
   plus=0;
   while 1
      zold=Zpoly(4);
      plus=plus+1;
      if fminT+plus+4==fmaxT,
         if fmaxT<4;fmaxT=4;end;
         Zpoly=polyfit(log(Fson(fmaxT-4:fmaxT)),log(cS*((2*pi/Ubar_1)^(2/3))*St_1(fmaxT-4:fmaxT).*(Fson(fmaxT-4:fmaxT).^(2/3))),4);
         break;
      end;            
      Zpoly=polyfit(log(Fson(fminT+plus:fmaxT)),log(cS*((2*pi/Ubar_1)^(2/3))*St_1(fminT+plus:fmaxT).*(Fson(fminT+plus:fmaxT).^(2/3))),4);
      if Zpoly(4)>zold,break,end
   end;
   Ct2_1_2=exp(Zpoly(5));
end;

Zpoly=polyfit(log(Fson(fminT:fmaxT)),log(cS*((2*pi/Ubar_2)^(2/3))*St_2(fminT:fmaxT).*(Fson(fminT:fmaxT).^(2/3))),4);
if Zpoly(4)<0.25,
   Ct2_2_2=exp(Zpoly(5));
else,
   plus=0;
   while 1
      zold=Zpoly(4);
      plus=plus+1;
      if fminT+plus+4==fmaxT,
         if fmaxT<4;fmaxT=4;end;
         Zpoly=polyfit(log(Fson(fmaxT-4:fmaxT)),log(cS*((2*pi/Ubar_2)^(2/3))*St_2(fmaxT-4:fmaxT).*(Fson(fmaxT-4:fmaxT).^(2/3))),4);
         break;
      end;            
      Zpoly=polyfit(log(Fson(fminT+plus:fmaxT)),log(cS*((2*pi/Ubar_2)^(2/3))*St_2(fminT+plus:fmaxT).*(Fson(fminT+plus:fmaxT).^(2/3))),4);
      if Zpoly(4)>zold,break,end
   end;
   Ct2_2_2=exp(Zpoly(5));
end;

Zpoly=polyfit(log(Fson(fminT:fmaxT)),log(cS*((2*pi/Ubar_3)^(2/3))*St_3(fminT:fmaxT).*(Fson(fminT:fmaxT).^(2/3))),4);
if Zpoly(4)<0.25,
   Ct2_3_2=exp(Zpoly(5));
else,
   plus=0;
   while 1
      zold=Zpoly(4);
      plus=plus+1;
      if fminT+plus+4==fmaxT,
         if fmaxT<4;fmaxT=4;end;
         Zpoly=polyfit(log(Fson(fmaxT-4:fmaxT)),log(cS*((2*pi/Ubar_3)^(2/3))*St_3(fmaxT-4:fmaxT).*(Fson(fmaxT-4:fmaxT).^(2/3))),4);
         break;
      end;            
      Zpoly=polyfit(log(Fson(fminT+plus:fmaxT)),log(cS*((2*pi/Ubar_3)^(2/3))*St_3(fminT+plus:fmaxT).*(Fson(fminT+plus:fmaxT).^(2/3))),4);
      if Zpoly(4)>zold,break,end
   end;
   Ct2_3_2=exp(Zpoly(5));
end;

Zpoly=polyfit(log(Fson(fminT:fmaxT)),log(cS*((2*pi/Ubar_4)^(2/3))*St_4(fminT:fmaxT).*(Fson(fminT:fmaxT).^(2/3))),4);
if Zpoly(4)<0.25,
   Ct2_4_2=exp(Zpoly(5));
else,
   plus=0;
   while 1
      zold=Zpoly(4);
      plus=plus+1;
      if fminT+plus+4==fmaxT,
         if fmaxT<4;fmaxT=4;end;
         Zpoly=polyfit(log(Fson(fmaxT-4:fmaxT)),log(cS*((2*pi/Ubar_4)^(2/3))*St_4(fmaxT-4:fmaxT).*(Fson(fmaxT-4:fmaxT).^(2/3))),4);
         break;
      end;            
      Zpoly=polyfit(log(Fson(fminT+plus:fmaxT)),log(cS*((2*pi/Ubar_4)^(2/3))*St_4(fminT+plus:fmaxT).*(Fson(fminT+plus:fmaxT).^(2/3))),4);
      if Zpoly(4)>zold,break,end
   end;
   Ct2_4_2=exp(Zpoly(5));
end;

Zpoly=polyfit(log(Fson(fminT:fmaxT)),log(cS*((2*pi/Ubar_5)^(2/3))*St_5(fminT:fmaxT).*(Fson(fminT:fmaxT).^(2/3))),4);
if Zpoly(4)<0.25,
   Ct2_5_2=exp(Zpoly(5));
else,
   plus=0;
   while 1
      zold=Zpoly(4);
      plus=plus+1;
      if fminT+plus+4==fmaxT,
         if fmaxT<4;fmaxT=4;end;
         Zpoly=polyfit(log(Fson(fmaxT-4:fmaxT)),log(cS*((2*pi/Ubar_5)^(2/3))*St_5(fmaxT-4:fmaxT).*(Fson(fmaxT-4:fmaxT).^(2/3))),4);
         break;
      end;            
      Zpoly=polyfit(log(Fson(fminT+plus:fmaxT)),log(cS*((2*pi/Ubar_5)^(2/3))*St_5(fminT+plus:fmaxT).*(Fson(fminT+plus:fmaxT).^(2/3))),4);
      if Zpoly(4)>zold,break,end
   end;
   Ct2_5_2=exp(Zpoly(5));
end;

Zpoly=polyfit(log(Fson(fminT:fmaxT)),log(cS*((2*pi/Ubar_6)^(2/3))*St_6(fminT:fmaxT).*(Fson(fminT:fmaxT).^(2/3))),4);
if Zpoly(4)<0.25,
   Ct2_6_2=exp(Zpoly(5));
else,
   plus=0;
   while 1
      zold=Zpoly(4);
      plus=plus+1;
      if fminT+plus+4==fmaxT,
         if fmaxT<4;fmaxT=4;end;
         Zpoly=polyfit(log(Fson(fmaxT-4:fmaxT)),log(cS*((2*pi/Ubar_6)^(2/3))*St_6(fmaxT-4:fmaxT).*(Fson(fmaxT-4:fmaxT).^(2/3))),4);
         break;
      end;            
      Zpoly=polyfit(log(Fson(fminT+plus:fmaxT)),log(cS*((2*pi/Ubar_6)^(2/3))*St_6(fminT+plus:fmaxT).*(Fson(fminT+plus:fmaxT).^(2/3))),4);
      if Zpoly(4)>zold,break,end
   end;
   Ct2_6_2=exp(Zpoly(5));
end;

fminO=min(find(Fson>0.7));if fminO<1,fminO=1,end;
fmaxO=max(find(Fson<3.6));if fmaxO>length(Fson),fmaxO=length(Fson);end;
cO=4*2/20;
if fminO>fmaxO,fminO=fmaxO-4;end

Zpoly=polyfit(log(Fson(fminO:fmaxO)),log(cO*((2*pi/Ubar_1)^(2/3))*Sq_1(fminO:fmaxO).*(Fson(fminO:fmaxO).^(2/3))),4);
if Zpoly(4)<0.25,
   Cq2_1_2=exp(Zpoly(5));
else,
   plus=0;
   while 1
      zold=Zpoly(4);
      plus=plus+1;
      if fminO+plus+4==fmaxO,
         if fmaxO<4;fmaxO=4;end;
         Zpoly=polyfit(log(Fson(fmaxO-4:fmaxO)),log(cO*((2*pi/Ubar_1)^(2/3))*Sq_1(fmaxO-4:fmaxO).*(Fson(fmaxO-4:fmaxO).^(2/3))),4);
         break;
      end;            
      Zpoly=polyfit(log(Fson(fminO+plus:fmaxO)),log(cO*((2*pi/Ubar_1)^(2/3))*Sq_1(fminO+plus:fmaxO).*(Fson(fminO+plus:fmaxO).^(2/3))),4);
      if Zpoly(4)>zold,break,end
   end;
   Cq2_1_2=exp(Zpoly(5));
end;

Zpoly=polyfit(log(Fson(fminO:fmaxO)),log(cO*((2*pi/Ubar_2)^(2/3))*Sq_2(fminO:fmaxO).*(Fson(fminO:fmaxO).^(2/3))),4);
if Zpoly(4)<0.25,
   Cq2_2_2=exp(Zpoly(5));
else,
   plus=0;
   while 1
      zold=Zpoly(4);
      plus=plus+1;
      if fminO+plus+4==fmaxO,
         if fmaxO<4;fmaxO=4;end;
         Zpoly=polyfit(log(Fson(fmaxO-4:fmaxO)),log(cO*((2*pi/Ubar_2)^(2/3))*Sq_2(fmaxO-4:fmaxO).*(Fson(fmaxO-4:fmaxO).^(2/3))),4);
         break;
      end;            
      Zpoly=polyfit(log(Fson(fminO+plus:fmaxO)),log(cO*((2*pi/Ubar_2)^(2/3))*Sq_2(fminO+plus:fmaxO).*(Fson(fminO+plus:fmaxO).^(2/3))),4);
      if Zpoly(4)>zold,break,end
   end;
   Cq2_2_2=exp(Zpoly(5));
end;

Zpoly=polyfit(log(Fson(fminO:fmaxO)),log(cO*((2*pi/Ubar_3)^(2/3))*Sq_3(fminO:fmaxO).*(Fson(fminO:fmaxO).^(2/3))),4);
if Zpoly(4)<0.25,
   Cq2_3_2=exp(Zpoly(5));
else,
   plus=0;
   while 1
      zold=Zpoly(4);
      plus=plus+1;
      if fminO+plus+4==fmaxO,
         if fmaxO<4;fmaxO=4;end;
         Zpoly=polyfit(log(Fson(fmaxO-4:fmaxO)),log(cO*((2*pi/Ubar_3)^(2/3))*Sq_3(fmaxO-4:fmaxO).*(Fson(fmaxO-4:fmaxO).^(2/3))),4);
         break;
      end;            
      Zpoly=polyfit(log(Fson(fminO+plus:fmaxO)),log(cO*((2*pi/Ubar_3)^(2/3))*Sq_3(fminO+plus:fmaxO).*(Fson(fminO+plus:fmaxO).^(2/3))),4);
      if Zpoly(4)>zold,break,end
   end;
   Cq2_3_2=exp(Zpoly(5));
end;

Zpoly=polyfit(log(Fson(fminO:fmaxO)),log(cO*((2*pi/Ubar_4)^(2/3))*Sq_4(fminO:fmaxO).*(Fson(fminO:fmaxO).^(2/3))),4);
if Zpoly(4)<0.25,
   Cq2_4_2=exp(Zpoly(5));
else,
   plus=0;
   while 1
      zold=Zpoly(4);
      plus=plus+1;
      if fminO+plus+4==fmaxO,
         if fmaxO<4;fmaxO=4;end;
         Zpoly=polyfit(log(Fson(fmaxO-4:fmaxO)),log(cO*((2*pi/Ubar_4)^(2/3))*Sq_4(fmaxO-4:fmaxO).*(Fson(fmaxO-4:fmaxO).^(2/3))),4);
         break;
      end;            
      Zpoly=polyfit(log(Fson(fminO+plus:fmaxO)),log(cO*((2*pi/Ubar_4)^(2/3))*Sq_4(fminO+plus:fmaxO).*(Fson(fminO+plus:fmaxO).^(2/3))),4);
      if Zpoly(4)>zold,break,end
   end;
   Cq2_4_2=exp(Zpoly(5));
end;

Zpoly=polyfit(log(Fson(fminO:fmaxO)),log(cO*((2*pi/Ubar_5)^(2/3))*Sq_5(fminO:fmaxO).*(Fson(fminO:fmaxO).^(2/3))),4);
if Zpoly(4)<0.25,
   Cq2_5_2=exp(Zpoly(5));
else,
   plus=0;
   while 1
      zold=Zpoly(4);
      plus=plus+1;
      if fminO+plus+4==fmaxO,
         if fmaxO<4;fmaxO=4;end;
         Zpoly=polyfit(log(Fson(fmaxO-4:fmaxO)),log(cO*((2*pi/Ubar_5)^(2/3))*Sq_5(fmaxO-4:fmaxO).*(Fson(fmaxO-4:fmaxO).^(2/3))),4);
         break;
      end;            
      Zpoly=polyfit(log(Fson(fminO+plus:fmaxO)),log(cO*((2*pi/Ubar_5)^(2/3))*Sq_5(fminO+plus:fmaxO).*(Fson(fminO+plus:fmaxO).^(2/3))),4);
      if Zpoly(4)>zold,break,end
   end;
   Cq2_5_2=exp(Zpoly(5));
end;

Zpoly=polyfit(log(Fson(fminO:fmaxO)),log(cO*((2*pi/Ubar_6)^(2/3))*Sq_6(fminO:fmaxO).*(Fson(fminO:fmaxO).^(2/3))),4);
if Zpoly(4)<0.25,
   Cq2_6_2=exp(Zpoly(5));
else,
   plus=0;
   while 1
      zold=Zpoly(4);
      plus=plus+1;
      if fminO+plus+4==fmaxO,
         if fmaxO<4;fmaxO=4;end;
         Zpoly=polyfit(log(Fson(fmaxO-4:fmaxO)),log(cO*((2*pi/Ubar_6)^(2/3))*Sq_6(fmaxO-4:fmaxO).*(Fson(fmaxO-4:fmaxO).^(2/3))),4);
         break;
      end;            
      Zpoly=polyfit(log(Fson(fminO+plus:fmaxO)),log(cO*((2*pi/Ubar_6)^(2/3))*Sq_6(fminO+plus:fmaxO).*(Fson(fminO+plus:fmaxO).^(2/3))),4);
      if Zpoly(4)>zold,break,end
   end;
   Cq2_6_2=exp(Zpoly(5));
end;

%figure;loglog(Fson,Fson.*Su_1,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cu2_1_2*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cu^2 1 2');
%figure;loglog(Fson,Fson.*Su_2,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cu2_2_2*((2*pi/Ubar_2).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cu^2 2 2');
%figure;loglog(Fson,Fson.*Su_3,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cu2_3_2*((2*pi/Ubar_3).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cu^2 3 2');
%figure;loglog(Fson,Fson.*Su_4,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cu2_4_2*((2*pi/Ubar_4).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cu^2 4 2');
%figure;loglog(Fson,Fson.*Su_5,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cu2_5_2*((2*pi/Ubar_5).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cu^2 5 2');
%figure;loglog(Fson,Fson.*Su_6,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cu2_6_2*((2*pi/Ubar_6).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cu^2 6 2');
%figure;loglog(Fson,Fson.*Sw_1,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cw2_1_2*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cw^2 1 2');
%figure;loglog(Fson,Fson.*Sw_2,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cw2_2_2*((2*pi/Ubar_2).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cw^2 2 2');
%figure;loglog(Fson,Fson.*Sw_3,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cw2_3_2*((2*pi/Ubar_3).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cw^2 3 2');
%figure;loglog(Fson,Fson.*Sw_4,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cw2_4_2*((2*pi/Ubar_4).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cw^2 4 2');
%figure;loglog(Fson,Fson.*Sw_5,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cw2_5_2*((2*pi/Ubar_5).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cw^2 5 2');
%figure;loglog(Fson,Fson.*Sw_6,Fson(fminU:fmaxU),Fson(fminU:fmaxU).*Cw2_6_2*((2*pi/Ubar_6).^(-2/3))./cS.*Fson(fminU:fmaxU).^(-5/3));title('Cw^2 6 2');
%figure;loglog(Fson,Fson.*St_1,Fson(fminT:fmaxT),Fson(fminT:fmaxT).*Ct2_1_2*((2*pi/Ubar_1).^(-2/3))./cS.*Fson(fminT:fmaxT).^(-5/3));title('Ct^2 1 2');
%figure;loglog(Fson,Fson.*St_2,Fson(fminT:fmaxT),Fson(fminT:fmaxT).*Ct2_2_2*((2*pi/Ubar_2).^(-2/3))./cS.*Fson(fminT:fmaxT).^(-5/3));title('Ct^2 2 2');
%figure;loglog(Fson,Fson.*St_3,Fson(fminT:fmaxT),Fson(fminT:fmaxT).*Ct2_3_2*((2*pi/Ubar_3).^(-2/3))./cS.*Fson(fminT:fmaxT).^(-5/3));title('Ct^2 3 2');
%figure;loglog(Fson,Fson.*St_4,Fson(fminT:fmaxT),Fson(fminT:fmaxT).*Ct2_4_2*((2*pi/Ubar_4).^(-2/3))./cS.*Fson(fminT:fmaxT).^(-5/3));title('Ct^2 4 2');
%figure;loglog(Fson,Fson.*St_5,Fson(fminT:fmaxT),Fson(fminT:fmaxT).*Ct2_5_2*((2*pi/Ubar_5).^(-2/3))./cS.*Fson(fminT:fmaxT).^(-5/3));title('Ct^2 5 2');
%figure;loglog(Fson,Fson.*St_6,Fson(fminT:fmaxT),Fson(fminT:fmaxT).*Ct2_6_2*((2*pi/Ubar_6).^(-2/3))./cS.*Fson(fminT:fmaxT).^(-5/3));title('Ct^2 6 2');
%figure;loglog(Fson,Fson.*Sq_1,Fson(fminO:fmaxO),Fson(fminO:fmaxO).*Cq2_1_2*((2*pi/Ubar_1).^(-2/3))./cO.*Fson(fminO:fmaxO).^(-5/3));title('Cq^2 1 2');
%figure;loglog(Fson,Fson.*Sq_2,Fson(fminO:fmaxO),Fson(fminO:fmaxO).*Cq2_2_2*((2*pi/Ubar_2).^(-2/3))./cO.*Fson(fminO:fmaxO).^(-5/3));title('Cq^2 2 2');
%figure;loglog(Fson,Fson.*Sq_3,Fson(fminO:fmaxO),Fson(fminO:fmaxO).*Cq2_3_2*((2*pi/Ubar_3).^(-2/3))./cO.*Fson(fminO:fmaxO).^(-5/3));title('Cq^2 3 2');
%figure;loglog(Fson,Fson.*Sq_4,Fson(fminO:fmaxO),Fson(fminO:fmaxO).*Cq2_4_2*((2*pi/Ubar_4).^(-2/3))./cO.*Fson(fminO:fmaxO).^(-5/3));title('Cq^2 4 2');
%figure;loglog(Fson,Fson.*Sq_5,Fson(fminO:fmaxO),Fson(fminO:fmaxO).*Cq2_5_2*((2*pi/Ubar_5).^(-2/3))./cO.*Fson(fminO:fmaxO).^(-5/3));title('Cq^2 5 2');
%figure;loglog(Fson,Fson.*Sq_6,Fson(fminO:fmaxO),Fson(fminO:fmaxO).*Cq2_6_2*((2*pi/Ubar_6).^(-2/3))./cO.*Fson(fminO:fmaxO).^(-5/3));title('Cq^2 6 2');

y=y_1;x=x_1;Cu2=Cu2_1_2;Ct2=Ct2_1_2;Cq2=Cq2_1_2;Q=Qbar_1;idiss;usid_1_2=us0;tsid_1_2=ts_ib;qsid_1_2=qs_ib;Lid_1_2=z_u/zet;
y=y_2;x=x_2;Cu2=Cu2_2_2;Ct2=Ct2_2_2;Cq2=Cq2_2_2;Q=Qbar_2;idiss;usid_2_2=us0;tsid_2_2=ts_ib;qsid_2_2=qs_ib;Lid_2_2=z_u/zet;
y=y_3;x=x_3;Cu2=Cu2_3_2;Ct2=Ct2_3_2;Cq2=Cq2_3_2;Q=Qbar_3;idiss;usid_3_2=us0;tsid_3_2=ts_ib;qsid_3_2=qs_ib;Lid_3_2=z_u/zet;
y=y_4;x=x_4;Cu2=Cu2_4_2;Ct2=Ct2_4_2;Cq2=Cq2_4_2;Q=Qbar_4;idiss;usid_4_2=us0;tsid_4_2=ts_ib;qsid_4_2=qs_ib;Lid_4_2=z_u/zet;
y=y_5;x=x_5;Cu2=Cu2_5_2;Ct2=Ct2_5_2;Cq2=Cq2_5_2;Q=Qbar_5;idiss;usid_5_2=us0;tsid_5_2=ts_ib;qsid_5_2=qs_ib;Lid_5_2=z_u/zet;
y=y_6;x=x_6;Cu2=Cu2_6_2;Ct2=Ct2_6_2;Cq2=Cq2_6_2;Q=Qbar_6;idiss;usid_6_2=us0;tsid_6_2=ts_ib;qsid_6_2=qs_ib;Lid_6_2=z_u/zet;

%y_y=[y_1 Ubar_1 Tbar_1 Tsea_1 Qbar_1 wu_1(1,2) wv_1(1,2) wt_1(1,2) wa_1(1,2) wh_1(1,2) rho_1 stdC_1 stdA_1 medC_1 medA_1 Ss_1 Sc_1 Sp_1 rain_1
%     y_2 Ubar_2 Tbar_2 Tsea_2 Qbar_2 wu_2(1,2) wv_2(1,2) wt_2(1,2) wa_2(1,2) wh_2(1,2) rho_2 stdC_2 stdA_2 medC_2 medA_2 Ss_2 Sc_2 Sp_2 rain_2
%     y_3 Ubar_3 Tbar_3 Tsea_3 Qbar_3 wu_3(1,2) wv_3(1,2) wt_3(1,2) wa_3(1,2) wh_3(1,2) rho_3 stdC_3 stdA_3 medC_3 medA_3 Ss_3 Sc_3 Sp_3 rain_3
%     y_4 Ubar_4 Tbar_4 Tsea_4 Qbar_4 wu_4(1,2) wv_4(1,2) wt_4(1,2) wa_4(1,2) wh_4(1,2) rho_4 stdC_4 stdA_4 medC_4 medA_4 Ss_4 Sc_4 Sp_4 rain_4
%     y_5 Ubar_5 Tbar_5 Tsea_5 Qbar_5 wu_5(1,2) wv_5(1,2) wt_5(1,2) wa_5(1,2) wh_5(1,2) rho_5 stdC_5 stdA_5 medC_5 medA_5 Ss_5 Sc_5 Sp_5 rain_5
%     y_6 Ubar_6 Tbar_6 Tsea_6 Qbar_6 wu_6(1,2) wv_6(1,2) wt_6(1,2) wa_6(1,2) wh_6(1,2) rho_6 stdC_6 stdA_6 medC_6 medA_6 Ss_6 Sc_6 Sp_6 rain_6];

newview=[ddd+hhh/24+00/24/60 x_1 y_1 Mhead_1 Msog_1 Mcog_1 Un_1 Ue_1 Twindir_1 Reldir_1 wu_1(1,2) wv_1(1,2) wt_1(1,2) wa_1(1,2) wh_1(1,2) wc_1(1,2) wu_1(1,1) wv_1(1,1) wu_1(2,2) wt_1(2,2) rho_1 std_oak_1 std_Qss_1 std_co2_1 Qoph_1 std_abs_1 stdC_1 medC_1 Sp_1 Ss_1 Sc_1 Cu2_1_1 Cu2_1_2 Cw2_1_1 Cw2_1_2 Ct2_1_1 Ct2_1_2 Cq2_1_1 Cq2_1_2 usid_1_1 usid_1_2 tsid_1_1 tsid_1_2 qsid_1_1 qsid_1_2 Lid_1_1 Lid_1_2 start_lon start_lat
         ddd+hhh/24+10/24/60 x_2 y_2 Mhead_2 Msog_2 Mcog_2 Un_2 Ue_2 Twindir_2 Reldir_2 wu_2(1,2) wv_2(1,2) wt_2(1,2) wa_2(1,2) wh_2(1,2) wc_2(1,2) wu_2(1,1) wv_2(1,1) wu_2(2,2) wt_2(2,2) rho_2 std_oak_2 std_Qss_2 std_co2_2 Qoph_2 std_abs_2 stdC_2 medC_2 Sp_2 Ss_2 Sc_2 Cu2_2_1 Cu2_2_2 Cw2_2_1 Cw2_2_2 Ct2_2_1 Ct2_2_2 Cq2_2_1 Cq2_2_2 usid_2_1 usid_2_2 tsid_2_1 tsid_2_2 qsid_2_1 qsid_2_2 Lid_2_1 Lid_2_2 start_lon start_lat
         ddd+hhh/24+20/24/60 x_3 y_3 Mhead_3 Msog_3 Mcog_3 Un_3 Ue_3 Twindir_3 Reldir_3 wu_3(1,2) wv_3(1,2) wt_3(1,2) wa_3(1,2) wh_3(1,2) wc_3(1,2) wu_3(1,1) wv_3(1,1) wu_3(2,2) wt_3(2,2) rho_3 std_oak_3 std_Qss_3 std_co2_3 Qoph_3 std_abs_3 stdC_3 medC_3 Sp_3 Ss_3 Sc_3 Cu2_3_1 Cu2_3_2 Cw2_3_1 Cw2_3_2 Ct2_3_1 Ct2_3_2 Cq2_3_1 Cq2_3_2 usid_3_1 usid_3_2 tsid_3_1 tsid_3_2 qsid_3_1 qsid_3_2 Lid_3_1 Lid_3_2 start_lon start_lat
         ddd+hhh/24+30/24/60 x_4 y_4 Mhead_4 Msog_4 Mcog_4 Un_4 Ue_4 Twindir_4 Reldir_4 wu_4(1,2) wv_4(1,2) wt_4(1,2) wa_4(1,2) wh_4(1,2) wc_4(1,2) wu_4(1,1) wv_4(1,1) wu_4(2,2) wt_4(2,2) rho_4 std_oak_4 std_Qss_4 std_co2_4 Qoph_4 std_abs_4 stdC_4 medC_4 Sp_4 Ss_4 Sc_4 Cu2_4_1 Cu2_4_2 Cw2_4_1 Cw2_4_2 Ct2_4_1 Ct2_4_2 Cq2_4_1 Cq2_4_2 usid_4_1 usid_4_2 tsid_4_1 tsid_4_2 qsid_4_1 qsid_4_2 Lid_4_1 Lid_4_2 end_lon end_lat
         ddd+hhh/24+40/24/60 x_5 y_5 Mhead_5 Msog_5 Mcog_5 Un_5 Ue_5 Twindir_5 Reldir_5 wu_5(1,2) wv_5(1,2) wt_5(1,2) wa_5(1,2) wh_5(1,2) wc_5(1,2) wu_5(1,1) wv_5(1,1) wu_5(2,2) wt_5(2,2) rho_5 std_oak_5 std_Qss_5 std_co2_5 Qoph_5 std_abs_5 stdC_5 medC_5 Sp_5 Ss_5 Sc_5 Cu2_5_1 Cu2_5_2 Cw2_5_1 Cw2_5_2 Ct2_5_1 Ct2_5_2 Cq2_5_1 Cq2_5_2 usid_5_1 usid_5_2 tsid_5_1 tsid_5_2 qsid_5_1 qsid_5_2 Lid_5_1 Lid_5_2 end_lon end_lat
         ddd+hhh/24+50/24/60 x_6 y_6 Mhead_6 Msog_6 Mcog_6 Un_6 Ue_6 Twindir_6 Reldir_6 wu_6(1,2) wv_6(1,2) wt_6(1,2) wa_6(1,2) wh_6(1,2) wc_6(1,2) wu_6(1,1) wv_6(1,1) wu_6(2,2) wt_6(2,2) rho_6 std_oak_6 std_Qss_6 std_co2_6 Qoph_6 std_abs_6 stdC_6 medC_6 Sp_6 Ss_6 Sc_6 Cu2_6_1 Cu2_6_2 Cw2_6_1 Cw2_6_2 Ct2_6_1 Ct2_6_2 Cq2_6_1 Cq2_6_2 usid_6_1 usid_6_2 tsid_6_1 tsid_6_2 qsid_6_1 qsid_6_2 Lid_6_1 Lid_6_2 end_lon end_lat];

sdg=['save d:\temp\y',dfx,'.prn newview -ascii'];
disp(sdg)
eval(sdg)

clear Ch_1 Ch_2 Ch_3 Ch_4 Ch_5 Ch_6 Chs_1 Chs_2 Chs_3 Chs_4 Chs_5 Chs_6
clear Cq2 Ct2 Cu2 F Fo Ct_1 Ct_2 Ct_3 Ct_4 Ct_5 Ct_6
clear Cts_1 Cts_2 Cts_3 Cts_4 Cts_5 Cts_6 Cu_1 Cu_2 Cu_3 Cu_4 Cu_5 Cu_6
clear Cus_1 Cus_2 Cus_3 Cus_4 Cus_5 Cus_6 Cv_1 Cv_2 Cv_3 Cv_4 Cv_5 Cv_6
clear Cvs_1 Cvs_2 Cvs_3 Cvs_4 Cvs_5 Cvs_6 Cw_1 Cw_2 Cw_3 Cw_4 Cw_5 Cw_6
clear Cws_1 Cws_2 Cws_3 Cws_4 Cws_5 Cws_6 Esat_1 Esat_2 Esat_3 Esat_4 Esat_5 Esat_6
clear Q_1 Q_2 Q_3 Q_4 Q_5 Q_6 Fson L LongIR1 LongIR2 P Q Qsea_1 Qsea_2 Qsea_3 Qsea_4 Qsea_5 Qsea_6
clear RHv Solar1 Solar2 T TT Tairv Tsea Tsea_snake Tv Us alphau c
clear Uid_1 Uid_2 Uid_3 Uid_4 Uid_5 Uid_6 c_coeff cog daytest fmax g
clear head hourtest iii lat long qs0 medA_1 medA_2 medA_3 medA_4 medA_5 medA_6
clear stdA_1 stdA_2 stdA_3 stdA_4 stdA_5 stdA_6 qs_ib rho sog ts0 u_id us0
clear us_ib vkon x zet z zi x_1 x_2 x_3 x_4 x_5 x_6 zq zt zu zzz sst Ustream
clear Vstream Wstream abshum Qs Qs_10 RH
