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

Set enum_kind based on Fortran standard #231

Merged
merged 1 commit into from
Mar 9, 2022

Conversation

ashao
Copy link
Collaborator

@ashao ashao commented Mar 9, 2022

The enum_kind is now set in the fortran_c_interop module but made
publicly availabe via the client and dataset modules. This differs
from the previous implementation which attempted to set enum_kind
by creating a dummy enum and detecting the kind of it at compile
time. This however, broke compilation with GCC 6.3.0, because
that compiler chain allows for different 'types' of enums (a
departure from the Fortran standard).

This also removes the explicit declaration of the kind in most of
the tests since Fortran assignment should automatically convert
the value to the correct kind that the variable (e.g. err_code)
is declared as.

Closes #216

@ashao ashao requested a review from billschereriii March 9, 2022 00:46
@codecov-commenter
Copy link

Codecov Report

Merging #231 (d225efa) into develop (a78f629) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #231   +/-   ##
========================================
  Coverage    82.46%   82.46%           
========================================
  Files           51       51           
  Lines         2840     2840           
========================================
  Hits          2342     2342           
  Misses         498      498           

The enum_kind is now set in the fortran_c_interop module but made
publicly availabe via the client and dataset modules. This differs
from the previous implementation which attempted to set enum_kind
by creating a dummy enum and detecting the kind of it at compile
time. This however, broke compilation with GCC 6.3.0, because
that compiler chain allows for different 'types' of enums (a
departure from the Fortran standard).

This also removes the explicit declaration of the kind in most of
the tests since Fortran assignment should automatically convert
the value to the correct kind that the variable (e.g. err_code)
is declared as.
@ashao ashao force-pushed the explicit_kind_enum branch from d225efa to dfac492 Compare March 9, 2022 01:01
Copy link
Contributor

@billschereriii billschereriii left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for this update and the additional testing!

@ashao ashao merged commit 27384d7 into CrayLabs:develop Mar 9, 2022
@ashao ashao deleted the explicit_kind_enum branch March 9, 2022 19:21
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.

Support for GNU compiler and Fortran
3 participants