disp('prt_rhb_flux_5_07');
fclose('all');
clear jazz;
%This program takes data computed by the timatch_5 progam and creates an ascii
%file appropriate for reading into a spreadsheet (e.g., lotus, quatropro, etc)
%File is written as flux_5hfDDD.txt where DDD is julian day

f=[way_proc_data 'flux_5hf' jd  '.txt'];
flist=fopen(f,'w');
%flist=1;
npz=np;
jazz(1,1:npz)=jad5;      %Decimal julian day at beginning of line
jazz(2,1:npz)=s1;        %etl true wind speed at 18.8 m ht, m/s
jazz(3,1:npz)=dir1;      %etl true wind direction, deg
jazz(4,1:npz)=ts;        %etl seasnake T, C
jazz(5,1:npz)=ts_tsg;    %ship theromsalinograph T, C  bow
jazz(6,1:npz)=sal_tsg;   %ship theromsalinograph salinity, psu  bow
jazz(7,1:npz)=ta;        %etl air T at 18 m, C
jazz(8,1:npz)=qs;        %etl air specific humidity at sea surface, g/kg
jazz(9,1:npz)=qa;        %etl air specific humidity at 18 m, g/kg
jazz(10,1:npz)=psp;      %etl solar flux, w/m^2
jazz(11,1:npz)=pir;      %etl IR flux, w/m^2
jazz(12,1:npz)=org;      %etl optical raingage precip rate, mm/hr
jazz(13,1:npz)=shp_spd;  %ship sog from gps, m/s
jazz(14,1:npz)=shp_hed;  %ship heading from gyrocompass, deg
jazz(15,1:npz)=relsp;    %rel wind speed, m/s
jazz(16,1:npz)=reldir;   %rel wind direction, deg
jazz(17,1:npz)=lat;      %decimal latitude, deg
jazz(18,1:npz)=lon;      %decimal longtude, deg
jazz(19,1:npz)=zt;       %Depth of SST sensor used in heat flux calc, m
jazz(20,1:npz)=sig_sp;   %standard deviation of ship speed, m/s
jazz(21,1:npz)=taub;     %wind stress, coare 3.0, N/m^2
jazz(22,1:npz)=hsb;      %sensible heat flux, coare 3.0, w/m^2
jazz(23,1:npz)=hlb;      %latent heat flux, coare 3.0, w/m^2
jazz(24,1:npz)=rf;       %rain heat flux, w/m^2
jazz(25,1:npz)=ta_im;    %IMET air temp, C (21 m)
jazz(26,1:npz)=qa_im;    %IMET air specific humidity, g/kg (21 m)
jazz(27,1:npz)=s_shp;    %IMET true wind speed, m/s (21 m)
jazz(28,1:npz)=dir_shp;  %IMET true wind direction, deg (21 m)
jazz(29,1:npz)=psp_im;   %IMET solar flux, w/m^2
jazz(30,1:npz)=pir_im;

%vectorized print, 29 columns, up to 288 rows
%                 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
fprintf(flist,'%11.5f\t %8.2f\t %8.1f\t %8.2f\t %8.2f\t %9.3f\t %8.2f\t %8.2f\t %8.2f\t %9.1f\t %9.1f\t %8.1f\t %9.2f\t %9.1f\t %9.2f\t %9.1f\t %12.4f\t %12.4f\t %8.2f\t %8.2f\t %8.3f\t %8.1f\t %8.1f\t %8.1f\t  %8.2f\t %8.2f\t %8.2f\t %8.1f\t %8.2f\t %8.1f\t \r\n',jazz);
%                jd     s2   dir2  tsnk  tsg  salsg  ta     qs    qa    psp    pir  org  shpsp  hed  relu  rldir  lat   lon    zts   sigs   tau   hs   hl     rf 
fclose('all');
	
