<p><b>mpetersen@lanl.gov</b> 2013-04-23 10:02:25 -0600 (Tue, 23 Apr 2013)</p><p>branch commit: tensor_operations.  Last commit before move to github.  Strain rate and tensor divergence operations work, as shown by convergence study.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/tensor_operations/src/core_ocean/Registry.xml
===================================================================
--- branches/ocean_projects/tensor_operations/src/core_ocean/Registry.xml        2013-04-22 01:31:32 UTC (rev 2783)
+++ branches/ocean_projects/tensor_operations/src/core_ocean/Registry.xml        2013-04-23 16:02:25 UTC (rev 2784)
@@ -792,7 +792,7 @@
                 &lt;var name=&quot;strainRate3DEdge&quot; type=&quot;real&quot; dimensions=&quot;SIX nVertLevels nEdges Time&quot; streams=&quot;o&quot; units=&quot;s^{-1}&quot;
                      description=&quot;strain rate tensor at edge, 3D, in symmetric 6-index form&quot;
                 /&gt;
-                &lt;var name=&quot;divTensor3DCell&quot; type=&quot;real&quot; dimensions=&quot;R3 nVertLevels nEdges Time&quot; streams=&quot;o&quot; units=&quot;s^{-2}&quot;
+                &lt;var name=&quot;divTensor3DCell&quot; type=&quot;real&quot; dimensions=&quot;R3 nVertLevels nCells Time&quot; streams=&quot;o&quot; units=&quot;s^{-2}&quot;
                      description=&quot;divergence of the tensor at cell center, as a 3-vector in x,y,z space&quot;
                 /&gt;
                 &lt;var name=&quot;outerProductEdge&quot; type=&quot;real&quot; dimensions=&quot;SIX nVertLevels nEdges Time&quot; streams=&quot;o&quot; units=&quot;m^2 s^{-1}&quot;
@@ -804,7 +804,7 @@
                 &lt;var name=&quot;strainRate3DEdgeSolution&quot; type=&quot;real&quot; dimensions=&quot;SIX nVertLevels nEdges Time&quot; streams=&quot;o&quot; units=&quot;s^{-1}&quot;
                      description=&quot;strain rate solution tensor at edge, 3D, in symmetric 6-index form&quot;
                 /&gt;
-                &lt;var name=&quot;divTensor3DCellSolution&quot; type=&quot;real&quot; dimensions=&quot;R3 nVertLevels nEdges Time&quot; streams=&quot;o&quot; units=&quot;s^{-2}&quot;
+                &lt;var name=&quot;divTensor3DCellSolution&quot; type=&quot;real&quot; dimensions=&quot;R3 nVertLevels nCells Time&quot; streams=&quot;o&quot; units=&quot;s^{-2}&quot;
                      description=&quot;divergence of the tensor solution at cell center, as a 3-vector in x,y,z space&quot;
                 /&gt;
                 &lt;var name=&quot;strainRate3DCellDiff&quot; type=&quot;real&quot; dimensions=&quot;SIX nVertLevels nCells Time&quot; streams=&quot;o&quot; units=&quot;s^{-1}&quot;
@@ -813,7 +813,7 @@
                 &lt;var name=&quot;strainRate3DEdgeDiff&quot; type=&quot;real&quot; dimensions=&quot;SIX nVertLevels nEdges Time&quot; streams=&quot;o&quot; units=&quot;s^{-1}&quot;
                      description=&quot;strain rate difference between solution and computed tensor at edge, 3D, in symmetric 6-index form&quot;
                 /&gt;
-                &lt;var name=&quot;divTensor3DCellDiff&quot; type=&quot;real&quot; dimensions=&quot;R3 nVertLevels nEdges Time&quot; streams=&quot;o&quot; units=&quot;s^{-2}&quot;
+                &lt;var name=&quot;divTensor3DCellDiff&quot; type=&quot;real&quot; dimensions=&quot;R3 nVertLevels nCells Time&quot; streams=&quot;o&quot; units=&quot;s^{-2}&quot;
                      description=&quot;divergence of the tensor difference between solution and computed at cell center, as a 3-vector in x,y,z space&quot;
                 /&gt;
         &lt;/var_struct&gt;

