function [vDate, vHmO, vGTZ, vRHF, vRLF] = readwaves4ColData(strPath, strInFile);
% function [vDate, vHmO, vGTZ, vRHF, vRLF] = readwaves4ColData(strPath, strInFile);
%
% Reads raw data with time series of wave information for periods with significant 
% storms in the Belgiam coast.
% The data has been prepared for the MICORE project: www.micore.eu
% Raw data is in ASCII files and this function is called by another
% functions to convert these raw data files into netCDF format.
%
% #INPUTS:  -strPath: string with the directory path where the raw data is
%            saved. Relative paths are allowed, e.g. '../raw/19931115/'.
%            Include the / sign at the end of the string.
%           -strInFile: string with the name of the input ASCII file.
%            Usually it is a file with 6 columns (date, H33, GTZ, HmO, TPE,
%            TmO2) (date, Hm0, TPE, Tm02, RLF, RHF)???????
%            but some files have only 4 columns (date, Hm0, TPE, Tm02) or 5
%            columns (date, H33, GTZ, TPE, Tm02) (date, H33, GTZ, Hm0,
%            Tm02)??????????????? 
%           -nCols: total number of columns in the file, taking into
%            account the first column with the date.
%
% #OUTPUTS: -vDate: vector (n rowsx 1 col) with the dates in Serial Date Number Format 
%           -vHmO: vector (n rowsx 1 col) with the Significant wave height from the spectrum in m
%           -vGTZ: vector (n rowsx 1 col) with the Average wave period in s
%           -vRHF: Direction of the waves of high frequency');
%           -vRLF: Direction of the waves of low frequency');
%           NOT INCLUDED (NOT PRESENT IN THE INPUT FILE):
%           -vH33: vector (n rowsx 1 col) with the Significant wave height of the 1/3 of the highest waves in m
%           -vTPE: vector (n rowsx 1 col) with the Peak period, period with the highest energy in s
%           -vTmO2: vector (n rowsx 1 col) with the Wave period of the spectrum of momentum m0 and m2 Tm02=sqrt(m0/m2) in s
%
% #REMARKS: The format of the raw data ASCII file is:
%           - Lines of comments starting with % sign
%           - 1st column date: YYYYMMDD.HHmmSS
%           - 2nd to 9th column: magnitudes. Number of columns may vary. 
%             Order of columns is not the same. Nodata values are -999.00
%

% International Marine and Dredging Consultants, IMDC
% www.imdc.be
% Antwerp, Belgium
%
% Written by: Fernando Toro, Piet Haerens
%             fto@imdc.be
% Date: July 2009
% Modified: April 2011
% Date:

% Read water levels file from IMDC data
path = fullfile(strPath, strInFile);
NumLines = 1;
strDelimiter = '/:|';
[B(:,1) B(:,2) B(:,3) B(:,4) B(:,5) vHmO vGTZ vRHF vRLF] = textread(path, ...
    '%d %d %d %d %d %f %f %f %f', 'headerlines', NumLines, 'delimiter',strDelimiter);
vDate = datenum(B(:,3), B(:,2), B(:,1), B(:,4), B(:,5), 0);
