d0=fileparts([pwd,filesep]);
d0=d0(1:strfind(d0,'trunk')+4);
force = true;
root = 'DOnumPap';
% root = 'DOnumPap_ortho';
SetupScript = 'LidDrivenCavitySetup_num';
files = dir(sprintf('%s/Save/%s/LidRefHR*',d0,root));
% app.Nx = 256;
% app.Ny = 256;
% app.dt = 1 / 256 / 8;
% app.T = 5;
% app.PlotIntrvl = 32*2;
% app.S = 3;
% app.MC = 10000;
% app.var = 1;
% dx = 1/app.Nx;
% dy = 1/app.Ny;
for iii = 1:length(files)
    load(sprintf('%s/Save/%s/%s/param.mat',d0,root,files(iii).name)) ;
    app.saveimg = app.savemat;
    app = rmfield(app,'savemat');
    file2 = dir(sprintf('%s/Save/%s/%s/0*.mat',d0,root,files(iii).name));
    k = 0;
    LidDrivenCavity_num_refPlots;
    for jjj = length(file2):-floor(length(file2)/2):1
        if ~exist(sprintf('%s/Save/%s/%s/%05d.png',d0,root,...
                files(iii).name,jjj),'file') || force
            load(sprintf('%s/Save/%s/%s/%s',d0,root,files(iii).name,file2(jjj).name)) ;
            LidDrivenCavity_num_refPlots;
            print('-dpng','-r400',sprintf('%s/Save/%s/%s/%05d.png',d0,root,files(iii).name,jjj));
            fprintf('%s/Save/%s/%s/%05d.png\n',d0,root,files(iii).name,jjj)
            LidDrivenCavity_num_refPlots_eps;
            print('-depsc',sprintf('%s/Save/%s/%s/%05d.eps',d0,root,files(iii).name,jjj));
            fprintf('%s/Save/%s/%s/%05d.eps\n',d0,root,files(iii).name,jjj)
            LidDrivenCavity_num_clrbar;
            print('-dpng','-r400',sprintf('%s/Save/%s/%s/%05d_clrbar.png',d0,root,files(iii).name,jjj));
            fprintf('%s/Save/%s/%s/%05d_clrbar.png\n',d0,root,files(iii).name,jjj)
            k=1;
        else
            fprintf('/%s/%05d.png Exists already\n',files(iii).name,jjj)
        end
        
    end
end