% prt_jas_scs
% VOCALS 2008 :: 2008-10-17 :: Simon de Szoeke
%This program takes data computed by the read_scs_day progam and creates an ascii
%file appropriate for reading into a spreadsheet (e.g., lotus, quatropro, etc)
%Files are written as proc_scsDDD.txt where DDD is julian day
disp(['prt_jas_SCS: ', cruise, ' ', year]);

fclose('all');
clear jaz;

f=[ way_proc_data_flux 'proc_scs' jd  '.txt'];
flist=fopen(f,'w');

%take stats data and stick into matrix
npz=np;

jaz(1,1:npz)=gpstime(1:npz)'./24+ddd;	%pcode gps time,
jaz(2,1:npz)=latm(1:npz)';	%decimal latitude, deg
jaz(3,1:npz)=lonm(1:npz)';	%longitude, deg
jaz(4,1:npz)=cogm(1:npz)';	% pcode cog, deg
jaz(5,1:npz)=sogm(1:npz)';	% pcode sog, m/s
jaz(6,1:npz)=tsgm(1:npz)';	%thermosalinograph T, C
jaz(7,1:npz)=tssm(1:npz)';	%salinity, psu
jaz(8,1:npz)=rhm(1:npz)';	%rel hum,%
jaz(9,1:npz)=tam(1:npz)';	%air t, C
jaz(10,1:npz)=solarm(1:npz)';	%solar flux, w/m^2
jaz(11,1:npz)=lrgm(1:npz);	%laser gyro, deg
jaz(12,1:npz)=imum(1:npz)';	%imet true wind speed, m/s
jaz(13,1:npz)=imdm(1:npz)';	%imet true wind dir, deg
jaz(14,1:npz)=rainm(1:npz)'; %rain, mm 
jaz(15,1:npz)=odecm(1:npz)'; %odec 
jaz(16,1:npz)=irm(1:npz)'; %imet ir

fprintf(flist,'%11.5f %10.4f %10.4f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f  %9.2f %9.2f %9.2f %9.2f \r\n',jaz);
%               time   lat    lon    cog   sog   ts    ss    rh    ta    sol   lrg  speed   dir   rain  odec  ir
%                1      2      3      4     5     6     7    8      9    10     11    12     13    14    15   16                
fclose('all');
	
