


%  Plot some time series data from the barotropic
%  vorticity model, bvort.f   

%  set default graphics things

set(0,'DefaultTextFontSize',16)
set(0,'DefaultAxesFontSize',14)
set(0,'DefaultAxesLineWidth',1.3)
set(0,'DefaultLineLineWidth',1.5)

%  to draw a legend w/o a box

hl = legend('product','source')
set(hl,'box','off')
set(hl,'Ycolor', [1 1 1])
set(hl,'Xcolor', [1 1 1])



    load basin10.dat;
    [m n] = size(basin10);
    time = zeros(m,1); 
    dvort = time; beta = time; curlt = time; decay = time; 
    advect = time; ske = time; se = time;
  
    time(:) = basin10(:,1);

    ske(:) = basin10(:,2);
    se(:) = basin10(:,3);

    dvort(:) = basin10(:,4);
    beta(:) = basin10(:,5);
    curlt(:) = basin10(:,6);
    decay(:) = basin10(:,7);
    advect(:) = basin10(:,8);

    figure(1)
    clf reset
            
    subplot(2,1,1)
    plot(time,ske)              
    title('Basin avg kinetic energy')

    subplot(2,1,2)
    plot(time,se)
    title('Basin avg enstrophy')
    xlabel('Time, days')


figure(2)
clf reset

  
    plot(time,dvort, time,beta, time,curlt, time,decay, time,advect)
    hold on; plot(time, 0*beta, 'k', 'LineWidth', 2.0)
    xlabel('Time, days')
    ylabel('Vort tendency, mks')
    title('Mid-ocean vorticity balance')
hl = legend('dVort/dt = ', 'betaV + ', 'curlTau +', 'Vort decay + ',...
    'Vort advect')
set(hl,'box','off')
set(hl,'Ycolor', [1 1 1])
set(hl,'Xcolor', [1 1 1])
 

             
    dvort(:) = basin10(:,9);
    beta(:) = basin10(:,10);
    curlt(:) = basin10(:,11);
    decay(:) = basin10(:,12);
    advect(:) = basin10(:,13);

  figure(3)
  clf reset   
    plot(time,dvort, time,beta, time,curlt, time,decay, time,advect)
    hold on; plot(time, 0*beta, 'k', 'LineWidth', 2.0)
    xlabel('Time, days');     ylabel('Vort tendency, mks')
 
    title('Western boundary vorticity balance')
hl = legend('dVort/dt = ', 'betaV + ', 'curlTau +', 'Vort decay + ',...
    'Vort advect')
set(hl,'box','off')
set(hl,'Ycolor', [1 1 1])
set(hl,'Xcolor', [1 1 1])

 
    figure(4)
   clf reset
        
    dvort(:) = basin10(:,14);
    beta(:) = basin10(:,15);
    curlt(:) = basin10(:,16);
    decay(:) = basin10(:,17);
    advect(:) = basin10(:,18);


    plot(time,dvort, time,beta, time,curlt, time,decay, time,advect)
    hold on; plot(time, 0*beta, 'k', 'LineWidth', 2.0)
    xlabel('Time, days');     ylabel('Vort tendency, mks')
 
    title('Basin-averaged vorticity balance')
hl = legend('dVort/dt = ', 'betaV + ', 'curlTau +', 'Vort decay + ',...
    'Vort advect')
set(hl,'box','off')
set(hl,'Ycolor', [1 1 1])
set(hl,'Xcolor', [1 1 1])

    figure(5)
   clf reset
        
    dvort(:) = basin10(:,19);
    beta(:) = basin10(:,20);
    curlt(:) = basin10(:,21);
    decay(:) = basin10(:,22);
    advect(:) = basin10(:,23);


    plot(time,dvort, time,beta, time,curlt, time,decay, time,advect)
    hold on; plot(time, 0*beta, 'k', 'LineWidth', 2.0)
    xlabel('Time, days');     ylabel('Vort tendency, mks')
 
    title('Doldrums (in the) vorticity balance')
hl = legend('dVort/dt = ', 'betaV + ', 'curlTau +', 'Vort decay + ',...
    'Vort advect')
set(hl,'box','off')
set(hl,'Ycolor', [1 1 1])
set(hl,'Xcolor', [1 1 1])
