anchor.diff:    integer :: i, j, k, i_state, N, ntask
     integer, allocatable :: task_id(:)
     integer :: Nindex
  -  integer, allocatable :: ind(:)
  +  integer :: ind
     !double precision, save :: time0 = -1.d0
     double precision :: time, time0, timeInit, old_tooth
     double precision, external :: omp_get_wtime
  
positive.code: 
    integer(ZMQ_PTR), intent(in)   :: zmq_socket_pull
  
    double precision, intent(in) :: relative_error, E
    double precision, intent(out)  :: mrcc(N_states)
    double precision, allocatable  :: cp(:,:,:,:)
  
    double precision, intent(out)  :: delta(N_states, N_det_non_ref)
    double precision, intent(out)  :: delta_s2(N_states, N_det_non_ref)
    double precision, allocatable  :: delta_loc(:,:,:), delta_det(:,:,:,:)
    double precision, allocatable  :: mrcc_detail(:,:)
    double precision               :: mrcc_mwen(N_states)
    integer(ZMQ_PTR),external      :: new_zmq_to_qp_run_socket
    integer(ZMQ_PTR)               :: zmq_to_qp_run_socket
  
  
negative.code:       delta_s2 += delta_det(:,:,i,2)
      end do
    else
      delta = cp(:,:,cur_cp,1)
      delta_s2 = cp(:,:,cur_cp,2)
      do i=cp_first_tooth(cur_cp)-1,0,-1
        delta += delta_det(:,:,i,1)
        delta_s2 += delta_det(:,:,i,2)
      end do
    end if
    mrcc = E
    call end_zmq_to_qp_run_socket(zmq_to_qp_run_socket)
  end subroutine
  
  