From c8dc42ea1484300d3b3a1fa498129b96b93ee382 Mon Sep 17 00:00:00 2001 From: Henri Drake Date: Mon, 19 Aug 2024 12:58:03 -0700 Subject: [PATCH] Check if `seaice_melt` is associated before the checksum --- config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90 b/config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90 index cfcddd6fb8..ec3dcfa475 100644 --- a/config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90 +++ b/config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90 @@ -1796,8 +1796,9 @@ subroutine ice_ocn_bnd_type_chksum(id, timestep, iobt) chks = field_chksum( iobt%sw_flux_nir_dif) ; if (root) write(outunit,100) 'iobt%sw_flux_nir_dif', chks chks = field_chksum( iobt%lprec ) ; if (root) write(outunit,100) 'iobt%lprec ', chks chks = field_chksum( iobt%fprec ) ; if (root) write(outunit,100) 'iobt%fprec ', chks -! hfd/Gives error: "Program received signal SIGSEGV: Segmentation fault - invalid memory reference." - chks = field_chksum( iobt%seaice_melt ) ; if (root) write(outunit,100) 'iobt%seaice_melt ', chks + if (associated(iobt%seaice_melt)) then + chks = field_chksum( iobt%seaice_melt ) ; if (root) write(outunit,100) 'iobt%seaice_melt ', chks + endif chks = field_chksum( iobt%runoff ) ; if (root) write(outunit,100) 'iobt%runoff ', chks chks = field_chksum( iobt%calving ) ; if (root) write(outunit,100) 'iobt%calving ', chks chks = field_chksum( iobt%p ) ; if (root) write(outunit,100) 'iobt%p ', chks