      function opac(d,t)
*
*  compute the total (rad. + cond.) opacity of a specific rho-t point. 
*  This function assumes a pure composition only. (See opac3 for mixtures.)
*  NOTE:  in this version, the Hubbard-Lampe opacities have been replaced
*  by the conductive opacities of itoh et al (see top of code for
*  references.)
*
      implicit double precision(a-h,o-z)

      common/opacs/cso(3,29,8),csr(29),cst(29)
      common/je/je
      common/comp/amhyhe,amheca,x(4)
      dimension two(2)
      data jrow,krow/8,29/
*
* trap point on staggered rho,T grid
*
      j=1 
      k=krow
6     i=(j+k)/2
      if ( t - cst(i) ) 7,7,8 
7     k=i 
      go to 9
8     j=i 
9     if(iabs(j-k)-1) 10,10,6 
10    do 14 i=1,2
      l=k+i-2
      delta=d-csr(l)+1
      j=delta+1
      if(j-1) 11,11,12
11    j=2 
      go to 14
12    if(j-jrow) 14,14,13
13    j=jrow
14    two(i)=cso(je,l,j-1)+(cso(je,l,j)-cso(je,l,j-1))*(delta-j+1)

      orad=two(1)+(two(2)-two(1))*(t-cst(k-1))/(cst(k)-cst(k-1))
      if(dabs(orad).gt.40.) orad=dsign(40.d0,orad)
      ocond = ocon(d,t)
      opac=dlog10(1./(10.**(-orad)+10.**(-ocond)))

      return
      end 

************************************************************************

