Allow real-valued attributes to be read with different precision using SMIOL #1091
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 PR allows real-valued attributes to be read with a different precision from
MPAS's native precision when using SMIOL.
Previously, the
mpas_io_get_att_real0d()
routine relied on its 'precision'optional argument to determine whether to attempt to read real-valued attributes
in a precision different from MPAS's native precision. However, in some parts of
the MPAS framework (specifically, in
mpas_bootstrap_framework_phase1()
), theMPAS_io_get_att()
routine is called without the 'precision' argument, leading toproblems in reading, e.g., 'sphere_radius' when the precision of the input file
is not the MPAS native precision.
Now, the
mpas_io_get_att_real0d()
routine first tries to read an attribute inMPAS's native precision; if that fails, a second attempt is made to read the
attribute using the opposite precision (single vs. double). If both attempts
fail, the attribute argument is set to a fill value and an error code is
returned. This allows MPAS to read real-valued attributes using SMIOL during the
bootstrapping process regardless of the precision of the input file.