%
%  Name: savemodes
% 
%  Usage: savemodes
% 
%   Description:
%    Converts complex modes to real modes
%        ic2rmeth=1 - simply uses real part
%	 ic2rmeth=2 - rounds phases to +/- 180
%	 ic2rmeth=3 - uses Mcmillan transformation
%

%
%  Version SWD970617
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This matlab source code was originally     %
% developed as part of "DIAMOND" at          %
% Los Alamos National Laboratory. It may     %
% be copied, modified, and distributed in    %
% any form, provided:                        %
%  a) This notice accompanies the files and  %
%     appears near the top of all source     %
%     code files.                            %
%  b) No payment or commercial services are  %
%     received in exchange for the code.     %
%                                            %
% Original copyright is reserved by the      %
% Regents of the University of California,   %
% in addition to Scott W. Doebling, Phillip  %
% J. Cornwell, Erik G. Straser, and Charles  %
% R. Farrar.                                 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


if exist('Damp')~=1, Damp=[]; end

phistr = ' ';

if exist('phic_resp')==1, phistr = [phistr ' phic_resp']; end

if exist('phir_resp')==1, phistr = [phistr ' phir_resp']; end

if exist('phic_ref')==1, phistr = [phistr ' phic_ref']; end

if exist('phir_ref')==1, phistr = [phistr ' phir_ref']; end

dofstr = ' ';

if exist('respDOF')==1, dofstr = [dofstr ' respDOF']; end

if exist('refDOF')==1, dofstr = [dofstr ' refDOF']; end

statstr = ' ';

if exist('Freqall')==1, statstr = [statstr ' Freqall']; end

if exist('Dampall')==1, statstr = [statstr ' Dampall']; end

if exist('Phicrespall')==1, statstr = [statstr ' Phicrespall']; end

if exist('Phicrefall')==1, statstr = [statstr ' Phicrefall']; end

eval(['save ',pathname,filename,' Freq Damp ',phistr,dofstr,statstr]);

