disp('HiWinGS2013_daily');
   %************************  daily averages  ***********	
 clear raind rsd rld rnld hnd ud hsd hld tsd tsgd tmxdd t5d jdd latd lond tad rlclrd rsclrd

   jj0=floor(jdy(1));
[nn,nx]=size(jdy);
mx=floor(nn/144);%%+10;   %to solve the gap between the 2 cruises (otherwise we are missing 8 days in the averaging...)
for i=1:mx
   ii=find(floor(jdy)==jj0);
   jdd(i)=nanmean(jdy(ii));
   raind(i)=nanmean(org(ii));
	rsd(i)=nanmean(rs(ii));
   rld(i)=nanmean(rl(ii));
   rnld(i)=nanmean(rnl(ii));
	hnd(i)=nanmean(hnet(ii));
   ud(i)=nanmean(U(ii));
   hsd(i)=nanmean(Hsbb(ii));
   hld(i)=nanmean(Hlbb(ii));
   tsd(i)=nanmean(Ts(ii));
   tsgd(i)=nanmean(tsg(ii));
   tmxdd(i)=nanmean(tmxd(ii));
   t5d(i)=nanmean(dt5(ii));
   dtd(i)=nanmean(dtw(ii));
   latd(i)=nanmean(lat(ii));
   lond(i)=nanmean(lon(ii));
   rsclrd(i)=nanmean(Rscl(ii));
   rlclrd(i)=nanmean(rlcler(ii));
   jj0=jj0+1;   
end;
figure;plot(latd,rsd./rsclrd,'-o');set(gca,'fontsize',14);axis([latmin latmax 0 1.1]);xlabel('Latitude (deg)');ylabel('Cloud Transmission Coef.');   
jj=find(latd>latmin);
figure;plot(1-rsd(jj)./rsclrd(jj),rld(jj)-rlclrd(jj),'o');set(gca,'fontsize',14);axis([0 1 0 100]);xlabel('1-Transmission Coeff.');ylabel('Measured-Clear IR Flux (W/m^2)');
figure;plot(rsclrd(jj)-rsd(jj),rld(jj)-rlclrd(jj),'o',[0 200],[0 80]);set(gca,'fontsize',14);axis([0 200 0 100]);xlabel('SFC Solar Flux (W/m^2)');ylabel('SFC IR Flux (W/m^2)');	
figure;plot(latd,rsd-rsclrd,'-o',latd,rld-rlclrd,[latmin latmax],[0 0 ]);set(gca,'fontsize',14);axis([latmin latmax -250 100]);xlabel('Latitude (deg)');ylabel('Cloud Forcing (W/m^2)');   
figure;plot(jdd,rsd-rsclrd,'-o',jdd,rld-rlclrd,'-x',[stdt endt],[0 0 ]);set(gca,'fontsize',14);axis([stdt endt -250 100]);xlabel('Year Day (2013)');ylabel('Cloud Forcing (W/m^2)');   

