<p><b>mpetersen@lanl.gov</b> 2010-11-22 11:18:55 -0700 (Mon, 22 Nov 2010)</p><p>TRUNK COMMIT<br>
<br>
See Nov 15 mpas emails and responses for more detail.<br>
<br>
The cycle VTX_LOOP statement forced pv_vertex to be zero on boundary <br>
vertices.  pv_vertex, like vorticity, should generally be nonzero<br>
on the boundaries, so cycle VTX_LOOP and associated if was removed.<br>
<br>
Also changed height tendency in sw core:<br>
if (cell1 &lt;= nCells) is no longer needed and has been removed.<br>
If a cell is outside of the local domain, it has number nCells+1, and so<br>
tend_h(k,nCells+1) just accumulates fluxes that are never used.<br>
The hyd_atmos core already includes these changes under<br>
!  calculate omega, update theta<br>
The ocean core had these changes merged from the topography branch.<br>
</p><hr noshade><pre><font color="gray">Modified: trunk/mpas/src/core_hyd_atmos/module_time_integration.F
===================================================================
--- trunk/mpas/src/core_hyd_atmos/module_time_integration.F        2010-11-19 17:30:41 UTC (rev 629)
+++ trunk/mpas/src/core_hyd_atmos/module_time_integration.F        2010-11-22 18:18:55 UTC (rev 630)
@@ -1937,10 +1937,7 @@
       ! Compute height at vertices, pv at vertices, and average pv to edge locations
       !  ( this computes pv_vertex at all vertices bounding real cells )
       !
-      VTX_LOOP: do iVertex = 1,nVertices
-         do i=1,grid % vertexDegree
-            if (cellsOnVertex(i,iVertex) &gt; nCells) cycle VTX_LOOP
-         end do
+      do iVertex = 1,nVertices
          do k=1,nVertLevels
             h_vertex = 0.0
             do i=1,grid % vertexDegree
@@ -1950,7 +1947,7 @@
 
             pv_vertex(k,iVertex) = (fVertex(iVertex) + vorticity(k,iVertex)) / h_vertex
          end do
-      end do VTX_LOOP
+      end do
       ! tdr
 
 

Modified: trunk/mpas/src/core_sw/module_time_integration.F
===================================================================
--- trunk/mpas/src/core_sw/module_time_integration.F        2010-11-19 17:30:41 UTC (rev 629)
+++ trunk/mpas/src/core_sw/module_time_integration.F        2010-11-22 18:18:55 UTC (rev 630)
@@ -314,20 +314,13 @@
       !
       tend_h(:,:) = 0.0
       do iEdge=1,nEdges
-            cell1 = cellsOnEdge(1,iEdge)
-            cell2 = cellsOnEdge(2,iEdge)
-            if (cell1 &lt;= nCells) then
-               do k=1,nVertLevels
-                  flux = u(k,iEdge) * dvEdge(iEdge) * h_edge(k,iEdge)
-                  tend_h(k,cell1) = tend_h(k,cell1) - flux
-               end do 
-            end if
-            if (cell2 &lt;= nCells) then
-               do k=1,nVertLevels
-                  flux = u(k,iEdge) * dvEdge(iEdge) * h_edge(k,iEdge)
-                  tend_h(k,cell2) = tend_h(k,cell2) + flux
-               end do 
-            end if
+         cell1 = cellsOnEdge(1,iEdge)
+         cell2 = cellsOnEdge(2,iEdge)
+         do k=1,nVertLevels
+            flux = u(k,iEdge) * dvEdge(iEdge) * h_edge(k,iEdge)
+            tend_h(k,cell1) = tend_h(k,cell1) - flux
+            tend_h(k,cell2) = tend_h(k,cell2) + flux
+         end do
       end do 
       do iCell=1,grid % nCellsSolve
          do k=1,nVertLevels
@@ -1092,10 +1085,7 @@
       ! Compute height at vertices, pv at vertices, and average pv to edge locations
       !  ( this computes pv_vertex at all vertices bounding real cells and distance-1 ghost cells )
       !
-      VTX_LOOP: do iVertex = 1,nVertices
-         do i=1,grid % vertexDegree
-            if (cellsOnVertex(i,iVertex) &gt; nCells) cycle VTX_LOOP
-         end do
+      do iVertex = 1,nVertices
          do k=1,nVertLevels
             h_vertex(k,iVertex) = 0.0
             do i=1,grid % vertexDegree
@@ -1105,7 +1095,7 @@
 
             pv_vertex(k,iVertex) = (fVertex(iVertex) + vorticity(k,iVertex)) / h_vertex(k,iVertex)
          end do
-      end do VTX_LOOP
+      end do
 
 
       !

</font>
</pre>