
function postpr_flow (dirnow,dirfig,start_date);

stop_date = [datestr(now,'yyyymmdd') '000000'];

runids    = {'csm' , 'hol' , 'egm'};
%
% Matroos station names
%

loc_matroos = {'lichteiland goeree 1' ,'europlatform 2'};

%
% CSM station names
%

loc_csm     = {'LICHTELGRE'           , 'EURPFM'       };

%
% Get the observed hm0 and tp data from Matroos
%

time_obs_hs(1:length(loc_matroos),1:14400) = NaN;
time_obs_tp(1:length(loc_matroos),1:14400) = NaN;
hs_obs     (1:length(loc_matroos),1:14400) = NaN;
tp_obs     (1:length(loc_matroos),1:14400) = NaN;

for istat = 1: length(loc_matroos);
    t(1)  = NaN;
    hs(1) = NaN;
    tp(1) = NaN;
    try;
      [t, hs]=get_series('wave_height_hm0' , 'observed'          , ...
                                             loc_matroos{istat}  , [start_date '000000'], ...
                                             stop_date                               );
       time_obs_hs(istat,1:length(t)) = t;
       hs_obs  (istat,1:length(hs))   = hs;
      [t, tp]=get_series('wave_period_tp'  , 'observed'          , ...
                                             loc_matroos{istat}  , [start_date '000000'], ...
                                             stop_date                               );
       time_obs_tp(istat,1:length(t))  = t;
       tp_obs     (istat,1:length(tp)) = tp;
    catch;
       pause (600);
      [t, hs]=get_series('wave_height_hm0' , 'observed'          , ...
                                             loc_matroos{istat}  , [start_date '000000'], ...
                                             stop_date                               );
       time_obs_hs(istat,1:length(t)) = t;
       hs_obs  (istat,1:length(hs))   = hs;
      [t, tp]=get_series('wave_period_tp'  , 'observed'          , ...
                                             loc_matroos{istat}  , [start_date '000000'], ...
                                             stop_date                               );
       time_obs_tp(istat,1:length(t))  = t;
       tp_obs     (istat,1:length(tp)) = tp;
    end;
end;

%
% Get the computed water level data from csm simulation
%

cd (dirnow);

for istat = 1: length(loc_csm);
    time_cmp (istat,1) = NaN;
    wl_cmp   (istat,1) = NaN;
end;

for istat = 1: length(loc_csm);
    for irun = 1: length(runids);
       nfs     = vs_use(strcat('trih-',runids{irun}),'quiet');

       stations= vs_get('his-const'  ,'NAMST','quiet');

       nstat = strmatch (loc_csm(istat), stations);
       if (length(nstat) > 0);
          val   = qpread   (nfs,'significant wave height','data',0,nstat);
          if (length(val.Time) > 0);
             time_cmp (istat,1:length(val.Time)) = val.Time;
             hs_cmp   (istat,1:length(val.Val))  = val.Val;
          end;
          val   = qpread   (nfs,'peak wave period','data',0,nstat);
          if (length(val.Time) > 0);
             time_cmp (istat,1:length(val.Time)) = val.Time;
             tp_cmp   (istat,1:length(val.Val))  = val.Val;
          end;
          clear val;
       end;
    end;
end;

%
% Plot wave height data
%

for istat = 1: length(loc_matroos);
    figure ('Units','centimeters','Paperunits','centimeters','Position',[1  1   38  20], ...
            'PaperPosition',[1  1   38  20]);
    plot (time_cmp(istat,:),hs_cmp(istat,:),'r','LineWidth',2.0);
    hold on
    plot (time_obs_hs(istat,:),hs_obs(istat,:),'k.','MarkerSize',10.);
    axis([datenum(start_date,'yyyymmdd') + 4   datenum(start_date,'yyyymmdd') + 9    0.0    5.0]);
    set (gca,'LineWidth' ,3.0);
    set (gca,'XTick'     ,[datenum(start_date,'yyyymmdd') + 4 :1: datenum(start_date,'yyyymmdd') + 9]);
    set (gca,'XTickLabel',datestr(get(gca,'XTick')));
    set (gca,'FontSize',15);
    title  (loc_matroos(istat),'Fontsize',20);
    ylabel ('Hs','Fontsize',15);
    legend ('Hind/Forecast','Observation');
    pngnam = [dirfig '\hsig_' loc_matroos{istat}];
    print (gcf,'-dpng',pngnam);
    close;
end;

for istat = 1: length(loc_matroos);
    figure ('Units','centimeters','Paperunits','centimeters','Position',[1  1   38  20], ...
            'PaperPosition',[1  1   38  20]);
    plot (time_cmp(istat,:),tp_cmp(istat,:),'r','LineWidth',2.0);
    hold on
    plot (time_obs_tp(istat,:),tp_obs(istat,:),'k.','MarkerSize',10.);
    axis([datenum(start_date,'yyyymmdd') + 4   datenum(start_date,'yyyymmdd') + 9    0.0    10 ]);
    set (gca,'LineWidth' ,3.0);
    set (gca,'XTick'     ,[datenum(start_date,'yyyymmdd') + 4 :1: datenum(start_date,'yyyymmdd') + 9]);
    set (gca,'XTickLabel',datestr(get(gca,'XTick')));
    set (gca,'FontSize',15);
    title  (loc_matroos(istat),'Fontsize',20);
    ylabel ('Tp','Fontsize',15);
    legend ('Hind/Forecast','Observation');
    pngnam = [dirfig '\tp_' loc_matroos{istat}];
    print (gcf,'-dpng',pngnam);
    close;
end;
