disp('prt_HiWinGS2013_flux_hr');
fclose('all');
clear jazz;
%This program takes data computed by the amma06_da_red1.m 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 analysis program, or stick a call to thisin it

f=[procturb_path,jdollars,'_flux_hr_',datasetv,'_',dcname,'.txt'];
flist=fopen(f,'w');

npz=length(jda);
jazz(1,1:npz)=jda';						%date
jazz(2,1:npz)=yushp;					%uship
jazz(3,1:npz)=v1;						%u true
jazz(4,1:npz)=thet1;					%true dir
jazz(5,1:npz)=v1rel;					%u rel
jazz(6,1:npz)=thet1rel;					%rel dir
jazz(7,1:npz)=yhead;					%ship heading
jazz(8,1:npz)=yts';						%Ts
jazz(9,1:npz)=y1(:,19)';				%T
jazz(10,1:npz)=yqs';					%qs
jazz(11,1:npz)=y1(:,21)';				%qa	
jazz(12,1:npz)=yhsc;					%hs covariance
jazz(13,1:npz)=yhsib;					%hs ID
jazz(14,1:npz)=yhsb;					%hs bulk						
jazz(15,1:npz)=yhlc_bl;					%hl covariance from licor
jazz(16,1:npz)=yhlib_lic;				%hl ID
jazz(17,1:npz)=yhlb;					%hl bulk
jazz(18,1:npz)=ytaucx;					%stress streamwise covariance
jazz(19,1:npz)=ytaucy;					%   "     xstream
jazz(20,1:npz)=ytauib;					%stress ID
jazz(21,1:npz)=ytaub;					%stress bulk
jazz(22,1:npz)=y1(:,22)';				%solar flux
jazz(23,1:npz)=y1(:,23)';				%IR flux
jazz(24,1:npz)=y1(:,24)';				%ORG rain rate
jazz(25,1:npz)=yj;						%ship plume contam index
jazz(26,1:npz)=y1(:,44)';				%tilt of good data
jazz(27,1:npz)=yjm;						%maneuver index
jazz(28,1:npz)=y1(:,138)';				%ct
jazz(29,1:npz)=y4(:,243);				%cql
jazz(30,1:npz)=y1(:,135)';				%cu
jazz(31,1:npz)=y1(:,137)';				%cw
jazz(32,1:npz)=yhrain;					%Rain heat flux
jazz(33,1:npz)=hl_webar';				%Hl webb flux
jazz(34,1:npz)=y1(:,151)';				%lat
jazz(35,1:npz)=y1(:,150)';				%lon
jazz(36,1:npz)=y1(:,27)';				%zu
jazz(37,1:npz)=y1(:,28)';				%zt
jazz(38,1:npz)=y1(:,29)';				%zq
jazz(39,1:npz)=ysog; 					%uship  scs
jazz(40,1:npz)=v1_scs;					%u true	scs
jazz(41,1:npz)=thet1_scs;				%true dir scs
jazz(42,1:npz)=ycog;					%ship course scs 
jazz(43,1:npz)=y1(:,4)';				%Ts scs
jazz(44,1:npz)=y1(:,5)';				%T scs
% yqs_scs=qsea(y1(:,4));
% jazz(45,1:npz)=yqs_scs';				%qs scs
jazz(45,1:npz)=y1(:,6)';				%qs scs
jazz(46,1:npz)=y1(:,7)';				%qa scs 
jazz(47,1:npz)=y1(:,8)';				%rs scs	 
jazz(48,1:npz)=y1(:,9)';				%rl scs
jazz(49,1:npz)=wco2_licbar;				%w'c' licor
% jazz(50,1:npz)=y3(:,3)';               %Specific Humidity from Licor (g/kg)
% jazz(51,1:npz)=y3(:,15)';              %Stv of Specific Humidity from Licor (g/kg)
% jazz(52,1:npz)=y3(:,5)'; 				 %CO2 concentration from Licor (umol/mol)
% jazz(53,1:npz)=y1(:,157)';                  %atmospheric pressure (mbar)
jazz(50,1:npz)=y3(:,2)';               %Specific Humidity from Licor (g/kg)
jazz(51,1:npz)=y3(:,12)';              %Stv of Specific Humidity from Licor (g/kg)
jazz(52,1:npz)=y3(:,4)'; 				 %CO2 concentration from Licor (umol/mol)
jazz(53,1:npz)=y3(:,14)';                %Stv of CO2 concentration from Licor (umol/mol)
jazz(54,1:npz)=y1(:,157)';                  %atmospheric pressure (mbar)
jazz(55,1:npz)=y1(:,160)';                 %Wind speed (m/s) relative to earth
jazz(56,1:npz)=y1(:,161)';               %Wind direction (deg) from relative to earth

%vectorized print, 53 columns
%                 1     2     3     4     5     6     7      8     9     10   11    12    13    14    15    16    17     18    19    20    21    22     23    24    25    26     27    28    29      30      31    32     33    34      35     36    37   38     39    40     41     42    43    44    45    46    47    48    49     50     51     52 
fprintf(flist,'%11.5f %8.3f %8.3f %8.2f %8.3f %8.2f %8.2f  %8.3f %8.3f %8.3f %8.3f %8.2f %8.2f %8.2f %9.2f %9.2f  %8.4f %8.4f %8.4f %8.4f %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f  %11.5f %11.5f  %11.5f %11.5f  %11.5f %11.5f %11.5f %11.5f %11.5f  %11.5f  %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f \r\n',jazz);
%                jd    ushp utrue dirtr urel  dirrl  head  tsnk  tair   qs    qa    hsc   hsib  hsb   hlc  hlb   taucx taucy tauib  taub  psp   pir   org   J    tilt  jm    ct     cql   cu    cw   RF   webb    lat     lon      zu    zt    zq    sog utruim dirtrim  cog   tsg   taim  qsg   qaim  rsim  rlim  hlcl  wclic  qlic  sgq_lic hlib
fclose('all');
disp(['File written as ' f]);

	
