Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix two output conversion errors #378

Merged

Conversation

phil-blain
Copy link
Member

PR checklist

  • Short (1 sentence) summary of your PR:
    title
  • Developer(s):
    me
  • Suggest PR reviewers from list in the column to the right.
  • Please copy the PR test results link or provide a summary of testing completed below.
    Only affects textual model output - I did not run the test suite but can if we feel it's needed.
  • How much do the PR code changes differ from the unmodified code?
    • bit for bit
    • different at roundoff level
    • more substantial
  • Does this PR create or have dependencies on CICE or any other models?
    • Yes: a CICE PR to update Icepack will follow once this one is merged
    • No
  • Does this PR add any new test cases?
    • Yes
    • No
  • Is the documentation being updated? ("Documentation" includes information on the wiki or in the .rst files from doc/source/, which are used to create the online technical docs at https://readthedocs.org/projects/cice-consortium-cice/.)
    • Yes
    • No, does the documentation need to be updated at a later time?
      • Yes
      • No
  • Please provide any additional information or relevant details below:

I stumbled upon this on our new systems, where I have to define FOR_DUMP_CORE_FILE in order to get core dumps (which was not necessary on Cray). This, along with the flag -check which we use in debug builds, leads to "output conversion error" being fatal instead of just severe (and so the model aborts instead of continuing and writing ****** for the offending write).

Note that we can also add -check nooutput_conversion to the compiling flags to completely bypass these errors, but I think it's better to fix them.

Full commit messages follow:


5edb20e icepack_fsd: fix format string length causing "output conversion error"

If floe_rad(n) or floe_rad(n-1) is greater or equal to 100, writing it
to c_fsd[12] with the format specifier '(f6.3)' causes an "output
conversion error" when compiling with the Intel compiler, as the format
spec is one digit short. This is not ideal for reasons detailed in the
previous commit.

Bump the format spec by one digit to avoid that error.

91ae9f3 icepack_itd: fix format string length causing "output conversion error"

With kcatbound = -1 (single category run) (or kcatbound = 2), hin_max(n)
is 100 (or 999), which is one character too long for the format
specification '(f6.3)' used to output it in icepack_init_itd_hist. This
leads to an "output conversion error" (Intel Fortran runtime error code
63, [1]), which is usually not fatal.

However, this error becomes fatal if FOR_DUMP_CORE_FILE [2] is defined in
the environment, which is necessary on some platforms to get core dumps
from a crashing program. Note that this interaction is not mentioned
in the Intel documentation.

Increase the format specifier by one digit to avoid this error. For
consistency, also increase it for 'hin_max(n-1)'.

[1] https://www.intel.com/content/www/us/en/develop/documentation/fortran-compiler-oneapi-dev-guide-and-reference/top/compiler-reference/error-handling/handling-run-time-errors/list-of-run-time-error-messages.html
[2] https://www.intel.com/content/www/us/en/develop/documentation/fortran-compiler-oneapi-dev-guide-and-reference/top/compilation/supported-environment-variables.html#supported-environment-variables_GUID-D3C9AA20-CD90-4833-8B90-AB971E7B90B1

With kcatbound = -1 (single category run) (or kcatbound = 2), hin_max(n)
is 100 (or 999), which is one character too long for the format
specification '(f6.3)' used to output it in icepack_init_itd_hist. This
leads to an "output conversion error" (Intel Fortran runtime error code
63, [1]), which is usually not fatal.

However, this error becomes fatal if FOR_DUMP_CORE_FILE [2] is defined in
the environment, which is necessary on some platforms to get core dumps
from a crashing program. Note that this interaction is *not* mentioned
in the Intel documentation.

Increase the format specifier by one digit to avoid this error. For
consistency, also increase it for 'hin_max(n-1)'.

[1] https://www.intel.com/content/www/us/en/develop/documentation/fortran-compiler-oneapi-dev-guide-and-reference/top/compiler-reference/error-handling/handling-run-time-errors/list-of-run-time-error-messages.html
[2] https://www.intel.com/content/www/us/en/develop/documentation/fortran-compiler-oneapi-dev-guide-and-reference/top/compilation/supported-environment-variables.html#supported-environment-variables_GUID-D3C9AA20-CD90-4833-8B90-AB971E7B90B1
If floe_rad(n) or floe_rad(n-1) is greater or equal to 100, writing it
to c_fsd[12] with the format specifier '(f6.3)' causes an "output
conversion error" when compiling with the Intel compiler, as the format
spec is one digit short. This is not ideal for reasons detailed in the
previous commit.

Bump the format spec by one digit to avoid that error.
Copy link
Contributor

@apcraig apcraig left a comment

Choose a reason for hiding this comment

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

Are we still OK with the temporary strings being 8 characters long? Should we increase the string length further and/or further increase the 7.3 to 10.3 or something? Just thought I'd ask, but will approve as is.

@phil-blain
Copy link
Member Author

@apcraig I'll check. My understanding is that the 7 in f7.3 is the total number of character, so with the string being 8 character long we're still good.

@apcraig apcraig merged commit b7148ee into CICE-Consortium:main Dec 2, 2021
TillRasmussen pushed a commit to TillRasmussen/Icepack that referenced this pull request Dec 7, 2021
* icepack_itd: fix format string length causing "output conversion error"

With kcatbound = -1 (single category run) (or kcatbound = 2), hin_max(n)
is 100 (or 999), which is one character too long for the format
specification '(f6.3)' used to output it in icepack_init_itd_hist. This
leads to an "output conversion error" (Intel Fortran runtime error code
63, [1]), which is usually not fatal.

However, this error becomes fatal if FOR_DUMP_CORE_FILE [2] is defined in
the environment, which is necessary on some platforms to get core dumps
from a crashing program. Note that this interaction is *not* mentioned
in the Intel documentation.

Increase the format specifier by one digit to avoid this error. For
consistency, also increase it for 'hin_max(n-1)'.

[1] https://www.intel.com/content/www/us/en/develop/documentation/fortran-compiler-oneapi-dev-guide-and-reference/top/compiler-reference/error-handling/handling-run-time-errors/list-of-run-time-error-messages.html
[2] https://www.intel.com/content/www/us/en/develop/documentation/fortran-compiler-oneapi-dev-guide-and-reference/top/compilation/supported-environment-variables.html#supported-environment-variables_GUID-D3C9AA20-CD90-4833-8B90-AB971E7B90B1

* icepack_fsd: fix format string length causing "output conversion error"

If floe_rad(n) or floe_rad(n-1) is greater or equal to 100, writing it
to c_fsd[12] with the format specifier '(f6.3)' causes an "output
conversion error" when compiling with the Intel compiler, as the format
spec is one digit short. This is not ideal for reasons detailed in the
previous commit.

Bump the format spec by one digit to avoid that error.

url cannot include %
@phil-blain phil-blain deleted the fix-output-conversion-errors branch February 13, 2024 16:19
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.

3 participants