<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 @@
                <var name="strainRate3DEdge" type="real" dimensions="SIX nVertLevels nEdges Time" streams="o" units="s^{-1}"
                 description="strain rate tensor at edge, 3D, in symmetric 6-index form"
                />
-                <var name="divTensor3DCell" type="real" dimensions="R3 nVertLevels nEdges Time" streams="o" units="s^{-2}"
+                <var name="divTensor3DCell" type="real" dimensions="R3 nVertLevels nCells Time" streams="o" units="s^{-2}"
                 description="divergence of the tensor at cell center, as a 3-vector in x,y,z space"
                />
                <var name="outerProductEdge" type="real" dimensions="SIX nVertLevels nEdges Time" streams="o" units="m^2 s^{-1}"
@@ -804,7 +804,7 @@
                <var name="strainRate3DEdgeSolution" type="real" dimensions="SIX nVertLevels nEdges Time" streams="o" units="s^{-1}"
                 description="strain rate solution tensor at edge, 3D, in symmetric 6-index form"
                />
-                <var name="divTensor3DCellSolution" type="real" dimensions="R3 nVertLevels nEdges Time" streams="o" units="s^{-2}"
+                <var name="divTensor3DCellSolution" type="real" dimensions="R3 nVertLevels nCells Time" streams="o" units="s^{-2}"
                 description="divergence of the tensor solution at cell center, as a 3-vector in x,y,z space"
                />
                <var name="strainRate3DCellDiff" type="real" dimensions="SIX nVertLevels nCells Time" streams="o" units="s^{-1}"
@@ -813,7 +813,7 @@
                <var name="strainRate3DEdgeDiff" type="real" dimensions="SIX nVertLevels nEdges Time" streams="o" units="s^{-1}"
                 description="strain rate difference between solution and computed tensor at edge, 3D, in symmetric 6-index form"
                />
-                <var name="divTensor3DCellDiff" type="real" dimensions="R3 nVertLevels nEdges Time" streams="o" units="s^{-2}"
+                <var name="divTensor3DCellDiff" type="real" dimensions="R3 nVertLevels nCells Time" streams="o" units="s^{-2}"
                 description="divergence of the tensor difference between solution and computed at cell center, as a 3-vector in x,y,z space"
                />
        </var_struct>
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>