<p><b>dwj07@fsu.edu</b> 2012-06-07 10:09:43 -0600 (Thu, 07 Jun 2012)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Renaming block_creator vertex routines to edge, to be more consistent with the block_decomp routines.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/omp_blocks/multiple_blocks/src/framework/mpas_block_creator.F
===================================================================
--- branches/omp_blocks/multiple_blocks/src/framework/mpas_block_creator.F        2012-06-07 15:30:13 UTC (rev 1971)
+++ branches/omp_blocks/multiple_blocks/src/framework/mpas_block_creator.F        2012-06-07 16:09:43 UTC (rev 1972)
@@ -267,42 +267,42 @@
!***********************************************************************
!
-! routine mpas_block_creator_build_0_and_1halo_vertex_fields
+! routine mpas_block_creator_build_0_and_1halo_edge_fields
!
-!> \brief Initializes 0 and 1 halo vertex based fields requried to work out halos
+!> \brief Initializes 0 and 1 halo edge based fields requried to work out halos
!> \author Doug Jacobsen
!> \date 05/31/12
!> \version SVN:$Id$
!> \details
!> This routine uses the previously setup 0 halo cell fields, and the blocks of
-!> data read in by other routhers to determine which vertices are in a blocks
+!> data read in by other routhers to determine which edges are in a blocks
!> 0 and 1 halo for all blocks on a processor.
-!> NOTE: This routine can be used on either vertices or edges
+!> NOTE: This routine can be used on either edges or edges
!
!-----------------------------------------------------------------------
- subroutine mpas_block_creator_build_0_and_1halo_vertex_fields(indexToVertexIDBlock, cellsOnVertexBlock, indexToCellID_0Halo, nEdgesOnCell_0Halo, verticesOnCell_0Halo, indexToVertexID_0Halo, cellsOnVertex_0Halo, nVerticesSolve)!{{{
- type (field1dInteger), pointer :: indexToVertexIDBlock !< Input: indexToVertexID read in field
- type (field2dInteger), pointer :: cellsOnVertexBlock !< Input: cellsOnVertex read in field
+ subroutine mpas_block_creator_build_0_and_1halo_edge_fields(indexToEdgeIDBlock, cellsOnEdgeBlock, indexToCellID_0Halo, nEdgesOnCell_0Halo, edgesOnCell_0Halo, indexToEdgeID_0Halo, cellsOnEdge_0Halo, nEdgesSolve)!{{{
+ type (field1dInteger), pointer :: indexToEdgeIDBlock !< Input: indexToEdgeID read in field
+ type (field2dInteger), pointer :: cellsOnEdgeBlock !< Input: cellsOnEdge read in field
type (field1dInteger), pointer :: indexToCellID_0Halo !< Input: indexToCellID field on 0 halo
type (field1dInteger), pointer :: nEdgesOnCell_0Halo !< Input: nEdgesOnCell field on 0 halo
- type (field2dInteger), pointer :: verticesOnCell_0Halo !< Input: verticesOnCell field on 0 and 1 halos
- type (field1dInteger), pointer :: indexToVertexID_0Halo !< Output: indexToVertexID field on 0 and 1 halos
- type (field2dInteger), pointer :: cellsOnVertex_0Halo !< Output: CellsOnVertex field on 0 and 1 halos
- type (field1dInteger), pointer :: nVerticesSolve !< Output: Array with max index to vertices in halos
+ type (field2dInteger), pointer :: edgesOnCell_0Halo !< Input: edgesOnCell field on 0 and 1 halos
+ type (field1dInteger), pointer :: indexToEdgeID_0Halo !< Output: indexToEdgeID field on 0 and 1 halos
+ type (field2dInteger), pointer :: cellsOnEdge_0Halo !< Output: CellsOnEdge field on 0 and 1 halos
+ type (field1dInteger), pointer :: nEdgesSolve !< Output: Array with max index to edges in halos
- type (field0dInteger), pointer :: offSetField, vertexLimitField
+ type (field0dInteger), pointer :: offSetField, edgeLimitField
type (field1dInteger), pointer :: haloIndices
- type (field0dInteger), pointer :: offSetCursor, vertexLimitCursor
- type (field1dInteger), pointer :: indexToCellCursor, indexToVertexCursor, nEdgesCursor, haloCursor, nVerticesSolveCursor
- type (field2dInteger), pointer :: verticesOnCellCursor, cellsOnVertexCursor, cellsOnCellCursor
+ type (field0dInteger), pointer :: offSetCursor, edgeLimitCursor
+ type (field1dInteger), pointer :: indexToCellCursor, indexToEdgeCursor, nEdgesCursor, haloCursor, nEdgesSolveCursor
+ type (field2dInteger), pointer :: edgesOnCellCursor, cellsOnEdgeCursor, cellsOnCellCursor
type (mpas_exchange_list), pointer :: exchListPtr
- integer, dimension(:), pointer :: localVertexList
+ integer, dimension(:), pointer :: localEdgeList
integer, dimension(:), pointer :: sendingHaloLayers
- integer :: nVerticesLocal, nCellsInBlock, maxEdges, vertexDegree, nHalos
+ integer :: nEdgesLocal, nCellsInBlock, maxEdges, edgeDegree, nHalos
integer :: haloStart
integer :: iBlock, i, j, k
@@ -311,180 +311,180 @@
sendingHaloLayers(1) = 1
! Get dimension information
- maxEdges = verticesOnCell_0Halo % dimSizes(1)
- vertexDegree = cellsOnVertexBlock % dimSizes(1)
+ maxEdges = edgesOnCell_0Halo % dimSizes(1)
+ edgeDegree = cellsOnEdgeBlock % dimSizes(1)
nHalos = config_num_halos
! Setup initial block for each field
if(associated(indexToCellID_0Halo)) then
- allocate(cellsOnVertex_0Halo)
- allocate(indexToVertexID_0Halo)
+ allocate(cellsOnEdge_0Halo)
+ allocate(indexToEdgeID_0Halo)
- nullify(cellsOnVertex_0Halo % next)
- nullify(indexToVertexID_0Halo % next)
+ nullify(cellsOnEdge_0Halo % next)
+ nullify(indexToEdgeID_0Halo % next)
else
- nullify(cellsOnVertex_0Halo)
- nullify(indexToVertexID_0Halo)
+ nullify(cellsOnEdge_0Halo)
+ nullify(indexToEdgeID_0Halo)
end if
! Loop over blocks
indexToCellCursor => indexToCellID_0Halo
- verticesOnCellCursor => verticesOnCell_0Halo
+ edgesOnCellCursor => edgesOnCell_0Halo
nEdgesCursor => nEdgesOnCell_0Halo
- indexToVertexCursor => indexToVertexID_0Halo
- cellsOnVertexCursor => cellsOnVertex_0Halo
+ indexToEdgeCursor => indexToEdgeID_0Halo
+ cellsOnEdgeCursor => cellsOnEdge_0Halo
do while(associated(indexToCellCursor))
! Determine number of cells in block
nCellsInBlock = indexToCellCursor % dimSizes(1)
- ! Determine all vertices in block
- call mpas_block_decomp_all_edges_in_block(maxEdges, nCellsInBlock, nEdgesCursor % array, verticesOnCellCursor % array, nVerticesLocal, localVertexList)
+ ! Determine all edges in block
+ call mpas_block_decomp_all_edges_in_block(maxEdges, nCellsInBlock, nEdgesCursor % array, edgesOnCellCursor % array, nEdgesLocal, localEdgeList)
- ! Setup indexToVertex block
- indexToVertexCursor % block => indexToCellCursor % block
- nullify(indexToVertexCursor % ioinfo)
- indexToVertexCursor % dimSizes(1) = nVerticesLocal
- allocate(indexToVertexCursor % array(indexToVertexCursor % dimSizes(1)))
- indexToVertexCursor % array(:) = localVertexList(:)
+ ! Setup indexToEdge block
+ indexToEdgeCursor % block => indexToCellCursor % block
+ nullify(indexToEdgeCursor % ioinfo)
+ indexToEdgeCursor % dimSizes(1) = nEdgesLocal
+ allocate(indexToEdgeCursor % array(indexToEdgeCursor % dimSizes(1)))
+ indexToEdgeCursor % array(:) = localEdgeList(:)
- ! Setup cellsOnVertex block
- cellsOnVertexCursor % block => indexToCellCursor % block
- nullify(cellsOnVertexCursor % ioinfo)
- cellsOnVertexCursor % dimSizes(1) = vertexDegree
- cellsOnVertexCursor % dimSizes(2) = nVerticesLocal
- allocate(cellsOnVertexCursor % array(cellsOnVertexCursor % dimSizes(1), cellsOnVertexCursor % dimSizes(2)))
+ ! Setup cellsOnEdge block
+ cellsOnEdgeCursor % block => indexToCellCursor % block
+ nullify(cellsOnEdgeCursor % ioinfo)
+ cellsOnEdgeCursor % dimSizes(1) = edgeDegree
+ cellsOnEdgeCursor % dimSizes(2) = nEdgesLocal
+ allocate(cellsOnEdgeCursor % array(cellsOnEdgeCursor % dimSizes(1), cellsOnEdgeCursor % dimSizes(2)))
! Setup exchange lists
- call mpas_dmpar_init_mulithalo_exchange_list(indexToVertexCursor % sendList, nHalos+1)
- call mpas_dmpar_init_mulithalo_exchange_list(indexToVertexCursor % recvList, nHalos+1)
- call mpas_dmpar_init_mulithalo_exchange_list(indexToVertexCursor % copyList, nHalos+1)
+ call mpas_dmpar_init_mulithalo_exchange_list(indexToEdgeCursor % sendList, nHalos+1)
+ call mpas_dmpar_init_mulithalo_exchange_list(indexToEdgeCursor % recvList, nHalos+1)
+ call mpas_dmpar_init_mulithalo_exchange_list(indexToEdgeCursor % copyList, nHalos+1)
! Link exchange lists
- cellsOnVertexCursor % sendList => indexToVertexCursor % sendList
- cellsOnVertexCursor % recvList => indexToVertexCursor % recvList
- cellsOnVertexCursor % copyList => indexToVertexCursor % copyList
+ cellsOnEdgeCursor % sendList => indexToEdgeCursor % sendList
+ cellsOnEdgeCursor % recvList => indexToEdgeCursor % recvList
+ cellsOnEdgeCursor % copyList => indexToEdgeCursor % copyList
- ! Remove localVertexList array
- deallocate(localVertexList)
+ ! Remove localEdgeList array
+ deallocate(localEdgeList)
! Advance cursors, and create new blocks if needed
indexToCellCursor => indexToCellCursor % next
- verticesOnCellCursor => verticesOnCellCursor % next
+ edgesOnCellCursor => edgesOnCellCursor % next
nEdgescursor => nEdgesCursor % next
if(associated(indexToCellCursor)) then
- allocate(indexToVertexCursor % next)
- indexToVertexCursor => indexToVertexCursor % next
+ allocate(indexToEdgeCursor % next)
+ indexToEdgeCursor => indexToEdgeCursor % next
- allocate(cellsOnVertexCursor % next)
- cellsOnVertexCursor => cellsOnVertexCursor % next
+ allocate(cellsOnEdgeCursor % next)
+ cellsOnEdgeCursor => cellsOnEdgeCursor % next
end if
! Nullify next pointers
- nullify(indexToVertexCursor % next)
- nullify(cellsOnVertexCursor % next)
+ nullify(indexToEdgeCursor % next)
+ nullify(cellsOnEdgeCursor % next)
end do ! indexToCursor loop over blocks
! Build exchangel ists from read in blocks to owned blocks.
- call mpas_dmpar_get_exch_list(1, indexToVertexIDBlock, indexToVertexID_0Halo)
+ call mpas_dmpar_get_exch_list(1, indexToEdgeIDBlock, indexToEdgeID_0Halo)
! Perform all to all to get owned block data
- call mpas_dmpar_alltoall_field(cellsOnVertexBlock, cellsOnVertex_0Halo, sendingHaloLayers)
+ call mpas_dmpar_alltoall_field(cellsOnEdgeBlock, cellsOnEdge_0Halo, sendingHaloLayers)
! Setup first block's fields if there is at least 1 block.
- if(associated(indexToVertexID_0Halo)) then
+ if(associated(indexToEdgeID_0Halo)) then
allocate(haloIndices)
allocate(offSetField)
- allocate(vertexLimitField)
- allocate(nVerticesSolve)
+ allocate(edgeLimitField)
+ allocate(nEdgesSolve)
else
nullify(haloIndices)
nullify(offSetField)
- nullify(vertexLimitField)
- nullify(nVerticesSolve)
+ nullify(edgeLimitField)
+ nullify(nEdgesSolve)
end if
! Loop over blocks
- indexToVertexCursor => indexToVertexID_0Halo
- cellsOnVertexCursor => cellsOnVertex_0Halo
+ indexToEdgeCursor => indexToEdgeID_0Halo
+ cellsOnEdgeCursor => cellsOnEdge_0Halo
indexToCellCursor => indexToCellID_0Halo
haloCursor => haloIndices
offSetCursor => offSetField
- vertexLimitCursor => vertexLimitField
- nVerticesSolveCursor => nVerticesSolve
- do while(associated(indexToVertexCursor))
- ! Determine 0 and 1 halo vertices
+ edgeLimitCursor => edgeLimitField
+ nEdgesSolveCursor => nEdgesSolve
+ do while(associated(indexToEdgeCursor))
+ ! Determine 0 and 1 halo edges
call mpas_block_decomp_partitioned_edge_list(indexToCellCursor % dimSizes(1), indexToCellCursor % array, &
- vertexDegree, indexToVertexCursor % dimSizes(1), cellsOnVertexCursor % array, &
- indexToVertexCursor % array, haloStart)
+ edgeDegree, indexToEdgeCursor % dimSizes(1), cellsOnEdgeCursor % array, &
+ indexToEdgeCursor % array, haloStart)
! Link blocks
- haloCursor % block => indexToVertexCursor % block
- offSetCursor % block => indexToVertexCursor % block
- vertexLimitCursor % block => indexToVertexCursor % block
- nVerticesSolveCursor % block => indexToVertexCursor % block
+ haloCursor % block => indexToEdgeCursor % block
+ offSetCursor % block => indexToEdgeCursor % block
+ edgeLimitCursor % block => indexToEdgeCursor % block
+ nEdgesSolveCursor % block => indexToEdgeCursor % block
! Nullify io info
nullify(haloCursor % ioinfo)
nullify(offSetCursor % ioinfo)
- nullify(vertexLimitCursor % ioinfo)
- nullify(nVerticesSolveCursor % ioinfo)
+ nullify(edgeLimitCursor % ioinfo)
+ nullify(nEdgesSolveCursor % ioinfo)
! Setup haloIndices
- haloCursor % dimSizes(1) = indexToVertexCursor % dimSizes(1) - (haloStart-1)
+ haloCursor % dimSizes(1) = indexToEdgeCursor % dimSizes(1) - (haloStart-1)
allocate(haloCursor % array(haloCursor % dimSizes(1)))
- haloCursor % array(:) = indexToVertexCursor % array(haloStart:indexToVertexCursor % dimSizes(1))
+ haloCursor % array(:) = indexToEdgeCursor % array(haloStart:indexToEdgeCursor % dimSizes(1))
! Link exchange lists
- haloCursor % sendList => indexToVertexCursor % sendList
- haloCursor % recvList => indexToVertexCursor % recvList
- haloCursor % copyList => indexToVertexCursor % copyList
+ haloCursor % sendList => indexToEdgeCursor % sendList
+ haloCursor % recvList => indexToEdgeCursor % recvList
+ haloCursor % copyList => indexToEdgeCursor % copyList
- ! Determine offSet and limit on 0 halo vertices for exchange list creation
+ ! Determine offSet and limit on 0 halo edges for exchange list creation
offSetCursor % scalar = haloStart - 1
- vertexLimitCursor % scalar = haloStart - 1
+ edgeLimitCursor % scalar = haloStart - 1
- ! Setup nVerticesSolve
- nVerticesSolveCursor % dimSizes(1) = nHalos+2
- allocate(nVerticesSolveCursor % array(nVerticesSolve % dimSizes(1)))
- nVerticesSolveCursor % array = -1
- nVerticesSolveCursor % array(1) = haloStart - 1
- nVerticesSolveCursor % array(2) = indexToVertexCursor % dimSizes(1)
+ ! Setup nEdgesSolve
+ nEdgesSolveCursor % dimSizes(1) = nHalos+2
+ allocate(nEdgesSolveCursor % array(nEdgesSolve % dimSizes(1)))
+ nEdgesSolveCursor % array = -1
+ nEdgesSolveCursor % array(1) = haloStart - 1
+ nEdgesSolveCursor % array(2) = indexToEdgeCursor % dimSizes(1)
! Advance cursors, and create new blocks if needed
- indexToVertexCursor => indexToVertexCursor % next
- cellsOnVertexCursor => cellsOnVertexCursor % next
+ indexToEdgeCursor => indexToEdgeCursor % next
+ cellsOnEdgeCursor => cellsOnEdgeCursor % next
indexToCellCursor => indexToCellCursor % next
- if(associateD(indexToVertexCursor)) then
+ if(associateD(indexToEdgeCursor)) then
allocate(haloCursor % next)
haloCursor => haloCursor % next
allocate(offSetcursor % next)
offSetCursor => offSetCursor % next
- allocate(vertexLimitCursor % next)
- vertexLimitCursor => vertexLimitCursor % next
+ allocate(edgeLimitCursor % next)
+ edgeLimitCursor => edgeLimitCursor % next
- allocate(nVerticesSolveCursor % next)
- nVerticesSolveCursor => nVerticesSolveCursor % next
+ allocate(nEdgesSolveCursor % next)
+ nEdgesSolveCursor => nEdgesSolveCursor % next
end if
! Nullify next pointers
nullify(haloCursor % next)
nullify(offSetCursor % next)
- nullify(vertexLimitCursor % next)
- nullify(nVerticesSolveCursor % next)
+ nullify(edgeLimitCursor % next)
+ nullify(nEdgesSolveCursor % next)
end do
- ! Create exchange lists from 0 halo to 1 halo vertices
- call mpas_dmpar_get_exch_list(1, indexToVertexID_0Halo, haloIndices, offSetField, vertexLimitField)
+ ! Create exchange lists from 0 halo to 1 haloedges
+ call mpas_dmpar_get_exch_list(1, indexToEdgeID_0Halo, haloIndices, offSetField, edgeLimitField)
! Deallocate fields that are not needed anymore.
call mpas_deallocate_field(haloIndices)
call mpas_deallocate_field(offSetField)
- call mpas_deallocate_field(vertexLimitCursor)
+ call mpas_deallocate_field(edgeLimitCursor)
deallocate(sendingHaloLayers)
- end subroutine mpas_block_creator_build_0_and_1halo_vertex_fields!}}}
+ end subroutine mpas_block_creator_build_0_and_1halo_edge_fields!}}}
!***********************************************************************
!
@@ -765,236 +765,236 @@
!***********************************************************************
!
-! routine mpas_block_creator_build_vertex_halos
+! routine mpas_block_creator_build_edge_halos
!
-!> \brief Builds vertex halos
+!> \brief Builds edge halos
!> \author Doug Jacobsen
!> \date 05/31/12
!> \version SVN:$Id$
!> \details
-!> This routine uses the previously setup 0 and 1 vertex fields and 0 halo cell fields to determine
-!> which vertices fall in each halo layer for a block. During this process, each
+!> This routine uses the previously setup 0 and 1 edge fields and 0 halo cell fields to determine
+!> which edges fall in each halo layer for a block. During this process, each
!> halo's exchange lists are created. This process is performed for all blocks on
!> a processor.
-!> NOTE: This routine can be used on either vertices or edges
+!> NOTE: This routine can be used on either edges or edges
!
!-----------------------------------------------------------------------
- subroutine mpas_block_creator_build_vertex_halos(indexToCellID, nEdgesOnCell, nCellsSolve, verticesOnCell, indexToVertexID, cellsOnVertex, nVerticesSolve)!{{{
+ subroutine mpas_block_creator_build_edge_halos(indexToCellID, nEdgesOnCell, nCellsSolve, edgesOnCell, indexToEdgeID, cellsOnEdge, nEdgesSolve)!{{{
type (field1dInteger), pointer :: indexToCellID !< Input: indexToCellID field for all halos
type (field1dInteger), pointer :: nEdgesOnCell !< Input: nEdgesOnCell field for all halos
type (field1dInteger), pointer :: nCellsSolve !< Input: nCellsSolve field for all halos
- type (field2dInteger), pointer :: verticesOnCell !< Input/Output: verticesOnCell field for all halos
- type (field1dInteger), pointer :: indexToVertexID !< Input/Output: indexToVertexID field for halos 0 and 1, but output for all halos
- type (field2dInteger), pointer :: cellsOnVertex !< Output: cellsOnVertex field for all halos
- type (field1dInteger), pointer :: nVerticesSolve !< Input/Output: nVerticesSolve field for halos 0 and 1, but output for all halos
+ type (field2dInteger), pointer :: edgesOnCell !< Input/Output: edgesOnCell field for all halos
+ type (field1dInteger), pointer :: indexToEdgeID !< Input/Output: indexToEdgeID field for halos 0 and 1, but output for all halos
+ type (field2dInteger), pointer :: cellsOnEdge !< Output: cellsOnEdge field for all halos
+ type (field1dInteger), pointer :: nEdgesSolve !< Input/Output: nEdgesSolve field for halos 0 and 1, but output for all halos
- type (field0dInteger), pointer :: offSetField, vertexLimitField
+ type (field0dInteger), pointer :: offSetField, edgeLimitField
type (field1dInteger), pointer :: haloIndices
- type (field0dInteger), pointer :: offSetCursor, vertexLimitCursor
- type (field1dInteger), pointer :: indexToCellCursor, nEdgesCursor, nCellsSolveCursor, indexToVertexCursor, nVerticesSolveCursor, haloCursor
- type (field2dInteger), pointer :: verticesOnCellCursor, cellsOnVertexCursor
+ type (field0dInteger), pointer :: offSetCursor, edgeLimitCursor
+ type (field1dInteger), pointer :: indexToCellCursor, nEdgesCursor, nCellsSolveCursor, indexToEdgeCursor, nEdgesSolveCursor, haloCursor
+ type (field2dInteger), pointer :: edgesOnCellCursor, cellsOnEdgeCursor
integer, dimension(:), pointer :: sendingHaloLayers
- integer, dimension(:), pointer :: array1dHolder, localVertexList
+ integer, dimension(:), pointer :: array1dHolder, localEdgeList
integer, dimension(:,:), pointer :: array2dHolder
integer :: iHalo, iBlock, i, j, k
- integer :: nHalos, nBlocks, nCellsInBlock, nVerticesLocal, haloStart, haloEnd, haloSize
- integer :: maxEdges, vertexDegree
+ integer :: nHalos, nBlocks, nCellsInBlock, nEdgesLocal, haloStart, haloEnd, haloSize
+ integer :: maxEdges, edgeDegree
- type (hashtable), dimension(:), pointer :: vertexList
+ type (hashtable), dimension(:), pointer :: edgeList
! Determine dimensions
nHalos = config_num_halos
- maxEdges = verticesOnCell % dimSizes(1)
- vertexDegree = cellsOnVertex % dimSizes(1)
+ maxEdges = edgesOnCell % dimSizes(1)
+ edgeDegree = cellsOnEdge % dimSizes(1)
! Allocate some needed arrays and fields
allocate(sendingHaloLayers(1))
- if(associated(indexToVertexID)) then
+ if(associated(indexToEdgeID)) then
allocate(haloIndices)
allocate(offSetField)
- allocate(vertexLimitField)
+ allocate(edgeLimitField)
nullify(haloIndices % next)
nullify(offSetField % next)
- nullify(vertexLimitField % next)
+ nullify(edgeLimitField % next)
else
nullify(haloIndices)
nullify(offSetField)
- nullify(vertexLimitField)
+ nullify(edgeLimitField)
end if
! Determine number of blocks, and setup field lists
! Loop over blocks
nBlocks = 0
- indexToVertexCursor => indexToVertexID
+ indexToEdgeCursor => indexToEdgeID
haloCursor => haloIndices
offSetCursor => offSetField
- vertexLimitCursor => vertexLimitField
- nVerticesSolveCursor => nVerticesSolve
- do while(associated(indexToVertexCursor))
+ edgeLimitCursor => edgeLimitField
+ nEdgesSolveCursor => nEdgesSolve
+ do while(associated(indexToEdgeCursor))
nBlocks = nBlocks + 1
- ! Setup vertexLimit and offSet
- vertexLimitCursor % scalar = nVerticesSolveCursor % array(1)
- offSetCursor % scalar = nVerticesSolveCursor % array(2)
+ ! Setup edgeLimit and offSet
+ edgeLimitCursor % scalar = nEdgesSolveCursor % array(1)
+ offSetCursor % scalar = nEdgesSolveCursor % array(2)
! Link blocks
- vertexLimitCursor % block => indexToVertexCursor % block
- offSetCursor % block => indexToVertexCursor % block
- haloCursor % block => indexToVertexCursor % block
+ edgeLimitCursor % block => indexToEdgeCursor % block
+ offSetCursor % block => indexToEdgeCursor % block
+ haloCursor % block => indexToEdgeCursor % block
! Nullify ioinfo
- nullify(vertexLimitCursor % ioinfo)
+ nullify(edgeLimitCursor % ioinfo)
nullify(offSetCursor % ioinfo)
nullify(haloCursor % ioinfo)
! Link exchange lists
- haloCursor % sendList => indexToVertexCursor % sendList
- haloCursor % recvList => indexToVertexCursor % recvList
- haloCursor % copyList => indexToVertexCursor % copyList
+ haloCursor % sendList => indexToEdgeCursor % sendList
+ haloCursor % recvList => indexToEdgeCursor % recvList
+ haloCursor % copyList => indexToEdgeCursor % copyList
! Advance cursors and create new blocks if needed
- indexToVertexCursor => indexToVertexCursor % next
- nVerticesSolveCursor => nVerticesSolveCursor % next
- if(associated(indexToVertexCursor)) then
+ indexToEdgeCursor => indexToEdgeCursor % next
+ nEdgesSolveCursor => nEdgesSolveCursor % next
+ if(associated(indexToEdgeCursor)) then
allocate(haloCursor % next)
haloCursor => haloCursor % next
allocate(offSetCursor % next)
offSetCursor => offSetCursor % next
- allocate(vertexLimitCursor % next)
- vertexLimitCursor =>vertexLimitCursor % next
+ allocate(edgeLimitCursor % next)
+ edgeLimitCursor =>edgeLimitCursor % next
end if
! Nullify next pointers
nullify(haloCursor % next)
nullify(offSetCursor % next)
- nullify(vertexLimitCursor % next)
+ nullify(edgeLimitCursor % next)
end do
! Allocate and initialize hashtables
- allocate(vertexList(nBlocks))
+ allocate(edgeList(nBlocks))
do iBlock = 1, nBlocks
- call mpas_hash_init(vertexList(iBlock))
+ call mpas_hash_init(edgeList(iBlock))
end do
! Build unique 0 and 1 halo list for each block
- indexToVertexCursor => indexToVertexID
- do while(associated(indexToVertexCursor))
- iBlock = indexToVertexCursor % block % localBlockID + 1
+ indexToEdgeCursor => indexToEdgeID
+ do while(associated(indexToEdgeCursor))
+ iBlock = indexToEdgeCursor % block % localBlockID + 1
- do i = 1, indexToVertexCursor % dimSizes(1)
- if(.not. mpas_hash_search(vertexList(iBlock), indexToVertexCursor % array(i))) then
- call mpas_hash_insert(vertexList(iBlock), indexToVertexCursor % array(i))
+ do i = 1, indexToEdgeCursor % dimSizes(1)
+ if(.not. mpas_hash_search(edgeList(iBlock), indexToEdgeCursor % array(i))) then
+ call mpas_hash_insert(edgeList(iBlock), indexToEdgeCursor % array(i))
end if
end do
- indexToVertexCursor => indexToVertexCursor % next
+ indexToEdgeCursor => indexToEdgeCursor % next
end do
- ! Append new unique vertex id's to indexToVertexID field.
+ ! Append new unique edge id's to indexToEdgeID field.
do iHalo = 3, nHalos+2
sendingHaloLayers(1) = iHalo-1
! Loop over blocks
- indexToVertexCursor => indexToVertexID
+ indexToEdgeCursor => indexToEdgeID
nEdgesCursor => nEdgesOnCell
nCellsSolveCursor => nCellsSolve
- verticesOnCellCursor => verticesOnCell
- nVerticesSolveCursor => nVerticesSolve
+ edgesOnCellCursor => edgesOnCell
+ nEdgesSolveCursor => nEdgesSolve
haloCursor => haloIndices
offSetCursor => offSetField
- do while(associated(indexToVertexCursor))
- iBlock = indexToVertexCursor % block % localBlockID+1
+ do while(associated(indexToEdgeCursor))
+ iBlock = indexToEdgeCursor % block % localBlockID+1
nCellsInBlock = nCellsSolveCursor % array(iHalo-1)
- offSetCursor % scalar = nVerticesSolveCursor % array(iHalo-1)
+ offSetCursor % scalar = nEdgesSolveCursor % array(iHalo-1)
- ! Determine all vertices in block
- call mpas_block_decomp_all_edges_in_block(maxEdges, nCellsInBlock, nEdgesCursor % array, verticesOnCellCursor % array, nVerticesLocal, localVertexList)
+ ! Determine all edges in block
+ call mpas_block_decomp_all_edges_in_block(maxEdges, nCellsInBlock, nEdgesCursor % array, edgesOnCellCursor % array, nEdgesLocal, localEdgeList)
- nVerticesSolveCursor % array(iHalo) = nVerticesLocal
- haloSize = nVerticesLocal - nVerticesSolveCursor % array(iHalo-1)
+ nEdgesSolveCursor % array(iHalo) = nEdgesLocal
+ haloSize = nEdgesLocal - nEdgesSolveCursor % array(iHalo-1)
haloCursor % dimSizes(1) = haloSize
allocate(haloCursor % array(haloCursor % dimSizes(1)))
- ! Add all vertices into block, and figure out which are new vertices meaning they belong to the new halo layer
+ ! Add all edges into block, and figure out which are new edges meaning they belong to the new halo layer
j = 1
- do i = 1, nVerticesLocal
- if(.not. mpas_hash_search(vertexList(iBlock), localVertexList(i))) then
- call mpas_hash_insert(vertexList(iBlock), localVertexList(i))
- haloCursor % array(j) = localVertexList(i)
+ do i = 1, nEdgesLocal
+ if(.not. mpas_hash_search(edgeList(iBlock), localEdgeList(i))) then
+ call mpas_hash_insert(edgeList(iBlock), localEdgeList(i))
+ haloCursor % array(j) = localEdgeList(i)
j = j + 1
end if
end do
- deallocate(localVertexList)
+ deallocate(localEdgeList)
! Advance Cursors
- indexToVertexCursor => indexToVertexCursor % next
+ indexToEdgeCursor => indexToEdgeCursor % next
nEdgesCursor => nEdgesCursor % next
nCellsSolveCursor => nCellsSolveCursor % next
- verticesOnCellCursor => verticesOnCellCursor % next
- nVerticesSolveCursor => nVerticesSolveCursor % next
+ edgesOnCellCursor => edgesOnCellCursor % next
+ nEdgesSolveCursor => nEdgesSolveCursor % next
haloCursor => haloCursor % next
offSetCursor => offSetCursor % next
end do
! Build current layers exchange list
- call mpas_dmpar_get_exch_list(iHalo-1, indexToVertexID, haloIndices, offSetField, vertexLimitField)
+ call mpas_dmpar_get_exch_list(iHalo-1, indexToEdgeID, haloIndices, offSetField, edgeLimitField)
! Loop over blocks
- indexToVertexCursor => indexToVertexID
- cellsOnVertexCursor => cellsOnVertex
- nVerticesSolveCursor => nVerticesSolve
+ indexToEdgeCursor => indexToEdgeID
+ cellsOnEdgeCursor => cellsOnEdge
+ nEdgesSolveCursor => nEdgesSolve
haloCursor => haloIndices
- do while(associated(indexToVertexCursor))
+ do while(associated(indexToEdgeCursor))
! Copy in new halo indices
- array1dHolder => indexToVertexCursor % array
- indexToVertexCursor % dimSizes(1) = nVerticesSolveCursor % array(iHalo)
- allocate(indexToVertexCursor % array(indexToVertexCursor % dimSizes(1)))
- indexToVertexCursor % array(1:nVerticesSolveCursor % array(iHalo-1)) = array1dHolder(:)
- indexToVertexCursor % array(nVerticesSolveCursor % array(iHalo-1)+1:nVerticesSolveCursor % array(iHalo)) = haloCursor % array(:)
+ array1dHolder => indexToEdgeCursor % array
+ indexToEdgeCursor % dimSizes(1) = nEdgesSolveCursor % array(iHalo)
+ allocate(indexToEdgeCursor % array(indexToEdgeCursor % dimSizes(1)))
+ indexToEdgeCursor % array(1:nEdgesSolveCursor % array(iHalo-1)) = array1dHolder(:)
+ indexToEdgeCursor % array(nEdgesSolveCursor % array(iHalo-1)+1:nEdgesSolveCursor % array(iHalo)) = haloCursor % array(:)
deallocate(array1dHolder)
- ! Allocate space in cellsOnVertex
- array2dHolder => cellsOnVertexCursor % array
- cellsOnVertexCursor % dimSizes(2) = nVerticesSolveCursor % array(iHalo)
- allocate(cellsOnVertexCursor % array(cellsOnVertexCursor % dimSizes(1), cellsOnVertexCursor % dimSizes(2)))
- cellsOnVertexCursor % array(:,1:nVerticesSolveCursor % array(iHalo-1)) = array2dHolder(:,:)
+ ! Allocate space in cellsOnEdge
+ array2dHolder => cellsOnEdgeCursor % array
+ cellsOnEdgeCursor % dimSizes(2) = nEdgesSolveCursor % array(iHalo)
+ allocate(cellsOnEdgeCursor % array(cellsOnEdgeCursor % dimSizes(1), cellsOnEdgeCursor % dimSizes(2)))
+ cellsOnEdgeCursor % array(:,1:nEdgesSolveCursor % array(iHalo-1)) = array2dHolder(:,:)
deallocate(array2dHolder)
! Deallocate haloCursor array
deallocate(haloCursor % array)
! Advance cursors
- indexToVertexCursor => indexToVertexCursor % next
- cellsOnVertexCursor => cellsOnVertexCursor % next
- nVerticesSolveCursor => nVerticesSolveCursor % next
+ indexToEdgeCursor => indexToEdgeCursor % next
+ cellsOnEdgeCursor => cellsOnEdgeCursor % next
+ nEdgesSolveCursor => nEdgesSolveCursor % next
haloCursor => haloCursor % next
end do
! Performe allToAll communication
- call mpas_dmpar_alltoall_field(cellsOnVertex, cellsOnVertex, sendingHaloLayers)
+ call mpas_dmpar_alltoall_field(cellsOnEdge, cellsOnEdge, sendingHaloLayers)
end do
! Deallocate fields, hashtables, and arrays
call mpas_deallocate_field(haloIndices)
- call mpas_deallocate_field(vertexLimitField)
+ call mpas_deallocate_field(edgeLimitField)
call mpas_deallocate_field(offSetField)
do iBlock=1,nBlocks
- call mpas_hash_destroy(vertexList(iBlock))
+ call mpas_hash_destroy(edgeList(iBlock))
end do
- deallocate(vertexList)
+ deallocate(edgeList)
deallocate(sendingHaloLayers)
- end subroutine mpas_block_creator_build_vertex_halos!}}}
+ end subroutine mpas_block_creator_build_edge_halos!}}}
!***********************************************************************
!
Modified: branches/omp_blocks/multiple_blocks/src/framework/mpas_io_input.F
===================================================================
--- branches/omp_blocks/multiple_blocks/src/framework/mpas_io_input.F        2012-06-07 15:30:13 UTC (rev 1971)
+++ branches/omp_blocks/multiple_blocks/src/framework/mpas_io_input.F        2012-06-07 16:09:43 UTC (rev 1972)
@@ -202,15 +202,14 @@
call mpas_block_creator_setup_blocks_and_0halo_cells(domain, indexToCellID_Block, local_cell_list, block_id, block_start, block_count)
call mpas_block_creator_build_0halo_cell_fields(indexToCellIDField, nEdgesOnCellField, cellsOnCellField, verticesOnCellField, edgesOnCellField, indexToCellID_Block, nEdgesOnCell_Block, cellsOnCell_Block, verticesOnCell_Block, edgesOnCell_Block)
- call mpas_block_creator_build_0_and_1halo_vertex_fields(indexToVertexIDField, cellsOnVertexField, indexToCellID_Block, nEdgesOnCell_Block, verticesOnCell_Block, indexToVertexID_Block, cellsOnVertex_Block, nVerticesSolveField)
+ call mpas_block_creator_build_0_and_1halo_edge_fields(indexToEdgeIDField, cellsOnEdgeField, indexToCellID_Block, nEdgesOnCell_Block, edgesOnCell_Block, indexToEdgeID_Block, cellsOnEdge_Block, nEdgesSolveField)
+ call mpas_block_creator_build_0_and_1halo_edge_fields(indexToVertexIDField, cellsOnVertexField, indexToCellID_Block, nEdgesOnCell_Block, verticesOnCell_Block, indexToVertexID_Block, cellsOnVertex_Block, nVerticesSolveField)
- call mpas_block_creator_build_0_and_1halo_vertex_fields(indexToEdgeIDField, cellsOnEdgeField, indexToCellID_Block, nEdgesOnCell_Block, edgesOnCell_Block, indexToEdgeID_Block, cellsOnEdge_Block, nEdgesSolveField)
-
call mpas_block_creator_build_cell_halos(indexToCellID_Block, nEdgesOnCell_Block, cellsOnCell_Block, verticesOnCell_Block, edgesOnCell_Block, nCellsSolveField)
- call mpas_block_creator_build_vertex_halos(indexToCellID_Block, nEdgesOnCell_Block, nCellsSolveField, verticesOnCell_Block, indexToVertexID_Block, cellsOnVertex_Block, nVerticesSolveField)
+ call mpas_block_creator_build_edge_halos(indexToCellID_Block, nEdgesOnCell_Block, nCellsSolveField, edgesOnCell_Block, indexToEdgeID_Block, cellsOnEdge_Block, nEdgesSolveField)
+ call mpas_block_creator_build_edge_halos(indexToCellID_Block, nEdgesOnCell_Block, nCellsSolveField, verticesOnCell_Block, indexToVertexID_Block, cellsOnVertex_Block, nVerticesSolveField)
- call mpas_block_creator_build_vertex_halos(indexToCellID_Block, nEdgesOnCell_Block, nCellsSolveField, edgesOnCell_Block, indexToEdgeID_Block, cellsOnEdge_Block, nEdgesSolveField)
! Allocate blocks, and copy indexTo arrays into blocks
call mpas_block_creator_finalize_block_init(domain % blocklist, &
</font>
</pre>