%testCase = 'Bottom_Gravity_Current_001';

opengl neverselect;
addpath ('/home/phaley/Students/Jing/FV_Matlab_Framework_JingPJH/trunk/Src/Util');

databasedir = '../../Save_Class2/mat/Bottom_Gravity_Current_Det_';
runIDs = 1:9;
timind = [0 60];
%%
modelnames = { '\DeltaS=1.5, S_{init}=exp(2); q_{BC}=D_{inlet}', ...
               '\DeltaS=1.5, S_{init}=exp(8); q_{BC}=D_{inlet}', ...
               '\DeltaS=3.0, S_{init}=cosine; q_{BC}=D_{inlet}', ...
               '\DeltaS=3.0, S_{init}=linear; q_{BC}=D_{inlet}', ...
               '\DeltaS=3.0, S_{init}=exp(2); q_{BC}=D_{inlet}', ...
               '\DeltaS=3.0, S_{init}=exp(8); q_{BC}=D_{inlet}', ...
               '\DeltaS=3.0, S_{init}=cos+exp(5); q_{BC}=D_{inlet}', ...
               '\DeltaS=3.0, S_{init}=linear+exp(5); q_{BC}=D_{inlet}', ...
               '\DeltaS=3.0, S_{init}=cos+linear; q_{BC}=D_{inlet}', ...
               '\DeltaS=3.0, S_{init}=exp(8); q_{BC}=Orig', ...
               '\DeltaS=3.0, S_{init}=cos+exp(5); q_{BC}=Orig', ...
 } ;

load (fullfile([databasedir,num2str(runIDs(1),'%3.3d')],'setup'));
XP=XP*h/1000;
YP=YP*h/1000;
b=b*h/1000;
ymin=0.6;

ridgex = [0 33.2667 33.2667 7.414 0].*(h/1000);
ridgey = [0 0 4.25 5.37 5.37].*(h/1000);
ridgeColor = [105 105 105]/255;

for k = 1:length(timind);

    clf;
    
    for m = 1:length(runIDs);

       load (fullfile([databasedir,num2str(runIDs(m),'%3.3d')],num2str(timind(k),'%3.3d')),'rho');
    
        subplot(3,3,m);
        rhoplot=rho.*DelS;
        rhoplot(1:Nbcs) = NaN;   

        pcolor(XP,YP,rhoplot(NodeP(2:app.Ny+1, 2:app.Nx+1))),shading interp
        set (gca,'DataAspectRatio',[1 0.4 1]);
        %pcolor(flipud(dvdx-dudy)),shading interp,caxis([-100,100])
        %set(gca,'FontSize',12);
        %colorbar
        caxis([0 DelS]);set(gca,'YLim',[ymin b],'FontWeight','Bold');
        title(modelnames{m});
        hold on;
        patch(ridgex,ridgey,ridgeColor)
    
       colormap(mk_colmap)
   end;

   print (gcf,'-dpng',['do_runs_',num2str(timind(k),'%3.3d'),'.png']);

end;

