From d0c3e770aebcb66541603ad3dee87c661f485667 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Thu, 31 Oct 2024 14:40:25 -0500 Subject: [PATCH] Fix segfault in hydro init due to using cellMask before accessing it --- .../src/mode_forward/mpas_li_subglacial_hydro.F | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/components/mpas-albany-landice/src/mode_forward/mpas_li_subglacial_hydro.F b/components/mpas-albany-landice/src/mode_forward/mpas_li_subglacial_hydro.F index 06fb2239107d..bf9616b4339b 100644 --- a/components/mpas-albany-landice/src/mode_forward/mpas_li_subglacial_hydro.F +++ b/components/mpas-albany-landice/src/mode_forward/mpas_li_subglacial_hydro.F @@ -205,6 +205,8 @@ subroutine li_SGH_init(domain, err) call mpas_pool_get_array(hydroPool, 'waterPressure', waterPressure) call mpas_pool_get_array(hydroPool, 'hydropotential', hydropotential) call mpas_pool_get_array(hydroPool, 'iceThicknessHydro', iceThicknessHydro) + call mpas_pool_get_array(geometryPool, 'cellMask', cellMask) + call mpas_pool_get_array(geometryPool, 'bedTopography', bedTopography) waterPressure = max(0.0_RKIND, waterPressure) where (li_mask_is_grounded_ice(cellMask)) @@ -212,10 +214,6 @@ subroutine li_SGH_init(domain, err) end where ! set pressure and hydropotential correctly on ice-free land and in ocean - call mpas_pool_get_array(geometryPool, 'cellMask', cellMask) - call mpas_pool_get_array(geometryPool, 'bedTopography', bedTopography) - ! - where ((.not. (li_mask_is_grounded_ice(cellMask))) .and. (bedTopography > config_sea_level)) waterPressure = 0.0_RKIND hydropotential = rho_water * gravity * bedTopography