anchor.diff:             CALL COPVEC(dbl_mb(KVEC1),dbl_mb(KVEC2),NVAR)
              CALL DENSI2(1,dbl_mb(KRHO1),dbl_mb(KRHO2),
        &          dbl_mb(KVEC1),dbl_mb(KVEC2),0,0,EXPS2,
  -     &          ISPNDEN,WORK(KSRHO1),WORK(KRHO2AA),WORK(KRHO2AB),
  -     &          WORK(KRHO2BB),1 )
  +     &          ISPNDEN,dbl_mb(KSRHO1),dbl_mb(KRHO2AA),dbl_mb(KRHO2AB),
  +     &          dbl_mb(KRHO2BB),1 )
            ELSE
              CALL REWINO(LUSC1)
              CALL COPVCD(LUSC1,LUSC2,dbl_mb(KVEC1),1,LBLK)
                CALL DENSI2(1,dbl_mb(KRHO1),dbl_mb(KRHO2),
        &            dbl_mb(KVEC1),dbl_mb(KVEC2),LUSC1,LUSC2,EXPS2,ISPNDEN,
  -     &            WORK(KSRHO1),WORK(KRHO2AA),WORK(KRHO2AB),
  -     &            WORK(KRHO2BB),1)
  +     &            dbl_mb(KSRHO1),dbl_mb(KRHO2AA),dbl_mb(KRHO2AB),
  +     &            dbl_mb(KRHO2BB),1)
            END IF
          END IF
   *
  
positive.code:         LH0SCR = 
       &  MAX(6*NSBDETP,4*NSBDETP+4*NOCOB,
       &      MXP1*(MXP1+1)/2+MXP1**2)
          CALL MEMMAN(KH0SCR,LH0SCR      ,'ADDS  ',2,'KH0SCR')
  *. For subspace configurations
          IF(NOCSF.EQ.0) THEN
            CALL MEMMAN(KSBCNFOCC,LOCC_SUB,'ADDL  ',1,'SBCNOC')
            CALL MEMMAN(KSBCNFOP,NCONF_SUB,'ADDL  ',1,'SBCNOP')
          ELSE
           KSBCNFOCC = 0
           KSBCNFOP = 0
  
negative.code:           IF(IDENSI.GE.1)
       &    CALL DENSI2(IDENSI,dbl_mb(KRHO1),dbl_mb(KRHO2),
       &          dbl_mb(KVEC1),dbl_mb(KVEC2),LUSC1,LUHC,EXPS2,
       &          ISPNDEN,dbl_mb(KSRHO1),dbl_mb(KRHO2AA),dbl_mb(KRHO2AB),
       &          dbl_mb(KRHO2BB),1 )
            IF(IPRNT.GT.1.AND.IDENSI.EQ.2)
       &    WRITE(6,*) ' Expectation value of S2', EXPS2
            IF(IDENSI.EQ.2) THEN
  