%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                        %
%  Plot elementary Spherical Harmonics.  %
%                                        %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
m = 1;
phi = linspace(-pi/2,+pi/2,181);
phideg = (180/pi)*phi;
xax = [ -90 -60 -30 0 30 60 90 ];

%%%%%%%%%%%%%%%%%%   P(1,1) = cos(phi);
psi = cos(phi);
u = sin(phi);
v = 1 + 0*u;
PL1 = subplot(1,2,1);
plot(phideg,psi,'b-'); hold on
plot(phideg,u,'g--','LineWidth',2)
plot(phideg,v,'r-.','LineWidth',2)
p = sin(phi).*psi;
plot(phideg,p,'LineWidth',2)
axis('square');
axis([-90,90,-1.1,1.1]); % title('Y(1,1)');
set(PL1,'XTick',xax);
xlabel('Latitude');
title('Rossby-Haurwitz Wave (m=1,n=1)');

%%%%%%%%%%%%%%%%%%   P(1,2) = sin(phi)*cos(phi);
psi = sin(phi).*cos(phi);
u = -cos(2*phi);
v = sin(phi);
PL2 = subplot(1,2,2);
plot(phideg,psi,'b-'); hold on
plot(phideg,u,'g--','LineWidth',2)
plot(phideg,v,'r-.','LineWidth',2)
axis('square');
axis([-90,90,-1.1,1.1]); % title('Y(1,2)');
set(PL2,'XTick',xax);
xlabel('Latitude');
title('Rossby-Haurwitz Wave (m=1,n=2)');
hold on
p = sin(phi).*psi;
plot(phideg,p,'LineWidth',2)
%%%%%%%%%%%%%%%%%%%%%%%%%

print -deps 'RHwave.eps'

%%%%%%%%%%%%%%%%%%%%%%%%%

