      program example21b
      include 'mpif.h'
      integer ierr, rank, size
      integer comm_revs, rank1
      call MPI_INIT(ierr)
      call MPI_COMM_SIZE(MPI_COMM_WORLD, size, ierr)
      call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierr)
      call MPI_COMM_SPLIT(MPI_COMM_WORLD, 1, size-rank,
     &                    comm_revs, ierr)
      call MPI_COMM_RANK(comm_revs, rank1, ierr)
      print *, 'rank = ', rank,' rank1 = ', rank1
      call MPI_COMM_FREE(comm_revs, ierr)
      call MPI_FINALIZE(ierr)
      end
