Closed climbfuji closed 4 months ago
@climbfuji This seems like a fine solution to me. The only question I have is about using include files, which isn't a huge deal to me.
We've determined that we don't need to support mpi (mpi_f90) and mpi_f08, so this PR isn't necessary. Therefore we can close this PR.
We are still debating whether we need to support no_mpi and mpi_f08, or whether we can simply make mpi_f08 a requirement for CCPP (framework and physics). The discussion is continued in PR #523
FOR DISCUSSION
@grantfirl @dustinswales @gold2718 THIS PR IS MEANT TO BE FOR DISCUSSION.
This PR builds on and includes everything from #523 , but generalizes CCPP (ccpp_prebuild, but also the capgen metadata parser; not yet the capgen code generator) to handle no-mpi, mpi (classic, mpi_f90 termed here) and mpi_f08 situations.
The workaround for the difference in types of the MPI communicator (integer for mpi, MPI_Comm for mpi_f08) and the fact that standard Fortran doesn't have type aliasing like C has is to create a new, fake Fortran standard type
ccpp_mpi_comm_type
. The metadata parser and code generator handle the type as if it was an integer. Preprocessor directives (standardized) are needed everywhere the type is used (host model var declaration, auto-generated caps, schemes using the MPI communicator from the host model). Note: the host model doesn't have to use this as long as it only ever uses ONE type of MPI and passes the correct cmake flag to the framework/physics.Caveats:
test_prebuild/test_mpi
not yet complete: will add actual MPI test to the code if this route is deemed reasonable; UPDATE: DONE IN COMMIT https://github.com/NCAR/ccpp-framework/pull/530/commits/ac8711e28dc3763290408954a4a27f447a0d4c89use
statement that the framework provides; include that everywhere (host model, caps, schemes) instead of repeating the CPP blockccpp_mpi_comm_type
toSTANDARD_VARIABLE_TYPES
/FORTRAN_INTRINSIC_TYPES
, could create another list of special types (maybe use a name that indicates that it requires the CPP macros)?Thoughts?
BELOW NOT UPDATED
[ 50 character, one line summary ]
[ Description of the changes in this commit. It should be enough information for someone not following this development to understand. Lines should be wrapped at about 72 characters. ]
User interface changes?: [ No/Yes ] [ If yes, describe what changed, and steps taken to ensure backward compatibilty ]
Fixes: [Github issue #s] And brief description of each issue.
Testing: test removed: unit tests: system tests: manual testing: