<p><b>mpetersen@lanl.gov</b> 2010-10-29 10:57:23 -0600 (Fri, 29 Oct 2010)</p><p>TRUNK COMMIT, sw core<br>
<br>
Removing unnecessary if statements from time_integration module.<br>
See attached emails for description.  I am making these same revisions <br>
in the ocean core, but in the topography branch that will be merged<br>
soon.<br>
<br>
Date: Thu, 28 Oct 2010 15:48:25 -0600 (MDT)<br>
From: Mark Petersen &lt;mpetersen@lanl.gov&gt;<br>
To: MPAS developers list &lt;mpas-developers@ucar.edu&gt;<br>
Subject: [mpas-developers] nVertices+1<br>
<br>
Michael and others,<br>
<br>
In the sw and ocean core, there is a section (pasted below) with the line<br>
          if (verticesOnEdge(1,iEdge) &lt;= nVertices) then<br>
<br>
I understand that a cell numbered nCells+1 is outside of the local domain.<br>
But all vertices are always within the local domain, right?  That is, I<br>
think verticesOnEdge &lt;= nVertices is always true.<br>
<br>
If you agree, I will remove the if lines.  Actually, this was already done<br>
in core_hyd_atmos, so I can just copy it over to sw, and make similar<br>
changes to the ocean core.<br>
<br>
Date: Thu, 28 Oct 2010 16:48:37 -0600<br>
From: Michael Duda &lt;duda@ucar.edu&gt;<br>
To: Mark Petersen &lt;mpetersen@lanl.gov&gt;<br>
Cc: MPAS developers list &lt;mpas-developers@ucar.edu&gt;<br>
Subject: Re: [mpas-developers] nVertices+1<br>
<br>
Hi, Mark.<br>
<br>
I agree -- it should never be the case that we have an edge in the local<br>
domain (owned + ghost edges) but not both of its endpoints; in other<br>
words, verticesOnEdge(:,1:nEdges) should never be greater than<br>
nVertices. Please feel free to remove these if-tests whenever it's<br>
convenient!<br>
<br>
Cheers,<br>
Michael<br>
<br>
<br>
Date: Thu, 28 Oct 2010 16:23:33 -0600 (MDT)<br>
From: Mark Petersen &lt;mpetersen@lanl.gov&gt;<br>
To: MPAS developers list &lt;mpas-developers@ucar.edu&gt;<br>
Subject: [mpas-developers] two more if statements<br>
<br>
<br>
Here are two more places to remove if statements, where they have remained<br>
in the sw and ocean core but have already been removed from the hyd_atm<br>
core.  Again, I think they are unnecessary.  If everyone agrees, I will<br>
update the sw and ocean cores<br>
<br>
Date: Thu, 28 Oct 2010 16:55:47 -0600<br>
From: Michael Duda &lt;duda@ucar.edu&gt;<br>
To: Mark Petersen &lt;mpetersen@lanl.gov&gt;<br>
Cc: MPAS developers list &lt;mpas-developers@ucar.edu&gt;<br>
Subject: Re: [mpas-developers] two more if statements<br>
<br>
Hi, Mark.<br>
<br>
I also agree that the tests in both of the sections you've identified<br>
below should also be safe to remove. In both cases below, iEdge or eoe<br>
may indeed reference an edge outside the local block, but this reference<br>
would have been switched to the index of the &quot;garbage edge&quot; during<br>
domain setup, and we expect that the values from the garbage edge should<br>
never influence the values of owned cells/edges/vertices. Please feel free<br>
to eliminate these if-tests, too, and thanks for taking such a careful<br>
look through the code!<br>
<br>
Cheers,<br>
Michael<br>
</p><hr noshade><pre><font color="gray">Modified: trunk/mpas/src/core_sw/module_time_integration.F
===================================================================
--- trunk/mpas/src/core_sw/module_time_integration.F        2010-10-28 02:11:18 UTC (rev 584)
+++ trunk/mpas/src/core_sw/module_time_integration.F        2010-10-29 16:57:23 UTC (rev 585)
@@ -779,16 +779,10 @@
       !
       circulation(:,:) = 0.0
       do iEdge=1,nEdges
-         if (verticesOnEdge(1,iEdge) &lt;= nVertices) then
-            do k=1,nVertLevels
-               circulation(k,verticesOnEdge(1,iEdge)) = circulation(k,verticesOnEdge(1,iEdge)) - dcEdge(iEdge) * u(k,iEdge)
-            end do
-         end if
-         if (verticesOnEdge(2,iEdge) &lt;= nVertices) then
-            do k=1,nVertLevels
-               circulation(k,verticesOnEdge(2,iEdge)) = circulation(k,verticesOnEdge(2,iEdge)) + dcEdge(iEdge) * u(k,iEdge)
-            end do
-         end if
+         do k=1,nVertLevels
+            circulation(k,verticesOnEdge(1,iEdge)) = circulation(k,verticesOnEdge(1,iEdge)) - dcEdge(iEdge) * u(k,iEdge)
+            circulation(k,verticesOnEdge(2,iEdge)) = circulation(k,verticesOnEdge(2,iEdge)) + dcEdge(iEdge) * u(k,iEdge)
+         end do
       end do
       do iVertex=1,nVertices
          do k=1,nVertLevels
@@ -845,11 +839,9 @@
       do iEdge = 1,nEdges
          do i=1,nEdgesOnEdge(iEdge)
             eoe = edgesOnEdge(i,iEdge)
-            if (eoe &lt;= nEdges) then
-               do k = 1,nVertLevels
-                 v(k,iEdge) = v(k,iEdge) + weightsOnEdge(i,iEdge) * u(k, eoe)
-              end do
-            end if
+            do k = 1,nVertLevels
+               v(k,iEdge) = v(k,iEdge) + weightsOnEdge(i,iEdge) * u(k, eoe)
+            end do
          end do
       end do
 
@@ -902,20 +894,19 @@
 
       !
       ! Compute pv at the edges
-      !   ( this computes pv_edge at all edges bounding real cells and distance-1 ghost cells )
+      !   ( this computes pv_edge at all edges bounding real cells )
       !
       pv_edge(:,:) = 0.0
       do iVertex = 1,nVertices
         do i=1,grid % vertexDegree
-          iEdge = edgesOnVertex(i,iVertex)
-          if(iEdge &lt;= nEdges) then
-            do k=1,nVertLevels
+           iEdge = edgesOnVertex(i,iVertex)
+           do k=1,nVertLevels
               pv_edge(k,iEdge) =  pv_edge(k,iEdge)  + 0.5 * pv_vertex(k,iVertex)
-            enddo
-          endif
+           end do
         end do
       end do
 
+
       !
       ! Modify PV edge with upstream bias. 
       !

</font>
</pre>