disp('prt_stats');
fclose('all');
%This program takes data computed by the read_stats_day progam and creates an ascii
%file appropriate for reading into a spreadsheet (e.g., lotus, quatropro, etc)
%To use it, you must first run the read_stats_day program, or stick this stuff in it

prt_it=1;  %set to 0 to print to screen, 1 to print to a file (i.e., make ascii file)
if prt_it==1
	e='D:\matlabstf\cwf\sheba_proc\proc_stat_may2.txt'
	flist=fopen(e,'a');
else
   flist=1;
end; 
%take stats data and stick into matrix
jaz(1,1:npz)=jz(1:npz);%decimal JD
jaz(2:6,1:npz)=z';%instrument heights
jaz(7:11,1:npz)=spdh';%streamwise winds
jaz(12:16,1:npz)=dirx';%wind direction
jaz(17,1:npz)=Ticex;%snow-ice interface T
jaz(18,1:npz)=Tsrx;%PIR radiative surface T
jaz(19,1:npz)=Th_tn;%General Eastern air potential T
jaz(20:24,1:npz)=Th';%Vaisala potential T
jaz(25:29,1:npz)=Qx';%Vaisala mixing ratio, g/kg
jaz(30,1:npz)=Rtdx;%longwave down
jaz(31,1:npz)=Rtux;%longwave up
jaz(32,1:npz)=Rsdx;%solar down (as if there was any)
jaz(33,1:npz)=Rsux;%solar up
jaz(34,1:npz)=orgx;%optical raingauge, mm/h
jaz(35,1:npz)=ncrx;%ncar tipping raingauge, mm/h
%vectorized print, 35 columns, 24 rows
fprintf(flist,'%9.4f %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f %9.1f %9.1f %9.1f %9.1f %9.1f %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f %8.2f %9.1f %9.1f %9.1f %9.1f %5.2f %5.2f\r',jaz);

fclose('all');
	
