From 92c4a36d3cb851fe2504fb6b020358afe820c1ad Mon Sep 17 00:00:00 2001 From: Douglas Guptill <douglas.guptill@dal.ca> Date: Mon, 27 Jul 2009 16:27:45 +0000 Subject: [PATCH] resize xyz after nnode changed by finding connectivity, delay other allocates that depend on nnode til same place --- define_ov.f90 | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/define_ov.f90 b/define_ov.f90 index 7458f352..4eb44ecd 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 -- GitLab