anchor.diff:      enddo
       !$OMP END PARALLEL DO
   
  -    !$OMP PARALLEL DO PRIVATE(ni)
  -    do i = 1, nm2
  -        ni = n2(i)
  -        do i_1 = 1, ni
  -            selfl22(i,i_1) = atomic_distl2(q2(i,i_1,:,:), q2(i,i_1,:,:), n2(i), n2(i), &
  -                & sin2(i,i_1,:), sin2(i,i_1,:), width, cut_distance, r_width, c_width)
  -        enddo
  -    enddo
  -    !$OMP END PARALLEL DO
  -
  -
  -    allocate(atomic_distance(maxval(n1), maxval(n2)))
  +    allocate(atomic_distance(maxval(n1), maxval(n1)))
   
       kernels(:,:,:) = 0.0d0
       atomic_distance(:,:) = 0.0d0
   
       !$OMP PARALLEL DO PRIVATE(l2dist,atomic_distance,ni,nj)
  -    do j = 1, nm2
  -        nj = n2(j)
  -        do i = 1, nm1
  +    do j = 1, nm1
  +        nj = n1(j)
  +        do i = 1, j
               ni = n1(i)
   
               atomic_distance(:,:) = 0.0d0
  
positive.code: 
      deallocate(atomic_distance)
      deallocate(selfl21)
      deallocate(selfl22)
      deallocate(sin1)
      deallocate(sin2)
  
  end subroutine fget_kernels_arad
  
  
  subroutine fget_symmetric_kernels_arad(q1, z1, n1, sigmas, nm1, nsigmas, &
          & width, cut_distance, r_width, c_width, kernels)
  
      use arad, only: atomic_distl2
  
      implicit none
  
      ! ARAD descriptors for the training set, format (i,j_1,5,m_1)
      double precision, dimension(:,:,:,:), intent(in) :: q1
  
      ! ARAD atom-types for each atom in each molecule, format (i, j_1, 2)
      double precision, dimension(:,:,:), intent(in) :: z1
  
      ! List of numbers of atoms in each molecule
      integer, dimension(:), intent(in) :: n1
  
      ! Sigma in the Gaussian kernel
      double precision, dimension(:), intent(in) :: sigmas
  
      ! Number of molecules
      integer, intent(in) :: nm1
  
      ! Number of sigmas
      integer, intent(in) :: nsigmas
  
negative.code:     enddo
      !$OMP END PARALLEL DO
  
      allocate(selfl21(nm1, maxval(n1)))
  
      !$OMP PARALLEL DO PRIVATE(ni)
      do i = 1, nm1
  