function Econserv(Ssp1, Ssp2, fr, rotary)
%
%  the function Econserv(Ssp1, Ssp2, fr) calculates and plots the
%  Energy conserving spectra of the spectra Ssp1, Ssp2, with frequency.
%  if the variable 1 is rotary, the Sp1 should be counterclockwise
%  and the Sp2 clockwise.
%
%-------------------------------------------------------------------
%   Written by Vassilis Zervakis, in February 1996, while at
%              AINCO - Interocean, Madrid, Spain.
%-------------------------------------------------------------------
Ssp1 = Ssp1 .* fr;
Ssp2 = Ssp2 .* fr;
figure('Units','cent',...
       'Position',[2 2 11 14],...
       'Name','Energy Conserving K.E. Spectrum');
axes('Units','cent',...
     'Position',[3 2 6 9]) ;
semilogx(fr,Ssp1,'y',fr,Ssp2,'c--') ;
ylabel('cm^2/s^2') ;
xlabel('cph') ;
if rotary == 1,
    legend('counterclockwise','clockwise') ;
  else,
    legend('zonal','meridional') ;
end
