Skip to content

Commit c655d4f

Browse files
committed
Fix dCalvingThickness dimension in remove_small_islands
Fix dCalvingThickness dimension in remove_small_islands. Must be nCells rather than nCellsSolve in size.
1 parent 18c67b1 commit c655d4f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

components/mpas-albany-landice/src/mode_forward/mpas_li_calving.F

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)