From 475d2e046c71453608f35f4afc644518705ca3ed Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 2 Dec 2024 16:31:48 -0700 Subject: [PATCH] Compiler workaround: Pull internal subroutine out to module-level This shouldn't be needed, but is needed with some Mac configurations to work around an issue with clang. Resolves esmf-org/nuopc-app-prototypes#8 --- ExternalDriverAPIWeakCplDAProto/nuopc_da.F90 | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/ExternalDriverAPIWeakCplDAProto/nuopc_da.F90 b/ExternalDriverAPIWeakCplDAProto/nuopc_da.F90 index 0d333cc..0c71781 100644 --- a/ExternalDriverAPIWeakCplDAProto/nuopc_da.F90 +++ b/ExternalDriverAPIWeakCplDAProto/nuopc_da.F90 @@ -116,6 +116,15 @@ recursive subroutine nuopcTopSetServices(gridcomp, rc) !----------------------------------------------------------------------------- + ! The following is used in commToVM. Some Mac configurations have issues with this being + ! an internal subroutine to commToVM, so we have pulled it out to a module-level + ! subroutine. (See https://github.com/esmf-org/nuopc-app-prototypes/issues/8.) + recursive subroutine dummySS(gridcomp, rc) + type(ESMF_GridComp) :: gridcomp ! must not be optional + integer, intent(out) :: rc ! must not be optional + rc = ESMF_SUCCESS + end subroutine + function commToVM(comm, rc) type(ESMF_VM) :: commToVM integer, intent(in) :: comm ! MPI communicator @@ -188,14 +197,6 @@ function commToVM(comm, rc) line=__LINE__, & file=__FILE__)) return - contains - - recursive subroutine dummySS(gridcomp, rc) - type(ESMF_GridComp) :: gridcomp ! must not be optional - integer, intent(out) :: rc ! must not be optional - rc = ESMF_SUCCESS - end subroutine - end function commToVM !-----------------------------------------------------------------------------