From 7150717170c6c9b9e41756890ff6c9facc154c1a Mon Sep 17 00:00:00 2001 From: Luca Bertagna Date: Mon, 16 Sep 2019 10:18:22 -0600 Subject: [PATCH] Fix #3183 The constant MPI_MAX_PROCESSOR_NAME is only defined if mpi headers are included, so it *must* be used only inside blocks guarded by `#ifdef _MPI` Also, removing redundant inclusion of mpif.h. --- components/homme/src/share/parallel_mod.F90 | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/components/homme/src/share/parallel_mod.F90 b/components/homme/src/share/parallel_mod.F90 index d3063d9283ae..01e70151d9ca 100644 --- a/components/homme/src/share/parallel_mod.F90 +++ b/components/homme/src/share/parallel_mod.F90 @@ -121,8 +121,6 @@ subroutine init_par(par,npes_in,npes_stride) type(parallel_t), intent(out) :: par #ifdef _MPI -#include - integer(kind=int_kind) :: ierr logical :: running ! state of MPI at beginning of initmp call #ifdef CAM @@ -182,6 +180,7 @@ end subroutine init_par subroutine initmp_from_par(par) type (parallel_t),intent(in):: par +#ifdef _MPI character(len=MPI_MAX_PROCESSOR_NAME) :: my_name character(len=MPI_MAX_PROCESSOR_NAME), allocatable :: the_names(:) integer(kind=int_kind),allocatable :: tarray(:) @@ -189,8 +188,6 @@ subroutine initmp_from_par(par) integer(kind=int_kind) :: ierr,tmp_min,tmp_max integer :: node_color -#ifdef _MPI -#include if (MPI_DOUBLE_PRECISION==20 .and. MPI_REAL8==18) then ! LAM MPI defined MPI_REAL8 differently from MPI_DOUBLE_PRECISION ! and LAM MPI's allreduce does not accept on MPI_REAL8 @@ -354,7 +351,6 @@ subroutine syncmp(par) type (parallel_t) par #ifdef _MPI -#include integer :: errorcode,errorlen,ierr character(len=MPI_MAX_ERROR_STRING) :: errorstring @@ -379,7 +375,6 @@ subroutine syncmp_comm(comm) integer :: comm #ifdef _MPI -#include integer :: errorcode,errorlen,ierr character(len=MPI_MAX_ERROR_STRING) :: errorstring