      subroutine cd05x(i,j,k,l,a,bintx,yintx)
      IMPLICIT REAL*8(A-H,O-X,Z),logical*1(y)
      parameter(maxsym=8,maxorbcas=16)
      include 'maxorb.prm'
      common/dim/iadri ; integer(8) iadri
c
c------------------------------------------
c     stockage des int du type  <i k k j>
c------------------------------------------
c
      common /cs/ noac,nelac,numac(maxorbcas),itype(maxorb),is0,ms2
      common/l40/ hmono(maxorb*(maxorb+1)/2),aj(maxorb*(maxorb+1)/2)
     *,ak(maxorb*(maxorb+1)/2),f(maxorb*(maxorb+1)/2),e0
     *,ajk(maxorb*(maxorb+1)/2),escf
c     common/int/bint(iadri),bintx(iadri)
c     common/bid/yint(iadri),yintx(iadri)
      dimension bintx(iadri),yintx(iadri)
      yw=.false.
      if(i.eq.k) then
         if(j.eq.l) return
      endif
      if(j.eq.k) then
         if(i.eq.l) return
         mini=min(i,l)
         maxi=max0(i,l)
         icom=j
         goto 1
      endif
      if(i.eq.l) then
         mini=min(j,k)
         maxi=max0(j,k)
         icom=i
         goto 1
      endif
      if(i.eq.j) then
         if(k.eq.l) return
         mini=min(l,k)
         maxi=max0(l,k)
         icom=j
         goto 1
      endif
      if(k.eq.l) then
         mini=min(j,i)
         maxi=max0(j,i)
         icom=k
         goto 1
      endif
      return
 1    mm=maxi*(maxi-1)/2+mini
c     if(yw)write(6,*)'yint',(yint(kk),kk=1,200)
      if(yw)write(6,*)'yintx',(yintx(kk),kk=1,200)
      call adri(icom,mini,maxi,iadr)
      if(yw)write(6,*)'adrx i,j,k,l,iadr',icom,mini,maxi,iadr
      if(yintx(iadr)) then
         write(6,*)'dejax',icom,mini,maxi,iadr
         stop
      endif
      bintx(iadr)=a
      yintx(iadr)=.true.
      if(yw)print'(a,i7,3i4,f12.8)','ECHANGE',iadr,icom,mini,maxi,a
      if(itype(icom).eq.1) f(mm)=f(mm)-a
      return
      end
       subroutine cd05x63(icom,j,k,a,bintx,yintx)
      IMPLICIT REAL*8(A-H,O-X,Z),logical*1(y)
      parameter(maxsym=8,maxorbcas=16)
      include 'maxorb.prm'
      common/dim/iadri ; integer(8) iadri
c
c------------------------------------------
c     stockage des int du type  <i k k j>
c------------------------------------------
c
      common /cs/ noac,nelac,numac(maxorbcas),itype(maxorb),is0,ms2
      common/l40/ hmono(maxorb*(maxorb+1)/2),aj(maxorb*(maxorb+1)/2)
     *,ak(maxorb*(maxorb+1)/2),f(maxorb*(maxorb+1)/2),e0
     *,ajk(maxorb*(maxorb+1)/2),escf
c     common/int/bint(iadri),bintx(iadri)
c     common/bid/yint(iadri),yintx(iadri)
      dimension bintx(iadri),yintx(iadri)
      yw=.false.
      mini=k
      maxi=j
      mm=maxi*(maxi-1)/2+mini
      if(yw)write(6,*)'yintx',(yintx(kk),kk=1,200)
      call adri(icom,mini,maxi,iadr)
      if(yw)write(6,*)'adrx i,j,k,l,iadr',icom,mini,maxi,iadr
      if(yw)print'(a,i7,3i4,f12.8)','ECHANGE',iadr,icom,mini,maxi,a
      if(yintx(iadr)) then
         write(6,*)'dejax',icom,mini,maxi,iadr
         stop
      endif
      bintx(iadr)=a
      yintx(iadr)=.true.
      if(itype(icom).eq.1) f(mm)=f(mm)-a
      return
      end
 
