[mpas-developers] nVertices+1

Michael Duda duda at ucar.edu
Thu Oct 28 16:48:37 MDT 2010


Hi, Mark.

I agree -- it should never be the case that we have an edge in the local
domain (owned + ghost edges) but not both of its endpoints; in other
words, verticesOnEdge(:,1:nEdges) should never be greater than
nVertices. Please feel free to remove these if-tests whenever it's
convenient!

Cheers,
Michael


On Thu, Oct 28, 2010 at 03:48:25PM -0600, Mark Petersen wrote:
> 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
> 
> _______________________________________________
> mpas-developers mailing list
> mpas-developers at mailman.ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/mpas-developers


More information about the mpas-developers mailing list