Skip to content

Commit

Permalink
Merge branch 'framework/correctly_remove_blk_fields' into develop
Browse files Browse the repository at this point in the history
This merge fixes three lines of code in the mpas_block_creator module that were
intended to remove several temporary fields from the 'allFields' pool, but
which were not actually working.

The 'indexTo{Cell,Edge,Vertex}ID_blk' fields that are added to the allFields
pool in mpas_block_creator_finalize_block_phase1( ) were intended to be removed
from the pool in mpas_block_creator_finalize_block_phase2( ). However, due to
a capitalization issue (pools are case-sensitive), these *_blk fields were
not removed even though they are deallocated. This can cause problems for other
code that needs to iterate all fields in the allFields pool.

* framework/correctly_remove_blk_fields:
  Correctly remove 'indexTo{Cell,Edge,Vertex}ID_blk' fields from allFields pool
  • Loading branch information
mgduda committed Aug 7, 2017
2 parents 3565965 + 9a93371 commit 5903748
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/framework/mpas_block_creator.F
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@ subroutine mpas_block_creator_finalize_block_phase1(nHalos, blocklist, nCellsSol
nVerticesCursor => nVerticesCursor % next
indexToCellCursor => indexToCellCursor % next
indexToEdgeCursor => indexToEdgeCursor % next
indexToVertexCursor => indextoVertexcursor % next
indexToVertexCursor => indexToVertexcursor % next
end do
end subroutine mpas_block_creator_finalize_block_phase1!}}}
Expand Down Expand Up @@ -1294,7 +1294,7 @@ subroutine mpas_block_creator_finalize_block_phase2(stream_manager, blocklist, r
indexField % array(:) = indexFieldBlk % array(:)
call mpas_pool_remove_field(block_ptr % allFields, 'indextoCellID_blk')
call mpas_pool_remove_field(block_ptr % allFields, 'indexToCellID_blk')
call mpas_deallocate_field(indexFieldBlk)
call mpas_pool_get_field(block_ptr % allFields, 'indexToEdgeID', indexField)
Expand All @@ -1321,7 +1321,7 @@ subroutine mpas_block_creator_finalize_block_phase2(stream_manager, blocklist, r
indexField % array(:) = indexFieldBlk % array(:)
call mpas_pool_remove_field(block_ptr % allFields, 'indextoEdgeID_blk')
call mpas_pool_remove_field(block_ptr % allFields, 'indexToEdgeID_blk')
call mpas_deallocate_field(indexFieldBlk)
call mpas_pool_get_field(block_ptr % allFields, 'indexToVertexID', indexField)
Expand All @@ -1348,7 +1348,7 @@ subroutine mpas_block_creator_finalize_block_phase2(stream_manager, blocklist, r
indexField % array(:) = indexFieldBlk % array(:)
call mpas_pool_remove_field(block_ptr % allFields, 'indextoVertexID_blk')
call mpas_pool_remove_field(block_ptr % allFields, 'indexToVertexID_blk')
call mpas_deallocate_field(indexFieldBlk)
call mpas_pool_set_error_level(err_level)
Expand Down

0 comments on commit 5903748

Please sign in to comment.