From 46fe03e078126baff8dfed0f52e362055f63ff70 Mon Sep 17 00:00:00 2001
From: Douglas Guptill <douglas.guptill@dal.ca>
Date: Mon, 29 Jun 2009 16:24:08 +0000
Subject: [PATCH] patch from Jean Braun, print lsf size before crash

---
 embed_surface_in_octree.f90 | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/embed_surface_in_octree.f90 b/embed_surface_in_octree.f90
index 298e911f..3daa6583 100644
--- a/embed_surface_in_octree.f90
+++ b/embed_surface_in_octree.f90
@@ -119,8 +119,11 @@ oint%noctree=osolve%noctree
 oint%nleaves=osolve%nleaves
 oint%nnode=osolve%nnode
 oint%nlsf=osolve%nlsf
+write(*,*) 'oint noctree,nleaves,nnode,nlsf are', oint%noctree,oint%nleaves,oint%nnode,oint%nlsf
 
-allocate (oint%octree(oint%noctree),stat=threadinfo%err)         ; call heap (threadinfo,'oint%octree', 'embed_surf...',size(oint%octree),'int',+1)
+! Bug fixed by Jean on June 24 2009
+!allocate (oint%octree(oint%noctree),stat=threadinfo%err)         ; call heap (threadinfo,'oint%octree', 'embed_surf...',size(oint%octree),'int',+1)
+allocate (oint%octree(params%noctreemax),stat=threadinfo%err)         ; call heap (threadinfo,'oint%octree', 'embed_surf...',size(oint%octree),'int',+1)
 allocate (oint%icon(8,oint%nleaves),stat=threadinfo%err)         ; call heap (threadinfo,'oint%icon', 'embed_surf...',size(oint%icon),'int',+1)
 allocate (oint%lsf(oint%nnode,oint%nlsf),stat=threadinfo%err)    ; call heap (threadinfo,'oint%lsf', 'embed_surf...',size(oint%lsf),'dp',+1)
 allocate (oint%x(oint%nnode),stat=threadinfo%err)                ; call heap (threadinfo,'oint%x', 'embed_surf...',size(oint%x),'dp',+1)
@@ -129,13 +132,15 @@ allocate (oint%z(oint%nnode),stat=threadinfo%err)                ; call heap (th
 
 oint%octree=osolve%octree
 oint%icon=osolve%icon
+if (size(oint%lsf).ne.size(osolve%lsf)) then 
+   write(*,*) 'oint%lsf = osolve%lsf; sizes differ', size(oint%lsf), size(osolve%lsf)
+endif
 oint%lsf=osolve%lsf
 
 oint%x=osolve%x
 oint%y=osolve%y
 oint%z=osolve%z
 
-
 ! having replicated osolve, we can deallocate it
 call heap (threadinfo,'osolve%icon','embed_surf...',size(osolve%icon),'int',-1)              ; deallocate (osolve%icon)                                     
 call heap (threadinfo,'osolve%x','embed_surf...',size(osolve%x),'dp',-1)                     ; deallocate (osolve%x)    
-- 
GitLab