anchor.diff:      Dijab = 1.0d0
       Elccd = 0.0d0
   
  +
     do iT2=1,maxT ! T amplitude loop
       Eold  = Elccd
       t2old  = t2 !R0.5d0*(t2+t2old) ! uses mixing
  +
       !T2 equations
  +!$OMP PARALLEL PRIVATE(i,j,a,b,k,l,c,d,Dijab,in1)
  +!$OMP DO
       do i=MOZero,nOcc
         do j=MOZero,nOcc 
           do a=nOcc+1,nmo
  
positive.code:         enddo
        enddo
      enddo
  
      Elccd = 0.0d0
  !    E_2 = 0.0d0
  !    E_2OS = 0.0d0
  !    E_2SS = 0.0d0
  
      do i=MOZero,nOcc
        do j=MOZero,i-1
  
negative.code:               enddo
              enddo
  
              if(CCD)then ! do full CCD
              !Terms that are quadratic in T2
                do c = nOcc+1,nmo
                  do d = nOcc+1,nmo
                    do k = MOZero,nOcc
                      do l = MOZero,nOcc
  
                        in1 = in1 + 0.5d0 *  t2old(a,c,i,k)*t2old(d,b,l,j)   * AMO(k,l,c,d)
                        in1 = in1 - 0.5d0 *  t2old(b,c,i,k)*t2old(d,a,l,j)   * AMO(k,l,c,d)
                        in1 = in1 + 0.5d0 *  t2old(b,c,j,k)*t2old(d,a,l,i)   * AMO(k,l,c,d)
                        in1 = in1 - 0.5d0 *  t2old(a,c,j,k)*t2old(d,b,l,i)   * AMO(k,l,c,d)
  
                        in1 = in1 + 0.25d0*  t2old(c,d,i,j)*t2old(a,b,k,l)   * AMO(k,l,c,d)
  
                        in1 = in1 - 0.5d0 *  t2old(a,c,i,j)*t2old(b,d,k,l)   * AMO(k,l,c,d)
                        in1 = in1 + 0.5d0 *  t2old(b,c,i,j)*t2old(a,d,k,l)   * AMO(k,l,c,d)
  
                        in1 = in1 - 0.5d0 *  t2old(a,b,i,k)*t2old(c,d,j,l)   * AMO(k,l,c,d)
                        in1 = in1 + 0.5d0 *  t2old(a,b,j,k)*t2old(c,d,i,l)   * AMO(k,l,c,d)
  
                      enddo
                    enddo
                  enddo
                enddo
              endif
  
  
  !            write(*,*) "t2   ",p3,p4,h1,h2,AMO(p3,p4,h1,h2),AMO(h1,h2,p3,p4)
  !            Dijab = (Eps_SO(p3) + Eps_SO(p4) - Eps_SO(h1) - Eps_SO(h2))
              t2(a,b,i,j) =  1.0d0*in1/Dijab
  