diff --git a/src/build_surface_octree.f90 b/src/build_surface_octree.f90
index 585e1a34a6cc3311e33d3d4d2e2513e67ae6e354..d3b3aaa173c256afe9594ccc8899abb69680ef9d 100644
--- a/src/build_surface_octree.f90
+++ b/src/build_surface_octree.f90
@@ -68,14 +68,14 @@ type (thread) threadinfo
 
 integer level,iproc,nproc,ierr,i,j,k,seed
 integer i1,i2,j1,j2,k1,k2,it,kp,ic,icp
-double precision x,y,z,angle,anglemax,dist
+double precision x,y,z,angle,anglemax
+!double precision :: dist
 real cosd
 integer ioctree_number_of_elements
 external ioctree_number_of_elements
 
 double precision, dimension(:), allocatable ::xn,yn,zn
-double precision :: x1,x2,x3,y1,y2,y3,z1,z2,z3,xne,yne,zne,xyzn
-integer i3,ij,err
+integer err
 !------------------------------------------------------------------------------|
 !------------------------------------------------------------------------------|