[v4.2.x][ifort] *zpshde.f90*: internal compiler error

Dear users,

I’m trying to compile the default configuration of the latest version of NEMO 4.2.0 and got the error message catastrophic error: **Internal compiler error: internal abort**.
I’m using Intel fortran version 17.0.2 to compile and the trunk version of xios has been installed successfully with the same fortran.
According to various websites this is a compiler issue and I thought this error has been taken care of by Intel, but I don’t know if I need a new version of Intel fortran to fix the error or any way to fix it without installing a new version.
I’d appreciate any suggestions to get rid of this error.

Log that shows the error:

touch /data3/ueyoshi/nemo_4.2.0_git2/nemo_4.2.0/cfgs/ORCA2_ICE_PISCES/BLD/flags/FFLAGS__nemo__par_kind.flags
fcm_internal compile:F nemo /data3/ueyoshi/nemo_4.2.0_git2/nemo_4.2.0/cfgs/ORCA2_ICE_PISCES/BLD/ppsrc/nemo/par_kind.f90 par_kind.o
 /opt/intel/compilers_and_libraries_2017.2.174/linux/mpi/intel64/bin/mpiifort -c -cpp -o par_kind.o -I/data3/ueyoshi/nemo_4.2.0_git2/nemo_4.2.0/cfgs/ORCA2_ICE_PISCES/BLD/inc -i4 -r8 -O3 -fp-model precise -fno-alias -I/data1/ueyoshi/local/xios-trunk8/inc -I/data1/ueyoshi/local/HDF5-NETCDF_C_F/include -I/opt/intel/compilers_and_libraries_2017.2.174/linux/mpi/intel64/include -c/data3/ueyoshi/nemo_4.2.0_git2/nemo_4.2.0/cfgs/ORCA2_ICE_PISCES/BLD/ppsrc/nemo/par_kind.f90
touch /data3/ueyoshi/nemo_4.2.0_git2/nemo_4.2.0/cfgs/ORCA2_ICE_PISCES/BLD/flags/FFLAGS__nemo__asminc.flags
touch /data3/ueyoshi/nemo_4.2.0_git2/nemo_4.2.0/cfgs/ORCA2_ICE_PISCES/BLD/flags/FFLAGS__nemo__zpshde.flags
fcm_internal compile:F nemo /data3/ueyoshi/nemo_4.2.0_git2/nemo_4.2.0/cfgs/ORCA2_ICE_PISCES/BLD/ppsrc/nemo/zpshde.f90 zpshde.o
/opt/intel/compilers_and_libraries_2017.2.174/linux/mpi/intel64/bin/mpiifort -c -cpp -o zpshde.o -I/data3/ueyoshi/nemo_4.2.0_git2/nemo_4.2.0/cfgs/ORCA2_ICE_PISCES/BLD/inc -i4 -r8 -O3 -fp-model precise -fno-alias -I/data1/ueyoshi/local/xios-trunk8/inc -I/data1/ueyoshi/local/HDF5-NETCDF_C_F/include -I/opt/intel/compilers_and_libraries_2017.2.174/linux/mpi/intel64/include -c/data3/ueyoshi/nemo_4.2.0_git2/nemo_4.2.0/cfgs/ORCA2_ICE_PISCES/BLD/ppsrc/nemo/zpshde.f90
/data3/ueyoshi/nemo_4.2.0_git2/nemo_4.2.0/cfgs/ORCA2_ICE_PISCES/BLD/ppsrc/nemo/zpshde.f90(200): catastrophic error: **Internal compiler error: internal abort** Please report this error along with the circumstances in which it occurred in a Software Problem Report.  Note: File and line given may not be explicit cause of this error.
compilation aborted for /data3/ueyoshi/nemo_4.2.0_git2/nemo_4.2.0/cfgs/ORCA2_ICE_PISCES/BLD/ppsrc/nemo/zpshde.f90 (code 1)
fcm_internal compile failed (256)
gmake: *** [zpshde.o] Error 1
gmake -f /data3/ueyoshi/nemo_4.2.0_git2/nemo_4.2.0/cfgs/ORCA2_ICE_PISCES/BLD/Makefile -j 1 all failed (2) at /data3/ueyoshi/nemo_4.2.0_git2/nemo_4.2.0/ext/FCM/bin/../lib/Fcm/Build.pm line 597.
Build failed on Wed Apr  6 16:25:31 2022.

Interestingly, I faced a weird compilation problem for the same routine with ifort version 17.0.3
In case this helps, I got rid of it by removing the explicit definition of array shapes in lbc_lnk calls, e.g.:

CALL lbc_lnk( 'zpshde', pgtu(:,:,:), 'U', -1.0_wp ,...


CALL lbc_lnk( 'zpshde', pgtu, 'U', -1.0_wp ,...

I admit, I didn’t really understand what was going on…

This has been pushed in the main here:

I would be curious to know what was your issue and how you solved it.

Had the same catastrophic error as ukocean with an Intel compiler. @jchanut edits solved the problem for me.