fname='ETAN.0001.nc';

readncfile

% Following Chelton and Schlax (1996), we perform Hovmullers 
% at 39N, 32N, and 21N.  Here we do both Pacific and Atlantic
% than just the Pacific.

ndx21=min(find(abs(lat(1,:)-21)<0.75));  % there are actually 2 grids near 21

ndx32=min(find(abs(lat(1,:)-32)<0.75));  % Same here

ndx39=min(find(abs(lat(1,:)-39)<0.75));  % Same here

adx=[min(find((abs(lon(:,ndx21)+100))<0.75)):min(find((abs(lon(:,ndx21)))<0.75))];
pdx=[min(find((abs(lon(:,ndx21)-120))<0.75)):length(lon(:,ndx21)) 1:min(find((abs(lon(:,ndx21)+100))<0.75))];


lt=length(tim);
ETANanom=0.*ETAN;
ETANmean=mean(ETAN,3);
for tt=1:lt
    ETANanom(:,:,tt)=ETAN(:,:,tt)-ETANmean;
end

figure(1)
pcolor(lon(adx,ndx39),(1:lt)*365/20,squeeze(ETANanom(adx,ndx39,1:lt))');shading('flat')
title('Atlantic SSH Anomalies at 39N')
xlabel('longitude (degE)')
ylabel('days since Jan 1, 1992')

figure(2)
pcolor(mod(lon(pdx,ndx39),360),(1:lt)*365/20,squeeze(ETANanom(pdx,ndx39,1:lt))');shading('flat')
title('Pacific SSH Anomalies at 39N')
xlabel('longitude (degE)')
ylabel('days since Jan 1, 1992')

figure(3)
pcolor(lon(adx,ndx32),(1:lt)*365/20,squeeze(ETANanom(adx,ndx32,1:lt))');shading('flat')
title('Atlantic SSH Anomalies at 32N')
xlabel('longitude (degE)')
ylabel('days since Jan 1, 1992')

figure(4)
pcolor(mod(lon(pdx,ndx32),360),(1:lt)*365/20,squeeze(ETANanom(pdx,ndx32,1:lt))');shading('flat')
title('Pacific SSH Anomalies at 32N')
xlabel('longitude (degE)')
ylabel('days since Jan 1, 1992')

figure(5)
pcolor(lon(adx,ndx21),(1:lt)*365/20,squeeze(ETANanom(adx,ndx21,1:lt))');shading('flat')
title('Atlantic SSH Anomalies at 21N')
xlabel('longitude (degE)')
ylabel('days since Jan 1, 1992')

figure(6)
pcolor(mod(lon(pdx,ndx21),360),(1:lt)*365/20,squeeze(ETANanom(pdx,ndx21,1:lt))');shading('flat')
title('Pacific SSH Anomalies at 21N')
xlabel('longitude (degE)')
ylabel('days since Jan 1, 1992')