Modified: branches/ocean_projects/tensor_operations/src/operators/mpas_tensor_operations.F
===================================================================
--- branches/ocean_projects/tensor_operations/src/operators/mpas_tensor_operations.F        2013-04-22 01:31:32 UTC (rev 2783)
+++ branches/ocean_projects/tensor_operations/src/operators/mpas_tensor_operations.F        2013-04-23 16:02:25 UTC (rev 2784)
@@ -580,21 +580,21 @@
       strainRate3DCellSolution = 0.0
       divTensor3DCellSolution = 0.0
 
-      cn = 15.0
-      cs = 20.0
-      rot = 3.0 !pii/4.0 !0.0*pii/2
+      cn = 15.0e4
+      cs = 20.0e4
+      rot = 1.0 !pii/4.0 !0.0*pii/2
       p = 2 ! power for polynomial function
 !      test_function_type = 'constant'
-      test_function_type = 'linear_x'
+!      test_function_type = 'linear_x'
 !      test_function_type = 'linear_y'
 !      test_function_type = 'linear_arb_rot'
-!      test_function_type = 'sin_arb_rot'
+      test_function_type = 'sin_arb_rot'
 !      test_function_type = 'power_x'
 !      test_function_type = 'power_y'
 !      test_function_type = 'power_arb_rot'
 
       ld = 100.0e3  ! wavelength in meters
-      pi2l = 2*pii/ld
+      pi2l = pii/ld
       g1 = cn*cos(rot) - cs*sin(rot)
       g2 = cn*sin(rot) + cs*cos(rot)
 
@@ -746,21 +746,20 @@
            yVelocity = f*g2
            normalVelocity(:,iEdge) = xVelocity*edgeNormalVectors(1,iEdge) + yVelocity*edgeNormalVectors(2,iEdge)
            tangentialVelocity(:,iEdge) = xVelocity*edgeTangentVectors(1,iEdge) + yVelocity*edgeTangentVectors(2,iEdge)
-
-           ! solution for div(sigma)
-!           divTensor3DCellSolution(1,:,iEdge) = -pi2l**2*f*(cos(rot)**2*g1 + 0.5*(sin(rot)**2*g1 + sin(rot)*cos(rot)*g2) )
-!           divTensor3DCellSolution(2,:,iEdge) = -pi2l**2*f*(sin(rot)**2*g2 + 0.5*(cos(rot)**2*g2 + sin(rot)*cos(rot)*g1) )
-
         enddo
 
         do iCell = 1,nCells
            r = sqrt(xCell(iCell)**2 + yCell(iCell)**2)
            theta = atan(yCell(iCell)/xCell(iCell))
+           f = sin(pi2l*r*cos(theta-rot))
            fcos = cos(pi2l*r*cos(theta-rot))
 
            strainRate3DCellSolution(1,:,iCell) = pi2l*fcos*cos(rot)*g1
            strainRate3DCellSolution(2,:,iCell) = pi2l*fcos*sin(rot)*g2
-           strainRate3DCellSolution(3,:,iCell) = pi2l*fcos*(cos(rot)*g2+sin(rot)*g1)/2.0
+           strainRate3DCellSolution(4,:,iCell) = pi2l*fcos*(cos(rot)*g2+sin(rot)*g1)/2.0
+
+           divTensor3DCellSolution(1,:,iCell) = -pi2l**2*f*(cos(rot)**2*g1 + 0.5*(sin(rot)**2*g1 + sin(rot)*cos(rot)*g2) )
+           divTensor3DCellSolution(2,:,iCell) = -pi2l**2*f*(sin(rot)**2*g2 + 0.5*(cos(rot)**2*g2 + sin(rot)*cos(rot)*g1) )
         end do
 
      else

</font>
</pre>