This repository was archived by the owner on Oct 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Fix issue with halo exchanges of integer fields when running with RKIND=4 #931
Merged
douglasjacobsen
merged 1 commit into
MPAS-Dev:develop
from
mgduda:framework/int_halo_exch_fix
May 5, 2016
Merged
Fix issue with halo exchanges of integer fields when running with RKIND=4 #931
douglasjacobsen
merged 1 commit into
MPAS-Dev:develop
from
mgduda:framework/int_halo_exch_fix
May 5, 2016
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ND=4 The mpas_dmpar_exch_group_unpack_buffer_fieldNd_integer and mpas_dmpar_exch_group_pack_buffer_fieldNd_integer routines previously packed integer fields into a default real-kind (RKIND) buffer when performing halo exchanges for integer fields. However, this packing and unpacking was done using type conversions. This leads to incorrect results for integers that cannot be exactly represented when converted to a 32-bit real (potentially affecting integers greater than 2^24, or 16777216, in magnitude). Instead of type conversion, we now use the Fortran TRANSFER intrinsic to type cast integers to and from reals, since the halo exchange code in no way depends on the values stored in the exchange buffers.
This was referenced Oct 17, 2017
This was referenced Apr 6, 2018
This was referenced Jan 24, 2025
This was referenced Mar 3, 2025
Merged
This was referenced Mar 15, 2025
This was referenced Mar 26, 2025
This was referenced May 19, 2025
This was referenced May 22, 2025
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This merge corrects an issue in the new group halo exchange routines for integers when running in single precision.
The mpas_dmpar_exch_group_unpack_buffer_fieldNd_integer and mpas_dmpar_exch_group_pack_buffer_fieldNd_integer routines previously packed integer fields into a default real-kind (RKIND) buffer when performing halo exchanges for integer fields. However, this packing and unpacking was done using type conversions. This leads to incorrect results for integers that cannot be exactly represented when converted to a 32-bit real (potentially affecting integers greater than 2^24, or 16777216, in magnitude).
Instead of type conversion, we now use the Fortran TRANSFER intrinsic to type cast integers to and from reals, since the halo exchange code in no way depends on the values stored in the exchange buffers.