Flagged by Claude once again, and seems sensible - the Intel builds have the -convert big_endian flag but the GNU builds do not - the corresponding GNU flag -fconvert=big-endian (docs in GCC 15.3) needs to be applied.
Patch from Claude (to be applied on top of the -O2 patch):
From cd7d35f9f670522e3456de840ed98792a62a9327 Mon Sep 17 00:00:00 2001
From: Claude <c@a.co>
Date: Fri, 7 Aug 2026 13:37:28 +0000
Subject: [PATCH 2/3] Read big-endian unformatted files in GNU builds
The Intel branch passes -convert big_endian; the GNU branch passes no
equivalent, so gfortran reads unformatted sequential files in native
little-endian order. CICE's binary grid, kmt and forcing files are
big-endian, so a gfortran build cannot read them.
With grid_format = 'bin' on gx3 the effect is not a clean error but
garbage: read_global reports values around 1e308 and 4.2e8 for a land mask,
and the run then dies with SIGFPE inside init_domain_distribution (the
-ffpe-trap above turns the resulting bad arithmetic into a crash). It looks
like a decomposition bug and is actually a byte-order bug.
-fconvert=big-endian is the file-level analogue of Intel's -convert
big_endian and applies to all unformatted units. Builds that only ever read
netCDF inputs are unaffected.
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 82b7612..e62795f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -126,7 +126,7 @@ else ()
endif ()
if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
- set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -Wall -fdefault-real-8 -fdefault-double-8 -ffpe-trap=invalid,zero,overflow -fallow-argument-mismatch")
+ set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -Wall -fdefault-real-8 -fdefault-double-8 -ffpe-trap=invalid,zero,overflow -fallow-argument-mismatch -fconvert=big-endian")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
set(CMAKE_Fortran_FLAGS_RELEASE "${NCI_INTEL_FLAGS} ${NCI_REPRO_FLAGS} ${NCI_OPTIM_FLAGS}")
set(CMAKE_Fortran_FLAGS_DEBUG "${NCI_INTEL_FLAGS} ${NCI_REPRO_FLAGS} ${NCI_DEBUG_FLAGS}")
--
2.43.0
Flagged by Claude once again, and seems sensible - the Intel builds have the
-convert big_endianflag but the GNU builds do not - the corresponding GNU flag-fconvert=big-endian(docs in GCC 15.3) needs to be applied.Patch from Claude (to be applied on top of the
-O2patch):