anchor.diff:              IF(IDENSI.EQ.1) THEN
                 KRHO2 = 1
               END IF
  -            CALL DENSI2(IDENSI,dbl_mb(KRHO1),WORK(KRHO2),
  +            CALL DENSI2(IDENSI,dbl_mb(KRHO1),dbl_mb(KRHO2),
        &      KPVEC1,KPVEC2,0,0,EXPS2,ISPNDEN,WORK(KSRHO1),
        &      WORK(KRHO2AA),WORK(KRHO2AB),WORK(KRHO2BB),1)
             ELSE
               CALL REWINO(LUSC1)
               CALL REWINO(LUC)
               CALL COPVCD(LUC,LUSC1,dbl_mb(KVEC1),0,LBLK)
  -            CALL DENSI2(IDENSI,dbl_mb(KRHO1),WORK(KRHO2),
  +            CALL DENSI2(IDENSI,dbl_mb(KRHO1),dbl_mb(KRHO2),
        &          dbl_mb(KVEC1),dbl_mb(KVEC2),LUC,LUSC1,EXPS2,
        &          ISPNDEN,WORK(KSRHO1),WORK(KRHO2AA),WORK(KRHO2AB),
        &          WORK(KRHO2BB),1 )
  
positive.code:          write(fn,'(E22.15)')enrep
           end if
           close(fn)
  c.. Now that the integrals are in g_lu1e and g_lu2e, fully packed. 
  
         ELSE IF (INTIMP .EQ. 5) THEN
  *
  
negative.code:          call ga_get(g_hcore,i,i,j,j,int1e,1)
  c        write(6,'(E22.15)')int1e
  c        write(fn,'(E22.15)')int1e
           call ga_put(KINT1,1,1,ind1e,ind1e,int1e,1)
            end do
           end do 
  c.. 2e ints
  