anchor.diff:         IADD = 0
          CONVER = .TRUE.
          DO 100 IROOT = 1, NROOT
  -         CALL SETVEC(VEC1,0.0D0,NVAR)
  -*
  -         CALL REWINO( LU2)
  +CNW      CALL SETVEC(VEC1,0.0D0,NVAR)
  +         call ga_zero(VEC3)
  +*   
  +CNW      CALL REWINO( LU2)
            DO 60 IVEC = 1, NVEC
  -           CALL FRMDSC(VEC2,NVAR,-1  ,LU2,IMZERO,IAMPACK)
  +CNW        CALL FRMDSC(VEC2,NVAR,-1  ,LU2,IMZERO,IAMPACK)
              FACTOR = AVEC((IROOT-1)*NVEC+IVEC)
  -           CALL VECSUM(VEC1,VEC1,VEC2,1.0D0,FACTOR,NVAR)
  +           call ga_add(FACTOR,VEC2(IVEC),1.0D0,VEC3(1),VEC3(1))
  +CNW        CALL VECSUM(VEC1,VEC1,VEC2,1.0D0,FACTOR,NVAR)
      60    CONTINUE
  -*
  +*        for Olson correction, avoid duplicate work
  +         call ga_copy(VEC3(1),VEC3(2))
  +   
            EIGAPR = EIG(ITER-1,IROOT)
  -         CALL REWINO( LU1)
  +CNW      CALL REWINO( LU1)
            DO 50 IVEC = 1, NVEC
  -           CALL FRMDSC(VEC2,NVAR,-1  ,LU1,IMZERO,IAMPACK)
  +CNW        CALL FRMDSC(VEC2,NVAR,-1  ,LU1,IMZERO,IAMPACK)
              FACTOR = -EIGAPR*AVEC((IROOT-1)*NVEC+ IVEC)
  -           CALL VECSUM(VEC1,VEC1,VEC2,1.0D0,FACTOR,NVAR)
  +           call ga_add(FACTOR,VEC2(IVEC),1.0D0,VEC3(1),VEC3(1))
  +CNW        CALL VECSUM(VEC1,VEC1,VEC2,1.0D0,FACTOR,NVAR)
      50    CONTINUE
              IF ( IPRT  .GE.600 ) THEN
                WRITE(6,*) '  ( HX - EX ) '
  -             CALL WRTMAT(VEC1,1,NVAR,1,NVAR)
  +             call ga_print(VEC3(1))
  +CNW          CALL WRTMAT(VEC1,1,NVAR,1,NVAR)
              END IF
   *  STRANGE PLACE TO TEST CONVERGENCE , BUT ....
  -         RNORM = SQRT( INPROD(VEC1,VEC1,NVAR) )
  +CNW      RNORM = SQRT( INPROD(VEC1,VEC1,NVAR) )
  +         RNORM = SQRT( ga_ddot(VEC3(1),VEC3(1)))
            RNRM(ITER-1,IROOT) = RNORM
            IF(RNORM.LT. TEST ) THEN
               RTCNV(IROOT) = .TRUE.
  
