MODULE mpi_mod

#ifdef CPP_USING_MPI
  use mpi
#else
  INTEGER :: MPI_COMM_WORLD
  INTEGER :: MPI_REQUEST_NULL
  INTEGER :: MPI_REAL8, MPI_DOUBLE
  INTEGER :: MPI_INTEGER, MPI_INT
  INTEGER :: MPI_CHARACTER
  INTEGER :: MPI_LOGICAL
  INTEGER :: MPI_ANY_SOURCE
  INTEGER :: MPI_MAX, MPI_MIN
  INTEGER :: MPI_INFO_NULL
  INTEGER :: MPI_STATUS_SIZE 
  INTEGER :: MPI_SUM
  INTEGER :: MPI_THREAD_SINGLE, MPI_THREAD_FUNNELED
  INTEGER :: MPI_THREAD_SERIALIZED, MPI_THREAD_MULTIPLE
  INTEGER :: MPI_STATUSES_IGNORE
  
  INTEGER,PARAMETER :: MPI_ADDRESS_KIND=KIND(INTEGER)
#endif

END MODULE mpi_mod


#ifndef CPP_USING_MPI

 SUBROUTINE  MPI_INIT
   PRINT *, 'Compiled without MPI'
 END

 SUBROUTINE  MPI_INIT_THREAD
   PRINT *, 'Compiled without MPI'
 END
 
 SUBROUTINE  MPI_COMM_SIZE
 END

 SUBROUTINE  MPI_COMM_RANK
 END
 
 SUBROUTINE MPI_FINALIZE
 END
 
 SUBROUTINE MPI_ALLREDUCE
 END

 SUBROUTINE MPI_REDUCE
 END

 SUBROUTINE MPI_ALLTOALL
 END

 SUBROUTINE MPI_ISEND
 END

 SUBROUTINE MPI_ISSEND
 END

 SUBROUTINE MPI_IRECV
 END

 SUBROUTINE MPI_WAITALL
 END

 SUBROUTINE MPI_TESTALL
 END

 SUBROUTINE MPI_BARRIER
 END

 SUBROUTINE MPI_ALLGATHER
 END
 
 SUBROUTINE MPI_TYPE_EXTENT
 END
 
 SUBROUTINE MPI_ALLOC_MEM
 END

 SUBROUTINE MPI_FREE_MEM
 END

 SUBROUTINE MPI_BCAST
 END

 SUBROUTINE MPI_GATHER
 END
 
 SUBROUTINE MPI_ABORT(comm, err, ierr)
   INTEGER :: comm, err, ierr
   STOP ! err
 END
#endif
