% program to read WOD01 files exported from OCV software
% OUTPUTS
    % date (mo,da,yr,hr,mm)
    % dat (lon,lat,bdepth,depth,qf,temp,qf,sal,qf,o2,qf,chl,qf,plank,qf)
    % qf - qualifier flags: 0=good, 4=questionable, 8=bad
    % missing data assigned -9999
    % saves to all-chl-osd
%
% written by Lisa Taylor, UMaine, 2006
%
close all
clear all
fid=fopen('C:\Documents and Settings\Lisa Taylor\My Documents\Data\WOD01\osd\data\all-chl-osd.txt','r');
junk=fscanf(fid,'%s',[30]); %skip header
i=1;
clear junk
junk=fscanf(fid,'%s',[3]); %skip first 3 data points (cruise, station, type)
while(feof(fid)==0);
    date1=fscanf(fid,'%s',[1]);
    time1=fscanf(fid,'%s',[1]);
    date1time1=strcat(date1,'+',time1);
    date(i,:)=datenum(date1time1);
    for j=1:15 
        junk2=fscanf(fid,'%s',[1]);
        junk3(j)=str2num(junk2);
    end
    dat(i,:)=junk3;
    i=i+1; 
    line=fgetl(fid);
    junk=fscanf(fid,'%s',[3]);
end
%
save  all-chl-osd -v6