positive.code: *.  1.2 : MULTIPLY WITH INVERSE HESSIAN APROXIMATION TO GET NEW DIRECTIO
           IF( .NOT. RTCNV(IROOT) ) THEN
             IADD = IADD + 1
             CALL REWINO( LUDIA)
             CALL FRMDSC(VEC2,NVAR,-1  ,LUDIA,IMZERO,IAMPACK)
             CALL H0M1TV(VEC2,VEC1,VEC1,NVAR,NPRDIM,IPNTR,
       &                 H0,-EIGAPR,H0SCR,XDUMMY,NP1,NP2,NQ,
       &                 IPRT)
             IF ( IPRT  .GE. 600) THEN
               WRITE(6,*) '  (D-E)-1 *( HX - EX ) '
               CALL WRTMAT(VEC1,1,NVAR,1,NVAR)
             END IF
  *
             IF(IOLSTM .NE. 0 ) THEN
  * add Olsen correction if neccessary
                CALL REWINO(LU3)
                CALL TODSC(VEC1,NVAR,-1,LU3)
  * Current eigen vector
                CALL REWINO( LU1)
                CALL SETVEC(VEC1,0.0D0,NVAR)
                DO 59 IVEC = 1, NVEC
                  CALL FRMDSC(VEC2,NVAR,-1  ,LU1,IMZERO,IAMPACK)
                  FACTOR = AVEC((IROOT-1)*NVEC+ IVEC)
                  CALL VECSUM(VEC1,VEC1,VEC2,1.0D0,FACTOR,NVAR)
     59         CONTINUE
                IF ( IPRT  .GE. 600 ) THEN
                  WRITE(6,*) ' And X  '
                  CALL WRTMAT(VEC1,1,NVAR,1,NVAR)
                END IF
                CALL TODSC(VEC1,NVAR,-1,LU3)
  * (H0 - E )-1  * X
                CALL REWINO( LUDIA)
                CALL FRMDSC(VEC2,NVAR,-1  ,LUDIA,IMZERO,IAMPACK)
                CALL H0M1TV(VEC2,VEC1,VEC2,NVAR,NPRDIM,IPNTR,
       &                   H0,-EIGAPR,H0SCR,XDUMMY,NP1,NP2,NQ,
       &                 IPRT)
                CALL TODSC(VEC2,NVAR,-1,LU3)
  * Gamma = X(T) * (H0 - E) ** -1 * X
                GAMMA = INPROD(VEC2,VEC1,NVAR)
  * is X an eigen vector for (H0 - 1 ) - 1
                CALL VECSUM(VEC2,VEC1,VEC2,GAMMA,-1.0D0,NVAR)
                VNORM = SQRT(MAX(0.0D0,INPROD(VEC2,VEC2,NVAR)))
                IF(VNORM .GT. 1.0D-7 ) THEN
                  IOLSAC = 1
                ELSE
  
negative.code:               END IF
                IF(IOLSAC .EQ. 1 ) THEN
                  IF(IPRT.GE.10) WRITE(6,*) ' Olsen Correction active '
  CNW             CALL REWINO(LU3)
  CNW             CALL FRMDSC(VEC2,NVAR,-1,LU3,IMZERO,IAMPACK)
  CNW             DELTA = INPROD(VEC1,VEC2,NVAR)
                  DELTA = ga_ddot(VEC3(3),VEC3(1))
  CNW             CALL FRMDSC(VEC1,NVAR,-1,LU3,IMZERO,IAMPACK)
  CNW             CALL FRMDSC(VEC1,NVAR,-1,LU3,IMZERO,IAMPACK)
                  FACTOR = -DELTA/GAMMA
                  IF(IPRT.GE.10) WRITE(6,*) ' DELTA,GAMMA,FACTOR'
                  IF(IPRT.GE.10) WRITE(6,*)   DELTA,GAMMA,FACTOR
  CNW             CALL VECSUM(VEC1,VEC1,VEC2,FACTOR,1.0D0,NVAR)
                  call ga_add(FACTOR,VEC3(1),1.0D0,VEC3(3),VEC3(1))
                  IF(IPRT.GE.600) THEN
                    WRITE(6,*) '  Modified new trial vector '
  CNW               CALL WRTMAT(VEC1,1,NVAR,1,NVAR)
                    call ga_print(VEC3(1))
                  END IF
                ELSE
                  IF(IPRT.GT.0) WRITE(6,*) 
       &          ' Inverse correction switched of'
  CNW             CALL REWINO(LU3)
  CNW             CALL FRMDSC(VEC1,NVAR,-1,LU3,IMZERO,IAMPACK)
                END IF
              END IF
  *. 1.3 ORTHOGONALIZE TO ALL PREVIOUS VECTORS
             XNRMI = ga_ddot(VEC3(1),VEC3(1))
  CNW        XNRMI =    INPROD(VEC1,VEC1,NVAR)
  CNW        CALL REWINO( LU1 )
   
             DO 80 IVEC = 1,NVEC+IADD-1
  CNW          CALL FRMDSC(VEC2,NVAR,-1  ,LU1,IMZERO,IAMPACK)
  CNW          OVLAP = INPROD(VEC1,VEC2,NVAR)
  CNW          CALL VECSUM(VEC1,VEC1,VEC2,1.0D0,-OVLAP,NVAR)
               OVLAP = ga_ddot(VEC3(1),VEC1(IVEC))
     80      CONTINUE
  *. 1.4 Normalize vector and check for linear dependency
             SCALE = INPROD(VEC1,VEC1,NVAR)
  