disp('prt_stats_redo3_10min');
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='e:\users\opersson\proc_stat_nw.txt'
%	e='c:\sheba\data\proc_stat_clb_winredo.txt';
	e='C:\Olas_Files\SHEBA\proc_stat_clb_rdo3_10min_spr.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)=Tsnwx;%snow surface T (thermistor)
jaz(19,1:npz)=Tsrx;%PIR radiative surface T
jaz(20,1:npz)=Tbrx;%Barnes surface T in Cent, uncorrected for emissivity/reflection
jaz(21,1:npz)=Vbrx;%Barnes voltage
jaz(22,1:npz)=Th_tn;%General Eastern air T
jaz(23,1:npz)=Tdh_tn;%General Eastern air Td
jaz(24:28,1:npz)=Th';%Vaisala T
jaz(29:33,1:npz)=tsx';%sonic temperatures (uncalibrated)
jaz(34:38,1:npz)=Rhvx';%Vaisala RH (% wrt water)
jaz(39,1:npz)=Rldx;%thermopile longwave down (incoming)
jaz(40,1:npz)=Rlux;%thermopile longwave up (outgoing)
jaz(41,1:npz)=Tcdx;%Tcase longwave down 
jaz(42,1:npz)=Tcux;%Tcase longwave up
jaz(43,1:npz)=Tddx;%Tdome longwave down
jaz(44,1:npz)=Tdux;%Tdome longwave up
jaz(45,1:npz)=Rtdx;%longwave down (incoming)
jaz(46,1:npz)=Rtux;%longwave up (outgoing)
jaz(47,1:npz)=Rsdx;%solar down (incoming)
jaz(48,1:npz)=Rsux;%solar up (outgoing)
jaz(49,1:npz)=orgx;%optical raingauge, mm/h
jaz(50,1:npz)=ncrx;%ncar tipping raingauge, mm/h
jaz(51:55,1:npz)=wlx';%sonic vertical velocities, m/s
%vectorized print, 54 columns, npz 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.4f %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 %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 %10.5f %10.5f %10.5f %10.5f %10.5f\r',jaz);

fclose('all');
	
