Skip to content

Fix Fortran interface compilation issue using nvfortran#4115

Merged
WeiqunZhang merged 2 commits intoAMReX-Codes:developmentfrom
ylee88:fix_nvfortran_f_interface
Sep 2, 2024
Merged

Fix Fortran interface compilation issue using nvfortran#4115
WeiqunZhang merged 2 commits intoAMReX-Codes:developmentfrom
ylee88:fix_nvfortran_f_interface

Conversation

@ylee88
Copy link
Copy Markdown
Contributor

@ylee88 ylee88 commented Aug 28, 2024

Summary

This PR will fix the compilation issue for Fortran interfaces when using nvfortran, reported in #4111.

Additional background

The new module procedure interfaces for final subroutines are introduced to bypass the nvfortran compilation error. This change may not be needed according to the Fortran standard, but it effectively resolves compilation errors using nvfortran with -DAMReX_FORTRAN_INTERFACES=ON.

Checklist

The proposed changes:

  • fix a bug or incorrect behavior in AMReX
  • add new capabilities to AMReX
  • changes answers in the test suite to more than roundoff level
  • are likely to significantly affect the results of downstream AMReX users
  • include documentation in the code and/or rst files, if appropriate

@WeiqunZhang WeiqunZhang linked an issue Aug 28, 2024 that may be closed by this pull request
@WeiqunZhang WeiqunZhang merged commit 778e782 into AMReX-Codes:development Sep 2, 2024
WeiqunZhang pushed a commit that referenced this pull request Sep 23, 2025
## Summary
Resolves #4666.

I was able to build my code on ifx without triggering ICE by removing
these blocks. Turns out the ICE is triggered not just by finalizers, but
any type-bound procedure which is also in an interface block and made
independently public from the module, but fortunately I didn't find any
such procedures in AMReX.

These blocks are no-ops and completely harmless to remove since they
only contain single procedures each and don't rename anything. However
if you prefer, since they are valid Fortran, we could wrap them in
ifdefs so Intel compilers don't see them.

## Additional background
These interface blocks trigger an ifx ICE on user codes which invoke
`use ..., only:` on AMReX modules.

The interfaces were added in #4115 to address an nvfortran issue. -- Weiqun
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.

Fortran interface compilation issue with nvhpc

2 participants