function [fid,filename]=open_file_date(level,name);
switch level
case 0 
    %
    %   this is valid for Unix/Linux only
    %
    filename='/dev/null';
    [fid,message]=fopen(filename,'w');
case 1
    fid=1;
    filename=fopen(fid);
case 2
    filename=[name,'_',date,'.log'];
    [fid,message]=fopen(filename,'a+');
otherwise
    disp('open_file_date: choose printlevel = 0, 1 or 2 please!');
    disp('');
    fid=1;
    filename=fopen(fid);
end;