% Humboldt University Berlin
% Institute for Mathematics - Dr. Rene Lamour
% *************************************************************
% Purpose:          create a BINARY FILE to contain 
%                   the general parameters
%                   (which are typical for user's TASK)
% *************************************************************
% Name:             init_para_general
%                   -----------------
% Author:           Sigrid Wehner
% Stand:            26.6.03
%
% Name of created 
% binary file is:   parameter_general.mat    
%
% Contains the following parameters:
%                   s_A        = switch for matrix A (df/dy)
%                              = 0 for numerical calculation (default)
%                              = 1 if given by user
%                                (is "Dfy" in radau)
%                   s_D        = switch for matrix D (df/dx)
%                              = 0 for numerical calculation (default)
%                              = 1 if given by user
%                               (is "Dfx" in radau)
%                   s_B        = switch for matrix B (dx/dt)
%                              = 0 for numerical calculation (default)
%                              = 1 if given by user
%                                (is "Dfx" in radau)
%                   s_log      = switch for logfile
%                              = 1 (default) create logfile
%                              = 0 NO logfile
%                   s_sol      = switch for numerical solution
%                              = 1 give numerical solution file
%                              = 0 NO solution output (default)
%                   s_solexact = switch for exact solution
%                              = 1 give file with exact solution
%                              = 0 NO solution output (default)
%                   print_level= 2 level of output
%                                ( 0=no output; 1=standard(screen);
%                                  2=separate files / in main_consi)
% *************************************************************
% - if input argument list is empty:
%      get the defaults as output parameters!
% - if there is ONE dummy input argument:
%      write the binary parameter file BEFORE the matlab 
%      programs will be installed !!!
% *************************************************************

function[s_A, s_D, s_B, s_log, s_sol, s_solexact,print_level]...
        =init_para_general(varargin);

s_A=0;
s_D=0;
s_B=0;
s_log=1;
s_sol=0;
s_solexact=0;
print_level=2;


% Save the parameters to a binary file (if varargin contains any dummy
% variable).
% Attention: The "save" command MUST quote the parameter names explicitly!
% ---------- Otherwise "varargin" would be stored,too. This will lead to 
%            errors when a calling program is also using varargin!!!
%
if(nargin >0 )
   save parameter_general s_A  s_D  s_B s_log s_sol s_solexact print_level;
end;

