Skip to content

Single-precision-safe OIFS/OASIS coupling + XIOS output - #1029

Merged
JanStreffing merged 9 commits into
mainfrom
feat/single-precision-coupled
Aug 31, 2026
Merged

Single-precision-safe OIFS/OASIS coupling + XIOS output#1029
JanStreffing merged 9 commits into
mainfrom
feat/single-precision-coupled

Conversation

@JanStreffing

Copy link
Copy Markdown
Collaborator

Makes USE_SINGLE_PRECISION (WP=real32) work in coupled OIFS-via-OASIS builds.

cpl_driver.F90

  • OASIS exchange buffer exfld typed WP_full (always double), matching the oasis_Double transient and mirroring OpenIFS' dedicated double coupling kind JPRO.
  • Every FESOM-internal coupling MPI call (grid gather, same-rank bcast) uses MPI_WP instead of hardcoded MPI_DOUBLE_PRECISION, so the MPI type tracks WP.

gen_forcing_couple.F90

  • integrate_2D reductions use MPI_WP. The raw FESOM<->atmosphere net-flux exchange in net_rec_from_atm is left double (skipped for __oifs) with an explanatory note.

io_tracks.F90 / io_xios.F90

  • XIOS domain/axis coordinate and geometry paths made double (real(kind=8) / matching mod_tracks_geometry TG_WP), so SP + XIOS compiles.

CMakeLists.txt

  • SP guard relaxed to allow the OIFS-via-OASIS combination; other coupled modes (ECHAM/OASIS, YAC, IFS-interface) stay guarded until converted.

OASIS accepts single-precision buffers (its put/get and grid-write interfaces are generic over real4/real8 and promote to double internally), so nothing is corrupted when WP=real32; the genuine breakage was FESOM's own hardcoded double MPI calls on real(kind=WP) buffers.

Draft: builds and initializes coupled; runtime coupled validation on albedo (AWI-ESM3 TCO95/CORE3, single precision) in progress.

JanStreffing and others added 7 commits August 29, 2026 00:26
Type the OASIS exchange buffer exfld as WP_full (always double) and route every
FESOM-internal coupling MPI call through MPI_WP so USE_SINGLE_PRECISION (WP=real32)
coupled builds no longer pass MPI_DOUBLE_PRECISION for real(kind=WP) buffers. Make
the XIOS tracks/grid coordinate paths double (io_tracks/io_xios). Relax the CMake
guard to allow SP for the OIFS-via-OASIS combination.
@JanStreffing JanStreffing added this to the FESOM 2.8 milestone Aug 30, 2026
@JanStreffing
JanStreffing requested a review from suvarchal August 30, 2026 21:50
@JanStreffing
JanStreffing marked this pull request as ready for review August 30, 2026 21:51
@JanStreffing

Copy link
Copy Markdown
Collaborator Author

I did some test runs. It works in AWI-ESM3. Yet to test speedup.

@JanStreffing

JanStreffing commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator Author

I did a short test with core3 coupled to tco95.

Cores nodes/core regime FESOM SP speedup
256 861 compute-bound-ish 1.32×
PR#940: 64 (CORE2) ~1980 fully compute-bound 1.69×
GET-wait (steady) SP @256 DP @256
OpenIFS waits on FESOM 51.0 s 129.4 s
FESOM waits on OpenIFS 14.6 s 8.7 s

Works. Not optimized at all. But i see substantial speedup in this short test already.

Comment thread src/io_tracks.F90
kind=8 is not portable (NEC compilers number real kinds 1,2,3). Switch the
double-precision geometry declarations and the two xios_duration literals to
the WP_full parameter (=real64), which is defined portably in o_param.
Addresses review feedback on PR #1029.
@JanStreffing
JanStreffing merged commit 6ab76d3 into main Aug 31, 2026
21 checks passed
@JanStreffing
JanStreffing deleted the feat/single-precision-coupled branch August 31, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants