%
%   version 29.07.03
%
function [Bi,rank_ok]=Bi_calc(level,Bim1,Gi,D,Dm,prodPi,Pi,DPiDm,daefile,xfunction,t,...
    s_A,s_D,s_B,tresh,fid,rank_vec,argx,varargin);
global rank_ok;
rank_ok=1;
fprintf(fid,'%s \n','in Bi_calc');
if level==1
  error('Bi_calc: falscher aufruf');
else
  z0=DPiDm(:);
  DPiDm_prime= cal_DPiDm_t(daefile,xfunction,t,s_A,s_D,s_B,z0,tresh,fid,level,rank_vec,argx,varargin{:});
  Bi=(Bim1-Gi*Dm*DPiDm_prime*D*prodPi)*Pi;
end;
  fprintf(fid,'%s \n','out Bi_calc');