Skip to content

FMS API: Convert real kind of constants#768

Merged
Hallberg-NOAA merged 1 commit intoNOAA-GFDL:dev/gfdlfrom
marshallward:fms_constant_kind
Dec 9, 2024
Merged

FMS API: Convert real kind of constants#768
Hallberg-NOAA merged 1 commit intoNOAA-GFDL:dev/gfdlfrom
marshallward:fms_constant_kind

Conversation

@marshallward
Copy link
Copy Markdown
Member

Two latent heat constants are imported directly from FMS, which is built independently of MOM6. Previously, it was a safe assumption that both would be built with double precision, but this is no longer the case since FMS now supports both single and double precision. This could cause conflicts with mixed-precision builds.

This patch converts the values from FMS-precision to MOM-precision.

Single->double should not affect reproducibility since every single-precision number can be exactly represented in double precision. Double->single could affect reproducibility, but this is not an issue since MOM6 does not run in single precision.

Two latent heat constants are imported directly from FMS, which is built
independently of MOM6.  Previously, it was a safe assumption that both
would be built with double precision, but this is no longer the case
since FMS now supports both single and double precision.  This could
cause conflicts with mixed-precision builds.

This patch converts the values from FMS-precision to MOM-precision.

Single->double should not affect reproducibility since every
single-precision number can be exactly represented in double precision.
Double->single could affect reproducibility, but this is not an issue
since MOM6 does not run in single precision.
Copy link
Copy Markdown
Member

@Hallberg-NOAA Hallberg-NOAA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems to me to be correct and entirely sensible.

@Hallberg-NOAA
Copy link
Copy Markdown
Member

This PR has passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/25705.

@Hallberg-NOAA Hallberg-NOAA merged commit 0fdb47c into NOAA-GFDL:dev/gfdl Dec 9, 2024
@marshallward marshallward deleted the fms_constant_kind branch January 13, 2025 21:29
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