[mpas-developers] nVertices+1

Mark Petersen mpetersen at lanl.gov
Thu Oct 28 15:48:25 MDT 2010


Michael and others,

In the sw and ocean core, there is a section (pasted below) with the line
          if (verticesOnEdge(1,iEdge) <= nVertices) then

I understand that a cell numbered nCells+1 is outside of the local domain. 
But all vertices are always within the local domain, right?  That is, I 
think verticesOnEdge <= nVertices is always true.

If you agree, I will remove the if lines.  Actually, this was already done 
in core_hyd_atmos, so I can just copy it over to sw, and make similar 
changes to the ocean core.

current sw code:

       !
       ! Compute circulation and relative vorticity at each vertex
       !
       circulation(:,:) = 0.0
       do iEdge=1,nEdges
          if (verticesOnEdge(1,iEdge) <= 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) <= 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
       end do


proposed sw code (taken directly from core_hyd_atm):

       !
       ! Compute circulation and relative vorticity at each vertex
       !
       circulation(:,:) = 0.0
       do iEdge=1,nEdges
          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



More information about the mpas-developers mailing list