function [t1,dat]=rd_wetview_new(fnam)
%
%  Program to read WetView ac-9 data files
%
%  INPUTS
%    FNAM = file name to read in.
%
%  OUTPUTS
%    
%  	t1-time for ac9 data
%    dat = AC9 data
%  	t2-time for temp. and pressure data
%    T=temp. P=pressure
%
%
%  Written by Emmanuel Boss, OSU, 1999.
%   

fid=fopen(fnam,'r')

%fid=fopen('c:\data\CoBOP99\cobop990521_084025.dat','r')
%skip first 31 lines
for i=1:31   
   line=fgetl(fid);
end
i=1;
j=1;
junk=fscanf(fid,'%e',[1]);
while(feof(fid)==0)
   t1(i)=junk/1000;
   junk=fscanf(fid,'%e',[18]);
   dat1([1:3])=junk([7:9]);
   dat1([4:6])=junk([13:15]);
   dat1([7:9])=junk([1:3]);
   dat1([10:12])=junk([16:18]);
   dat1([13:15])=junk([4:6]);
   dat1([16:18])=junk([10:12]);
   dat(i,:)=dat1;
   i=i+1;
   junk=fscanf(fid,'%e',[1]);
   if(junk<160)
       line=fgetl(fid);
       junk=fscanf(fid,'%e',[1]);
   end
end
fclose(fid);
