%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                        %
%  Plot elementary Spherical Harmonics.  %
%                                        %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%  figure('Position',[200,200,800,300])

m = 1;

phi = linspace(-pi/2,+pi/2,181);
phideg = (180/pi)*phi;
xax = [ -90 -60 -30 0 30 60 90 ];

%%%%%  Richardson: P = sin^2(phi)*cos(phi);

psi = sin(phi).*cos(phi);
u = -(0.5+1.5*cos(2*phi));
v = sin(phi);
PL1 = subplot(1,2,1)
plot(phideg,psi,'b-',phideg,u,'g--',phideg,v,'r:')
axis('square');
axis([-90,90,-2.1,1.1]); % title('Y(1,2)');
set(PL1,'XTick',xax);
xlabel('Latitude');
title('(a) Richardson''s Wave');
hold on
p = sin(phi).*psi;
plot(phideg,p,'LineWidth',2)
%%  legend('\psi','U','V','P',4);

%%%%%%%%%%%%%%%%%%   P12 = 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-',phideg,u,'g--',phideg,v,'r:')
axis('square');
axis([-90,90,-2.1,1.1]); % title('Y(1,2)');
set(PL2,'XTick',xax);
xlabel('Latitude');
title('(b) Rossby-Haurwitz Wave');
hold on
p = sin(phi).*psi;
plot(phideg,p,'LineWidth',2)
%%  legend('\psi','U','V','P',4);

print -deps 'RHrich.eps'
