<p><b>mirin</b> 2011-01-12 15:25:46 -0700 (Wed, 12 Jan 2011)</p><p>Fix degenerate triangle issue.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/mpas_cam_coupling/src/core_hyd_atmos/module_advection.F
===================================================================
--- branches/mpas_cam_coupling/src/core_hyd_atmos/module_advection.F        2011-01-07 23:52:24 UTC (rev 681)
+++ branches/mpas_cam_coupling/src/core_hyd_atmos/module_advection.F        2011-01-12 22:25:46 UTC (rev 682)
@@ -358,6 +358,12 @@
       a = acos(max(min(bx*cx + by*cy + bz*cz,1.0),-1.0))      ! Eqn. (3)
       b = acos(max(min(ax*cx + ay*cy + az*cz,1.0),-1.0))      ! Eqn. (2)
       c = acos(max(min(ax*bx + ay*by + az*bz,1.0),-1.0))      ! Eqn. (1)
+
+! Accommodate degenerate triangle
+      if ((b == 0.0) .or. (c == 0.0)) then
+         sphere_angle=0.0
+         return
+      endif
    
       ABx = bx - ax
       ABy = by - ay

</font>
</pre>