anchor.diff:        IF(IPRCIX.GE.2)  WRITE(6,*) ' LSCR2 = ', LSCR2
   *
         LSCR12 = MAX(LSCR1,2*LSCR2)  
  -      CALL MEMMAN(KC2,LSCR12,'ADDL  ',2,'KC2   ')
  +      CALL MEMMAN(KC2,LSCR12,'ADDL  ',2,'KC2   ')   !done
         KCJRES = KC2
         KSIRES = KC2 + LSCR2
   *
  
positive.code:       IF(NTEST.GE.10)WRITE(6,*) ' I12, IPERTOP',I12,IPERTOP
  
  *. A bit of scracth 
        CALL MEMMAN(KLJ   ,NTOOB**2,'ADDL  ',2,'KLJ   ')
        CALL MEMMAN(KLK   ,NTOOB**2,'ADDL  ',2,'KLK   ')
        CALL MEMMAN(KLSCR2,2*NTOOB**2,'ADDL  ',2,'KLSC2 ')
        CALL MEMMAN(KLXA  ,NTOOB,   'ADDL  ',2,'KLXA  ')
        CALL MEMMAN(KLXB  ,NTOOB,   'ADDL  ',2,'KLXB  ')
        CALL MEMMAN(KLSCR ,2*NTOOB, 'ADDL  ',2,'KLSCR ')
        CALL MEMMAN(KLH1D ,NTOOB,   'ADDL  ',2,'KLH1D ')
  *. Space for blocks of strings
  C     WRITE(6,*) ' MXNSTR in DIATERM', MXNSTR
        CALL MEMMAN(KLASTR,MXNSTR*NAEL,'ADDL  ',1,'KLASTR')
        CALL MEMMAN(KLBSTR,MXNSTR*NAEL,'ADDL  ',1,'KLBSTR')
        MAXA = IMNMX(WORK(KNSTSO(IATP)),NSMST*NOCTPA,2)
        CALL MEMMAN(KLRJKA,MAXA,'ADDL  ',2,'KLRJKA')
  *. Diagonal of one-body integrals and coulomb and exchange integrals
        IF(IPERTOP.NE.0) CALL SWAPVE(WORK(KFIO),WORK(KINT1),NINT1)
        IF(IUSE_PH.EQ.1) THEN
  
negative.code:         WRITE(6,*) ' JPERT,IPART,I12,IPERTOP',JPERT,IPART,I12,IPERTOP
        END IF
  *. A bit of scracth 
        CALL MEMMAN(KLJ   ,NTOOB**2,'ADDL  ',2,'KLJ   ')  !done
        CALL MEMMAN(KLK   ,NTOOB**2,'ADDL  ',2,'KLK   ')  !done
        CALL MEMMAN(KLSCR2,2*NTOOB**2,'ADDL  ',2,'KLSC2 ') !done
        CALL MEMMAN(KLXA  ,NTOOB,   'ADDL  ',2,'KLXA  ')  !done
        CALL MEMMAN(KLXB  ,NTOOB,   'ADDL  ',2,'KLXB  ')  !done
        CALL MEMMAN(KLSCR ,2*NTOOB, 'ADDL  ',2,'KLSCR ')  !done
        CALL MEMMAN(KLH1D ,NTOOB,   'ADDL  ',2,'KLH1D ')  !done
  *. Space for blocks of strings
  C     WRITE(6,*) ' MXNSTR in DIATERM', MXNSTR
        CALL MEMMAN(KLASTR,MXNSTR*NAEL,'ADDL  ',1,'KLASTR')  !done
        CALL MEMMAN(KLBSTR,MXNSTR*NAEL,'ADDL  ',1,'KLBSTR')  !done
        MAXA = IMNMX(WORK(KNSTSO(IATP)),NSMST*NOCTPA,2)
        CALL MEMMAN(KLRJKA,MAXA,'ADDL  ',2,'KLRJKA')  !done
  *. Diagonal of one-body integrals and coulomb and exchange integrals
        IF(IPERTOP.NE.0) CALL SWAPVE(WORK(KFI),WORK(KINT1O),NINT1)
        IF(IUSE_PH.EQ.1) THEN
  