Domain-index lookup-table initialisations in non-MPI configurations
Context
A PSyclone developer has reported that the GYRE_PISCES
reference configuration of NEMO version 4.2 compiled for execution without MPI (pre-processing key key_mpi_off
defined) segfaults.
Analysis
The reporter has tracked down the segfault to an access of the unallocated array mig0
in subroutine usr_def_hgr
of module usrdef_hgr
.
Fix
The reporter has kindly suggested the inclusion of CALL init_locglo
in the non-MPI pre-processed variant of src/OCE/LBC/mppini.F90
to ensure array mig0
is allocated before being accessed in non-MPI configurations. Indeed, with the source-code modification
--- a/src/OCE/LBC/mppini.F90
+++ b/src/OCE/LBC/mppini.F90
@@ -86,6 +86,7 @@ CONTAINS
l_IdoNFold = l_NFold ! is this process doing North fold?
!
CALL init_doloop ! set start/end indices or do-loop depending on the halo width value (nn_hls)
+ CALL init_locglo
!
IF(lwp) THEN
WRITE(numout,*)
the non-MPI GYRE_PISCES
configuration of NEMO version 4.2 is viable and successfully passes the standard SETTE restartability and reproducibility tests.