Skip to content

Move external mpi defs to LIS_mpiMod.F90 - #1836

Open
danrosen25 wants to merge 1 commit into
NASA-LIS:masterfrom
danrosen25:fix/extmpi
Open

Move external mpi defs to LIS_mpiMod.F90#1836
danrosen25 wants to merge 1 commit into
NASA-LIS:masterfrom
danrosen25:fix/extmpi

Conversation

@danrosen25

@danrosen25 danrosen25 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor
  • wrap external mpi defs in USE_INCLUDE_MPI
  • fixes 'cannot change attributes of USE-associated symbol'

Description

I'm seeing a compiler error when compiling with gfortran@13.3 and mpich@5.0 within a ubuntu@24.04 container. The error says "cannot change attributes of USE-associated symbol" but because each file here includes use LIS_mpiMod these external definitions aren't needed because the compiler reads the mpi.mod file to define these procedures. This PR moves the external :: MPI_ definitions into the LIS_mpiMod.F90 file and sets them only when the compiler links using include 'mpif.h'

Resolves #1835

I'm not really sure if there is robust testing or a use case for -DUSE_INCLUDE_MPI but I did compile successfully with and without this flag. I think these changes could use a little more structured testing though.

Testcase

Including a container that was used to build LIS.
nlc_container.tar.gz

* wrap external mpi defs in USE_INCLUDE_MPI
* fixes cannot change attributes of USE-associated symbol
@jvgeiger jvgeiger self-assigned this Jul 23, 2026
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.

Compile Error (gfortran v13): Cannot change attributes of USE-associated symbol MPI_

2 participants