function [time,Hs,Hl] = read_flux(path, period)
z = dir([path 'nsa30ecorE10*']);
Archive = [];
for i = 1:length(z)
    x = rd_netcdf([path z(i).name]);
    y = attribute_list([path z(i).name]);
    time = double(x.base_time)/60/60/24 + datenum([1970 1 1 0 0 0]) + double(x.time/60/60/24);
    % QC
    Hs = x.h;
    Hs(x.qc_h > 0) = NaN;
    Hl = x.lv_e;
    Hl(x.qc_lv_e > 0) = NaN;
    % accumulate
    Archive = [Archive; time double(Hs) double(Hl)  double(Hm) double(ustar) double(Hc)];
end

Archive(Archive(:,1) < datenum(period(1,:)) | Archive(:,1) >= datenum(period(2,:)),:) = [];
fclose all;

% interpret
time = Archive(:,1);
Hs = Archive(:,2);
Hl = Archive(:,3);
