% Humboldt University Berlin
% Institute for Mathematics - Dr. Rene Lamour
% *************************************************************
% Program to log the actual parameter status for main_index
% *************************************************************
% Name:               log_parameter_mainindex
%                     -----------------------
% Author:             Sigrid Wehner
% Stand:              26.9.03
% possible
% parameters open
% to user changes: 
% (default values    
% are listed)         
% from main_consi 
% parameters          threshold=1e-9   (threshold for rank determination)
%                     ---------------------------------------------------
%   ** general        s_A=0            (switches for calculation:
%                                       0 numerical, 1 analytical)
%   ** general        s_D=0                 - same for matrix D -
%   ** general        s_B=0                 - same for matrix B -
%                     ----------------------------------------------
%   ** general        print_level=2    (level of output:
%                                       0 no output
%                                       1 standard output (screen)
%                                       2 separate files )
% -----------------------------------------------------------------------

function [] = log_parameter_mainindex(logfile)

% first get the original parameters
[threshold_orig,ep_orig,given_index_orig,...
 s_Bt_orig,s_Dt_orig,s_ft_orig]...
 = init_para_mainconsi;

[s_A_orig,s_D_orig,s_B_orig,s_log_orig,s_sol_orig,...
  s_solexact_orig,print_level_orig]...
  = init_para_general;

% then load the actual user parameters 
load parameter_mainconsi;
load parameter_general;


fparname='_____dummymainindex';
fpar=fopen(fparname,'a');
fprintf(fpar,' =======================================================\n');
currdat=datestr(clock,0);
fprintf(fpar,'%s \n \n',currdat);
fprintf(fpar,'PARAMETER STATUS in matlab program: main_index \n');
fprintf(fpar,'=======================================================\n');
fprintf(fpar,'... user values are (marked if different from default):\n\n');


fprintf(fpar,'    threshold = %g ',threshold);
if (threshold ~= threshold_orig)
  fprintf(fpar,'   ***** default = %g ',threshold_orig);
  end;
fprintf(fpar,'\n');

fprintf(fpar,'    s_A = %g ',s_A);
if (s_A ~= s_A_orig)
  fprintf(fpar,' ***** default = %g ',s_A_orig);
  end;
fprintf(fpar,'\n');

fprintf(fpar,'    s_D = %g ',s_D);
if (s_D ~= s_D_orig)
  fprintf(fpar,' ***** default = %g ',s_D_orig);
  end;
fprintf(fpar,'\n');

fprintf(fpar,'    s_B = %g ',s_B);
if (s_B ~= s_B_orig)
  fprintf(fpar,' ***** default = %g ',s_B_orig);
  end;
fprintf(fpar,'\n');

fprintf(fpar,'    print_level = %g ',print_level);
if (print_level ~= print_level_orig)
  fprintf(fpar,' ***** default = %g ',print_level_orig);
  end;
fprintf(fpar,'\n');

fprintf(fpar,'=======================================================\n');
fclose(fpar);

filprepend(logfile,fparname);
delete(fparname);

