From da965418ff74e5a7c36beb419b7bd4de4441e48a Mon Sep 17 00:00:00 2001
From: s2006749 <s2006749@ed.ac.uk>
Date: Tue, 18 Jun 2024 23:33:35 +0100
Subject: [PATCH] changed location of debug

---
 src/BC-Ellipsoid.f90 | 10 ++++++++--
 src/ellip_utils.f90  | 20 ++++++++++----------
 2 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/src/BC-Ellipsoid.f90 b/src/BC-Ellipsoid.f90
index fac33d7c..1f82800a 100644
--- a/src/BC-Ellipsoid.f90
+++ b/src/BC-Ellipsoid.f90
@@ -22,7 +22,7 @@ subroutine geomcomplex_ellip(epsi,nxi,nxf,ny,nyi,nyf,nzi,nzf,dx,yp,dz,remp)
     use param, only : one, two, ten
     use ibm_param
     use dbg_schemes, only: sqrt_prec
-    use ellipsoid_utils, only: NormalizeQuaternion, is_inside_ellipsoid
+    use ellipsoid_utils, only: NormalizeQuaternion, EllipsoidalRadius
 
     implicit none
 
@@ -81,7 +81,13 @@ subroutine geomcomplex_ellip(epsi,nxi,nxf,ny,nyi,nyf,nzi,nzf,dx,yp,dz,remp)
             point=[xm, ym, zm]
             ! call EllipsoidalRadius(point, position, orientation, shape, r)
             if (cube_flag.eq.0) then 
-                call is_inside_ellipsoid(point, position, orientation, shape, ra, zeromach, is_inside)
+                call EllipsoidalRadius(point,position,orientation,shape,r)
+                is_inside = (r-ra).lt.zeromach
+
+                if (ra /= ra) then
+                    write(*,*) "Nrank = ", nrank
+                    write(*,*) "Point = ", point
+                endif
             else if (cube_flag.eq.1) then
                 is_inside = (abs(xm-position(1)).lt.ra).and.(abs(ym-position(2)).lt.ra).and.(abs(zm-position(3)).lt.ra)
             endif
diff --git a/src/ellip_utils.f90 b/src/ellip_utils.f90
index d89d15ff..f3a707a8 100644
--- a/src/ellip_utils.f90
+++ b/src/ellip_utils.f90
@@ -218,16 +218,16 @@ contains
 
       radius=sqrt_prec(scaled_point(1)**2+scaled_point(2)**2+scaled_point(3)**2)
 
-      if (radius /= radius) then
-        write(*,*) "Got an error in grid check!"
-        write(*,*) "Radius = ", radius
-        write(*,*) "point = ", point
-        write(*,*) "Body centre = ", centre
-        write(*,*) "Translated point = ", trans_point
-        write(*,*) "Orientation = ", orientation
-        write(*,*) "Rotated point = ", rotated_point
-        write(*,*) "Scaled Point = ", scaled_point
-      endif
+      ! if (radius /= radius) then
+      !     write(*,*) "Got an error in grid check!"
+      !     write(*,*) "Radius = ", radius
+      !     write(*,*) "point = ", point
+      !     write(*,*) "Body centre = ", centre
+      !     write(*,*) "Translated point = ", trans_point
+      !     write(*,*) "Orientation = ", orientation
+      !     write(*,*) "Rotated point = ", rotated_point
+      !     write(*,*) "Scaled Point = ", scaled_point
+      ! endif
 
    end subroutine    
 
-- 
GitLab