disp('prt_AMMA_flux_10');
fclose('all');
clear jazz;
%This program takes data computed by the jas, nar, or kwaj da_red2.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=['C:\Data\AMMA\flux_data\' jdollars 'flux_10.txt'];%jdollars is the 99 field prog name
flist=fopen(f,'w');
%flist=1;

npz=length(jdy);
jazz(1,1:npz)=jdy';						%date
jazz(2,1:npz)=ushp';						%uship
jazz(3,1:npz)=U';							%u true
jazz(4,1:npz)=dir';						%true dir
jazz(5,1:npz)=urel';						%u rel
jazz(6,1:npz)=reldir';					%rel dir
jazz(7,1:npz)=head';						%ship heading
jazz(8,1:npz)=dt(:,4)';					%Ts
jazz(9,1:npz)=ta';						%T
qsx=qsea(dt(:,4));
jazz(10,1:npz)=qsx';						%qs
jazz(11,1:npz)=qa';						%qa	
jazz(12,1:npz)=hsc';						%hs covariance
jazz(13,1:npz)=hsib';					%hs ID
jazz(14,1:npz)=hsbb';					%hs bulk						
jazz(15,1:npz)=hlc_bl';					%hl covariance
jazz(16,1:npz)=hlib_lic';					%hl ID
jazz(17,1:npz)=hlbb';					%hl bulk
jazz(18,1:npz)=-(rhoair.*wu)';		%stress streamwise covariance
jazz(19,1:npz)=-(rhoair.*wv)';		%   "     xstream
jazz(20,1:npz)=(rhoair.*usib.^2)';	%stress ID
jazz(21,1:npz)=taubb';					%stress bulk
jazz(22,1:npz)=rs';						%solar flux
jazz(23,1:npz)=rl';						%IR flux
jazz(24,1:npz)=org';						%ORG rain rate
jazz(25,1:npz)=jplume';					%ship plume contam index
%jazz(26,1:npz)=min(999,sigoph');		%sigoph of good data
jazz(26,1:npz)=tiltx';					%tilt of good data
jazz(27,1:npz)=jmanuv';					%maneuver index
jazz(28,1:npz)=ct';						%ct
jazz(29,1:npz)=co';						%co
jazz(30,1:npz)=cu';						%cu
jazz(31,1:npz)=cw';						%cw
jazz(32,1:npz)=HRF';						%Rain heat flux
jazz(33,1:npz)=hl_webb';					%Hl webb flux
jazz(34,1:npz)=Lat';						%lat
jazz(35,1:npz)=Lon';						%lon
jazz(36,1:npz)=zu_etl';					%zu
jazz(37,1:npz)=zt_etl';					%zt
jazz(38,1:npz)=zq_etl';					%zq
jazz(39,1:npz)=ushp_im'; 				%uship  scs
jazz(40,1:npz)=U_scs';					%u true	scs
jazz(41,1:npz)=dir_scs';				%true dir scs
jazz(42,1:npz)=x(:,101)';				%ship course scs 
jazz(43,1:npz)=tsg';						%Ts scs
jazz(44,1:npz)=ta_im';					%T scs
jazz(45,1:npz)=qs_tsg';					%qs scs
jazz(46,1:npz)=qa_im';					%qa scs	 
jazz(47,1:npz)=rs_im';                  %solar flux  IMET
jazz(48,1:npz)=rl_im';			    %IR flux IMET
%jazz(50,1:npz)=hlc_lic';		    %hl covariance Licor
jazz(49,1:npz)=wco2_lic';           %w�c�
%jazz(52,1:npz)=hlc_oph';             %Cov. Latent Heat Flux from Ophir
jazz(50,1:npz)=q_lic';               %Specific Humidity from Licor (g/kg)
%jazz(54,1:npz)=q_oph';               %Specific Humidity from Ophir (g/kg)
%jazz(55,1:npz)=ophm';                %Median of Ophir Clear Channel (counts/s)
%jazz(56,1:npz)=sigoph';              %Stv of Ophir Clear Channel (counts/s)
jazz(51,1:npz)=sgq_lic';             %Stv of Specific Humidity from Licor (g/kg)
%jazz(58,1:npz)=sgq_oph';             %Stv of Specific Humidity from Ophir (g/kg)
%jazz(59,1:npz)=hlib_lic';					%hl ID
jazz(52,1:npz)=ww;                    %variance of w' ((m/s)^2)
jazz(53,1:npz)=wt_son;                % sonic w'T' covariance before the hunidity contribution
jazz(54,1:npz)=lagtime;               % lagtime between w and O3 calculated by crosscovriance, 10 min lagtime
jazz(55,1:npz)=O3w_o;              % w'O3' calculated with crosscovariance, 10 min lagtime, no webb correction
jazz(56,1:npz)=O3w_h;              % w'O3' calculated with crosscovariance, flux at hourly mean lagtime, no webb correction
jazz(57,1:npz)=O3w_d;              % w'O3' calculated with crosscovariance, flux at dayly mean lagtime, no webb correction
jazz(58,1:npz)=O3mean_o;           % mean O3 concentration cross (ppb)
jazz(59,1:npz)=O3dev_o;            % stdev ozone cross (ppb)
jazz(60,1:npz)=O3w;                % O3'w' with constant lagtime of 5.1 s, and function cov, no webb correction
jazz(61,1:npz)=O3mean;              % mean O3 concentration constant lagtime (ppb)
jazz(62,1:npz)=O3dev;              % stdev ozone constant lagtime (ppb)
jazz(63,1:npz)=-O3w_o./O3mean_o*100;% deposition velocity 10 min lagtime (cm/s)
jazz(64,1:npz)=-O3w_h./O3mean_o*100;% deposition velocity hourly lagtime (cm/s)
jazz(65,1:npz)=-O3w_d./O3mean_o*100;% deposition velocity dayly lagtime (cm/s)
jazz(66,1:npz)=-O3w./O3mean*100;    % deposition velocity 5.1s lagtime (cm/s)
jazz(67,1:npz)=O3w_oc;              % w'O3' calculated with crosscovariance, 10 min lagtime, webb correction
jazz(68,1:npz)=O3w_hc;              % w'O3' calculated with crosscovariance, flux at hourly mean lagtime, webb correction
jazz(69,1:npz)=O3w_dc;              % w'O3' calculated with crosscovariance, flux at dayly mean lagtime, webb correction
jazz(70,1:npz)=O3wc;                 % O3'w' with constant lagtime of 5.1 s, and function cov, webb correction
jazz(71,1:npz)=-O3w_oc./O3mean_o*100;% deposition velocity 10 min lagtime (cm/s)
jazz(72,1:npz)=-O3w_hc./O3mean_o*100;% deposition velocity hourly lagtime (cm/s)
jazz(73,1:npz)=-O3w_dc./O3mean_o*100;% deposition velocity dayly lagtime (cm/s)
jazz(74,1:npz)=-O3wc./O3mean*100;     % deposition velocity 5.1s lagtime (cm/s)
jazz(75,1:npz)=slowO3;
jazz(76,1:npz)=slowO3std;
jazz(77,1:npz)=rho;

%vectorized print, 74 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      53    54      55      56     57    58       59    60
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 %9.2f  %8.4f %8.4f %8.4f %8.4f %9.2f %9.2f %8.2f %8.1f %9.2f %8.3f %12.3e %12.3e %12.3e %12.3e  %9.2f %8.2f  %12.5f %12.5f  %9.2f %8.2f %9.2f %8.3f %8.3f  %9.2f  %9.2f %8.3f %8.3f %8.3f %8.3f %8.1f %8.1f %11.5f %11.5f %11.5f %11.5f %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f  %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f  %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f \r\n',jazz);
%                jd    ushp utrue dirtr urel  dirrl  head  tsnk  tair   qs     qa    hsc   hsib  hsb   hlc   hlib  hlb   taucx taucy tauib  taub  psp   pir   org   J     tilt  jm    ct     cq      cu      cw     RF   webb    lat     lon   zu    zt    zq    sog utruim dirtrim  cog   tsg  taim  qsg   qaim  rsim  rlim  wclic   qlic   sgq_lic ww 
fclose('all');
disp(['File written as ' f]);
	
