[cig-commits] r11219 - mc/3D/CitcomS/trunk/lib

tan2 at geodynamics.org tan2 at geodynamics.org
Wed Feb 20 17:01:09 PST 2008


Author: tan2
Date: 2008-02-20 17:01:09 -0800 (Wed, 20 Feb 2008)
New Revision: 11219

Modified:
   mc/3D/CitcomS/trunk/lib/Full_tracer_advection.c
Log:
Fixed issue139. Bug for tracers near South pole.


Modified: mc/3D/CitcomS/trunk/lib/Full_tracer_advection.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Full_tracer_advection.c	2008-02-21 01:00:21 UTC (rev 11218)
+++ mc/3D/CitcomS/trunk/lib/Full_tracer_advection.c	2008-02-21 01:01:09 UTC (rev 11219)
@@ -2524,17 +2524,16 @@
 static void fix_theta_phi(double *theta, double *phi)
 {
     const double two_pi=2.0*M_PI;
-    double d, d2;
 
-    d = floor(*theta/M_PI);
+    fix_phi(theta);
 
-    *theta -= M_PI * d;
-    *phi += M_PI * d;
+    if (*theta > M_PI) {
+        *theta = two_pi - *theta;
+        *phi += M_PI;
+    }
 
-    d2 = floor(*phi / two_pi);
+    fix_phi(phi);
 
-    *phi -= two_pi * d2;
-
     return;
 }
 



More information about the cig-commits mailing list