diff --git a/define_ov.f90 b/define_ov.f90
index 7458f352e0488d3e83c0bc0d86dbffe4e8a55cf6..4eb44ecd8ec4b441c3917767ac29418bcd28507f 100644
--- a/define_ov.f90
+++ b/define_ov.f90
@@ -80,20 +80,24 @@ if (params%irestart.eq.0) then
    allocate (ov%y(ov%nnode),stat=threadinfo%err)        ;  call heap (threadinfo,'ov%y','define_ov',size(ov%y),'dp',+1)
    allocate (ov%z(ov%nnode),stat=threadinfo%err)        ;  call heap (threadinfo,'ov%z','define_ov',size(ov%z),'dp',+1)
    allocate (ov%icon(8,ov%nleaves),stat=threadinfo%err) ;  call heap (threadinfo,'ov%icon','define_ov',size(ov%icon),'int',+1)
-   allocate (ov%unode(ov%nnode),stat=threadinfo%err)    ;  call heap (threadinfo,'ov%unode','define_ov',size(ov%unode),'dp',+1)
-   allocate (ov%vnode(ov%nnode),stat=threadinfo%err)    ;  call heap (threadinfo,'ov%vnode','define_ov',size(ov%vnode),'dp',+1)
-   allocate (ov%wnode(ov%nnode),stat=threadinfo%err)    ;  call heap (threadinfo,'ov%wnode','define_ov',size(ov%wnode),'dp',+1)
-   allocate (ov%temp(ov%nnode),stat=threadinfo%err)     ;  call heap (threadinfo,'ov%temp','define_ov',size(ov%temp),'dp',+1)
-   allocate (ov%temporary_nodal_pressure(ov%nnode),stat=threadinfo%err)
-   call heap (threadinfo,'ov%temporary_nodal_pressure','define_ov',size(ov%temporary_nodal_pressure),'dp',+1)
    allocate (ov%whole_leaf_in_fluid(ov%nleaves),stat=threadinfo%err)
    call heap (threadinfo,'ov%whole_leaf_in_fluid','define_ov',size(ov%whole_leaf_in_fluid),'bool',+1)
    ov%whole_leaf_in_fluid=.false.
-
    
    ! builds the nodal connectivity
    call octree_find_node_connectivity (ov%octree,ov%noctree,ov%icon, &
                                        ov%nleaves,ov%x,ov%y,ov%z,ov%nnode)
+   ! ov%nnode has been changed by octree_find_node_connectivity, so  re-size x, y, z
+   call octreev_shrink_xyz(osolve, threadinfo)
+
+   ! now that ov%nnode is known we can allocate the others
+   allocate (ov%unode(ov%nnode),stat=threadinfo%err)    ;  call heap (threadinfo,'ov%unode','define_ov',size(ov%unode),'dp',+1)
+   allocate (ov%vnode(ov%nnode),stat=threadinfo%err)    ;  call heap (threadinfo,'ov%vnode','define_ov',size(ov%vnode),'dp',+1)
+   allocate (ov%wnode(ov%nnode),stat=threadinfo%err)    ;  call heap (threadinfo,'ov%wnode','define_ov',size(ov%wnode),'dp',+1)
+   allocate (ov%temp(ov%nnode),stat=threadinfo%err)     ;  call heap (threadinfo,'ov%temp','define_ov',size(ov%temp),'dp',+1)
+   allocate (ov%temporary_nodal_pressure(ov%nnode),stat=threadinfo%err)
+   call heap (threadinfo,'ov%temporary_nodal_pressure','define_ov',size(ov%temporary_nodal_pressure),'dp',+1)
+
    ! initializes temp and velo
    ov%unode=0.d0
    ov%vnode=0.d0