      subroutine calt66(temp,dtype66,gamma)
c
c   Takes coefficients in data type 66 and returns effective collision
c    strenghts for He-like ions according to Kato & Nakazaki (1989)
c    eq. (6).
c      author: M. Bautista
c
       implicit none
c
      integer nptmpdim
      parameter (nptmpdim=200000)
c
       real dtype66(nptmpdim)
       real temp,gamma
       real eboltz,y,a,b,c,d,e,em1,gam1,dele,gam2,gam3
c
       eboltz=1.160443e+04
       dele=dtype66(1)
       y=dele/temp*eboltz
c
       if (y.lt.1.e-20) then
        print*,'error in calt66. y too low. y=',y
        stop
       endif
       if (y.gt.1.e+20) then
        gamma=0.
        return
       endif
c
       if (y.gt.77.) y=77.
       call expint(y,em1)
       a=dtype66(2)
       b=dtype66(3)
       c=dtype66(4)
       d=dtype66(5)
       e=dtype66(6)
       gam1=y*((a/y+c)+d*.5*(1.-y))+em1*(b-c*y+d*y*y*.5+e/y)
       dele=dtype66(7)
       y=dele/temp*eboltz
       if (y.gt.77.) y=77.
       call expint(y,em1)
       a=dtype66(8)
       b=dtype66(9)
       c=dtype66(10)
       d=dtype66(11)
       e=dtype66(12)
       gam2=y*((a/y+c)+d*.5*(1.-y))+em1*(b-c*y+d*y*y*.5+e/y)
       dele=dtype66(13)
       y=dele/temp*eboltz
       if (y.gt.77.) y=77.
       call expint(y,em1)
       a=dtype66(14)
       b=dtype66(15)
       c=dtype66(16)
       d=dtype66(17)
       e=dtype66(18)
       gam3=y*((a/y+c)+d*.5*(1.-y))+em1*(b-c*y+d*y*y*.5+e/y)
       gamma=gam1+gam2+gam3
       return
       end
