anchor.diff:              !--------------------------------
               call mpi_allreduce(a, a_reduced, npoints*3, MPI_REAL_XP, MPI_SUM, MPI_COMM_WORLD, err)
               a = a_reduced
  +            deallocate(a_reduced)
            case(1)
  +            allocate(a_comm(3, N))
  +            allocate(a_right(3, N))
  +            allocate(r_i(3, N))
  +            allocate(r_np_i(3, N))
  +            allocate(r_right(3, N))
  +
               !--------------------------------
               ! Scatter positions across all processes
               ! and compute interactions
  
positive.code:                   end if
                 end if
              end do
  
           case default
              stop "Unknown value of flag_compute_mpi"
        end select
  
        deallocate(a_comm)
        deallocate(a_right)
        deallocate(a_reduced)
        deallocate(r_i)
        deallocate(r_np_i)
        deallocate(r_right)
  
     end subroutine compute_force_wrap
  
     subroutine compute_energy (m, r, v, Ec, Ep, E)
  
negative.code:             iend2   = iend*2
              select case (flag_compute_force)
                 case(0)
                    call compute_force(m, r, istart2, iend2, r, istart2, iend2, a)         ! Compute a(t+dt) with sequential version
                 case(1)
                    call compute_force_diag(m, r, istart, iend, npoints, a)                ! Compute a(t+dt) with fast OpenMP version
                 case(2)
                    call compute_force_omp(m, r, istart2, iend2, r, istart2, iend2, a)     ! Compute a(t+dt) with naive OpenMP version
                 case(3)
                    call compute_force_omp_diag(m, r, istart, iend, npoints, a)            ! Compute a(t+dt) with fast OpenMP version
                 case default
                    stop "Unknown value of flag_compute_force"
              end select
  