      subroutine int(index1,index2,phi,cofs,p1,pr,ezero,tr,sbx)
c
c***********************************************************************
c
c     purpose
c        calculates intensity terms used in computation of reflect-
c        ivity
c
c     method
c        performs table interpolation for theta and theta0.
c        uses precomputed lagrangian coefs.
c        calculates izero (intensity term arising from atmos.
c        scattering.also calculates transmittance for reflected
c        radiation)
c        (see programmers guide for more detail)
c
c
c     variables
c       name      type  i/o   description
c       ----      ----  ---   -----------
c
c      arguments
c       index1    i*4    i    table pointer for interpolation tables
c       index2    i*4    i    pointer for r-coeffs.
c       t         r*4    o    transmittance for ground reflected
c                             radiation
c       sb        r*4    o    table values of sb
c
c      common/nltab/          standard tables for northern hemisphere
c                             (see programmers guide for more detail)
c
c***********************************************************************
c
c     -- input parameters
      integer index1, index2
      real*8 phi, cofs(16), p1, pr
c     -- internal parameters
      real*8 inot, ione, itwo, tran
      real*8 zone, ztwo
      real*8 pi
c     -- output parameters
      real*8 ezero, tr, sbx
      include 'tab.inc'
      data pi/3.1415926/
c
c     -- interp. for i0, i1, i2, t  
      inot = 0.0
      zone = 0.0
      ztwo = 0.0
      tran = 0.0
      m=0
      do 100 i=1,4
         l=index1+6*i-6
         do 50 k=1,4
            m=m+1
            y=cofs(m)
            inot = inot + li0rn(l)*y
            zone = zone + z1i0rn(l)*y
            ztwo = ztwo + z2i0rn(l)*y
            tran = tran + ti0rn(l)*y
            l=l+1
50       continue
100   continue
c     -- convert table values into i1, i2, t, and i0
      inot = 10.**inot
      ione = zone * p1 * inot
      itwo = ztwo * pr * p1 * inot
      tran = tran * inot
c     -- compute izero, t, and sbar
      ezero = inot + ione*cosd(phi) + itwo*cosd(2.*phi)
      tr    = tran
      sbx   = sbrn(index2)
c     -- debug print out
      return
      end
