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

Make the handling of file units consistent for all unformatted files #12

Merged
merged 1 commit into from
Feb 16, 2021

Conversation

jamiebresch
Copy link

@jamiebresch jamiebresch commented Feb 10, 2021

This PR complements previous various commits to handle unformatted binary I/O.

Setting environment variable setenv GFORTRAN_CONVERT_UNIT 'big_endian:101-200' is still required for mpas/mpasjedi excutables built within mpas_bundle for reasons described in commit 7f75b3a.

The issue noted in https://github.com/JCSDA-internal/mpas-bundle/issues/86 is that 'native' should not have been set in GFORTRAN_CONVERT_UNIT. When the code is compiled with big_endian, setting runtime environment native (little_endian on cheyenne) overwrites the compilation setting. The ungrib files are read by mpas_init_atmosphere through unit number 10-100 in the original code.

This PR is a follow-on to MPAS-Dev#743, ensuring that mpas_new_unit and mpas_release_unit are used to manage file units instead of using fixed values.

@jjguerrette
Copy link

The changes look good to me. Thank you for catching my missing these cases of unformatted reads. I think our ctests in mpas-jedi do not cover these cases. Is there a way to add them to one of those ctests? Probably not... As long as the code builds, I say these changes are ready. This change should be added to MPAS-Dev#789.

@jamiebresch jamiebresch changed the title Make the handling of unformatted units consistent for all unformatted files Make the handling of file units consistent for all unformatted files Feb 11, 2021
@jjguerrette jjguerrette merged commit 77d24de into release-stable Feb 16, 2021
@liujake liujake deleted the feature/unformatted_unit branch August 25, 2022 20:33
climbfuji pushed a commit that referenced this pull request Aug 26, 2022
… files. (#12)

This PR complements previous various commits to handle unformatted binary I/O.

Setting environment variable `setenv GFORTRAN_CONVERT_UNIT 'big_endian:101-200'` is still required for mpas/mpasjedi excutables built within mpas_bundle for reasons described in commit 7f75b3a.

The issue noted in JCSDA-internal/mpas-bundle#86 is that 'native' should not have been set in GFORTRAN_CONVERT_UNIT. When the code is compiled with big_endian, setting runtime environment native (little_endian on cheyenne) overwrites the compilation setting. The ungrib files are read by mpas_init_atmosphere through unit number 10-100 in the original code.

This PR is a follow-on to MPAS-Dev#743, ensuring that `mpas_new_unit` and `mpas_release_unit` are used to manage file units instead of using fixed values.
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