Skip to content

Commit

Permalink
icepack_itd: fix format string length causing "output conversion error"
Browse files Browse the repository at this point in the history
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
  • Loading branch information
phil-blain committed Dec 1, 2021
1 parent 152bd70 commit 91ae9f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions columnphysics/icepack_itd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1953,8 +1953,8 @@ subroutine icepack_init_itd_hist (ncat, hin_max, c_hi_range)
write (c_nc, '(i2)') n

! Write hin_max to character string
write (c_hinmax1, '(f6.3)') hin_max(n-1)
write (c_hinmax2, '(f6.3)') hin_max(n)
write (c_hinmax1, '(f7.3)') hin_max(n-1)
write (c_hinmax2, '(f7.3)') hin_max(n)

! Save character string to write to history file
c_hi_range(n)=c_hinmax1//'m < hi Cat '//c_nc//' < '//c_hinmax2//'m'
Expand Down

0 comments on commit 91ae9f3

Please sign in to comment.