      subroutine wrat_to_b(n2d,mlink,namin,namax,wrat,ndel_muca,b)
c bernd berg nov 28 2000. calculation of the microcanonical inverse 
c temperature b(ia)=1/t(ia) from given weight ratio and stepsize arrays. 
      include '../../libs/fortran/implicit.sta'
      include '../../libs/fortran/constants.par'
      dimension b(0:mlink),wrat(-n2d:n2d,0:mlink+n2d),ndel_muca(0:mlink)
      do ilink=0,mlink
        b(ilink)=zero
      end do
      ilink=namin
1     continue
        ndel=ndel_muca(ilink)
        b(ilink+ndel)=log(wrat(ndel,ilink))/(two*ndel)
        ilink=ilink+ndel
      if(ilink.lt.namax) go to 1
      return
      end
