Skip to content

Commit 114c373

Browse files
Merge branch 'matthewhoffman/mali/fix-hydro-init-segfault' into MALI-Dev/develop
This PR fixes a seg fault occurring when cellMask was used before it was retrieved from its pool. * matthewhoffman/mali/fix-hydro-init-segfault: Fix segfault in hydro init due to using cellMask before accessing it
2 parents 07e3abf + d0c3e77 commit 114c373

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,17 +205,15 @@ subroutine li_SGH_init(domain, err)
205205
call mpas_pool_get_array(hydroPool, 'waterPressure', waterPressure)
206206
call mpas_pool_get_array(hydroPool, 'hydropotential', hydropotential)
207207
call mpas_pool_get_array(hydroPool, 'iceThicknessHydro', iceThicknessHydro)
208+
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
209+
call mpas_pool_get_array(geometryPool, 'bedTopography', bedTopography)
208210
209211
waterPressure = max(0.0_RKIND, waterPressure)
210212
where (li_mask_is_grounded_ice(cellMask))
211213
waterPressure = min(waterPressure, rhoi * gravity * iceThicknessHydro)
212214
end where
213215
214216
! set pressure and hydropotential correctly on ice-free land and in ocean
215-
call mpas_pool_get_array(geometryPool, 'cellMask', cellMask)
216-
call mpas_pool_get_array(geometryPool, 'bedTopography', bedTopography)
217-
!
218-
219217
where ((.not. (li_mask_is_grounded_ice(cellMask))) .and. (bedTopography > config_sea_level))
220218
waterPressure = 0.0_RKIND
221219
hydropotential = rho_water * gravity * bedTopography

0 commit comments

Comments
 (0)