@@ -625,6 +625,7 @@ subroutine li_restore_calving_front(domain, err)
625625
626626 ! Now check for marine regions that have advanced
627627 allocate(dCalvingThickness(nCells+1))
628+ dCalvingThickness(:) = 0.0_RKIND
628629
629630 ! loop over locally owned cells
630631 do iCell = 1, nCells
@@ -1084,7 +1085,7 @@ subroutine remove_small_islands(meshPool, geometryPool)
10841085 floatingMaskForMassBudget
10851086 integer, dimension(:,:), pointer :: cellsOnCell ! list of cells that neighbor each cell
10861087 integer, dimension(:), pointer :: nEdgesOnCell ! number of cells that border each cell
1087- integer, pointer :: nCellsSolve
1088+ integer, pointer :: nCellsSolve, nCells
10881089 integer :: iCell, jCell, n, nIceNeighbors, nIceNeighbors2, neighborWithIce
10891090 integer :: nOpenOceanNeighbors, nOpenOceanNeighbors2
10901091
@@ -1095,6 +1096,7 @@ subroutine remove_small_islands(meshPool, geometryPool)
10951096
10961097 call mpas_pool_get_config(liConfigs, ' config_sea_level' , config_sea_level)
10971098 call mpas_pool_get_dimension(meshPool, ' nCellsSolve' , nCellsSolve)
1099+ call mpas_pool_get_dimension(meshPool, ' nCells' , nCells)
10981100 call mpas_pool_get_array(meshPool, ' cellsOnCell' , cellsOnCell)
10991101 call mpas_pool_get_array(meshPool, ' nEdgesOnCell' , nEdgesOnCell)
11001102 call mpas_pool_get_array(geometryPool, ' calvingThickness' , calvingThickness)
@@ -1107,7 +1109,7 @@ subroutine remove_small_islands(meshPool, geometryPool)
11071109 call mpas_pool_get_array(geometryPool, ' cellMask' , cellMask)
11081110 call mpas_pool_get_array(geometryPool, ' bedTopography' , bedTopography)
11091111
1110- allocate(dCalvingThickness(nCellsSolve +1))
1112+ allocate(dCalvingThickness(nCells +1))
11111113 dCalvingThickness(:) = 0.0_RKIND
11121114
11131115 do iCell = 1, nCellsSolve
0 commit comments