%disp('prt_mainfile');
fclose('all');
%This program takes data computed by the make_data_file 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 make_data_file 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\main_file_4.txt';
   flist=fopen(e,'a');
else
   flist=1;
end; 
%take stats data and stick into matrix
jazz(1)=jd_son(j);%decimal JD
jazz(2:3)=ws_i(j,1:2);%wind speed (m/s)at 2m, 10m
jazz(4:5)=wd_i(j,1:2);%wind direction at 2m, 10 m
jazz(6:7)=t_v_i(i,1:2);%temp(C) at 2 m, 10 m
jazz(8:9)=q_v_i(i,1:2);%mixing ratio (g/kg) at 2 m, 10 m
jazz(10)=us_md(j);%ustar (m/s)
jazz(11)=hs_md(j);%sensible heat flux (W/m2)
jazz(12)=T_sn_an(i);%General Eastern 12 cm temp (C)
jazz(13)=Tsnwr(i);%radiative surface temp (C)
jazz(14)=Tice(i);%snow/ice interface temp (C)
jazz(15)=Rtdx(i);%longwave down
jazz(16)=Rtux(i);%longwave up
jazz(17)=Rsdx(i);%solar down (as if there was any)
jazz(18)=Rsux(i);%solar up
jazz(19)=orgx(i);%optical raingauge, mm/h
jazz(20)=ncrx(i);%ncar weighing raingauge, mm/h
%vectorized print, 20 columns, 1 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\r',jazz);

fclose('all');
	
