Skip to content

Adds safety for single precision runs in mode_ice4_slow - #150

Open
dhaumont wants to merge 1 commit into
UMR-CNRM:aromefrom
dhaumont:bugfix/mode_ice4_slow_sp
Open

Adds safety for single precision runs in mode_ice4_slow#150
dhaumont wants to merge 1 commit into
UMR-CNRM:aromefrom
dhaumont:bugfix/mode_ice4_slow_sp

Conversation

@dhaumont

@dhaumont dhaumont commented Jul 29, 2026

Copy link
Copy Markdown

Another problem when running sp with harmonie-arome.

In single precision, the argument of EXP can get too large. This is solved by MIN(MAX_EXP_ARG,...), where MAX_EXP_ARG = 100.0 is a completely arbitrary number. It was intended to be a quick fix, not as a permanent solution. Someone from the PHYEX developers can probably give better advice.

Some discussions regarding the choise of MAX_EXP_ARG can be found here: #147 (comment)

Davai validation: https://www.umr-cnrm.fr/davai/lightView/3174

The results are non bit-reproducible for corsica (inconsistent), but it seems to be the case for all the Davai experiments
See also the original davai experiment performed for #147, when this change was still included (see #147 (comment))

Note: the PR is based on this commit: c3e76b3

@dhaumont
dhaumont force-pushed the bugfix/mode_ice4_slow_sp branch from 7aae083 to e1a6bcd Compare July 29, 2026 09:05
@pardallio

Copy link
Copy Markdown
Contributor

The maximum exp arg is precision dependent (88 for SP and 708 for DP), but we should lower it a few orders of magnitude to avoid further overflows since it is multiplied by something that is at least 1e3.

My suggestion is 80 (SP) and 700 (DP), use a similar logic to what is employed in https://github.com/UMR-CNRM/PHYEX/pull/147/changes to check the precision.

also the variable name should probably start with a Z because of coding conventions

@dhaumont

dhaumont commented Aug 27, 2026

Copy link
Copy Markdown
Author

The maximum exp arg is precision dependent (88 for SP and 708 for DP), but we should lower it a few orders of magnitude to avoid further overflows since it is multiplied by something that is at least 1e3.

My suggestion is 80 (SP) and 700 (DP), use a similar logic to what is employed in https://github.com/UMR-CNRM/PHYEX/pull/147/changes to check the precision.

also the variable name should probably start with a Z because of coding conventions

Could you implement take care of these improvements @pardallio ?

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