Skip to content

Commit 1e68ff5

Browse files
Fix EXF binary latitude orientation (north-to-south → south-to-north)
ERA5 NetCDF stores latitude decreasing (60→20 N, j=0=60N), but MITgcm data.exf expects the binary to be south-to-north (lat0=20.0, lat_inc=0.25, j=0=20N). Without the flip, MITgcm interpolates model lat=26N by reading binary row j≈24 which holds ERA5 lat=54N data (cold North Atlantic air), creating a ~20°C air-sea temperature difference that drives hflux values well above the EXF range-check threshold and causes the run to abort at it=0. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 6d08d60 commit 1e68ff5

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

spectre_utils/mk_exf_conditions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ def _open_var(working_directory, prefix, mitgcm_name, years, t1, t2):
2626
data_vars = list(ds.data_vars)
2727
if len(data_vars) == 1 and data_vars[0] != mitgcm_name:
2828
ds = ds.rename({data_vars[0]: mitgcm_name})
29+
# ERA5 latitude is stored north-to-south (60→20 N). Flip to south-to-north
30+
# so the binary layout matches data.exf: lat0=20.0, lat_inc=+0.25 (j=0=20N).
31+
ds = ds.isel(latitude=slice(None, None, -1))
2932
return ds
3033

3134

0 commit comments

Comments
 (0)