function waveplot(t)

%  Plot evolution of eta, x-displacement dx, and v given their fft's ETAH, 
%  DXH and VH, the fft's of eta, dx
%  and v at initial time.  
%  Note time is in units of f^-1, distance in units of R = c0/f. 

global ETARH ETALH ETAGH VRH VLH VGH X K XMIN XMAX YMAX CLIM BETA U
nx = length(X)-1;
xp = X(1:nx);
omr = sign(K).*sqrt(1 + K.^2) + U*K;
oml = -sign(K).*sqrt(1 + K.^2) + U*K;
rphase = exp(-i.*omr*t);
lphase = exp(-i.*oml*t);
omb = - BETA*K./(K.^2 + 1) + U*K;
omb(1) = 0;
gphase = exp(-i*omb*t);


eta = real(ifft(ETARH.*rphase+ETALH.*lphase+ETAGH.*gphase));
eta = [eta eta(1)];
v = real(ifft(VRH.*rphase + VLH.*lphase+VGH.*gphase));
v = [v v(1)];

h = 1 + eta;
plot(X,h);
xlabel('x/R')
ylabel('h')
titlename = sprintf('t = %5.2f',t);
title(titlename)
axis([XMIN XMAX 0 YMAX]);
xylim = axis;
hold on

%  Overplot color for v velocity

xmx = [X;X];
ymx = [(X-X);h];
cmx = [v;v];
pcolor(xmx,ymx,cmx)
shading interp
colormap jet
caxis([-CLIM CLIM]);
axis(xylim);
hold off

end
