SUBROUTINE ReadPMDataSequentially(size,rank,lib,task,ext,nelx,nel&
,imxss,iphsp,ipsd,ips,nprpmx,nxpmx,nprpm,ngpm,phspm,zgpm,xgpm)
IMPLICIT NONE; INCLUDE 'mpif.h'
!---------------------------------------------------------------------------------------
CHARACTER,INTENT(INOUT)::ext*3,lib*80,task*16
INTEGER,INTENT(INOUT)::nel,nelx,rank,size
!---------------------------------------------------------------------------------------
INTEGER,INTENT(INOUT):: imxss,iphsp,ipsd,ips
!---------------------------------------------------------------------------------------
INTEGER,INTENT(INOUT)::nprpm,nprpmx,nxpmx,ngpm(nelx-1,nprpmx)
CHARACTER,INTENT(INOUT)::phspm(nprpmx)*24
DOUBLE PRECISION,INTENT(INOUT)::xgpm(nxpmx),zgpm(nxpmx)
!---------------------------------------------------------------------------------------
INTEGER rankread
INTEGER ierr,status(MPI_STATUS_SIZE)
!---------------------------------------------------------------------------------------
rankread=0
IF(rank.EQ.0)THEN; rankread=1; ELSE;
  CALL MPI_RECV(rankread,1,MPI_INTEGER8,rank-1,1,MPI_COMM_WORLD,status,ierr)
ENDIF
IF(rankread.EQ.1)THEN
  CALL ReadPMData(lib,task,ext,nelx,nel,imxss,iphsp,ipsd,ips,nprpmx,nxpmx&
  ,nprpm,ngpm,phspm,zgpm,xgpm)
  !-------------------------------------------------------------------------------------
ENDIF
IF(rank.LT.size-1)CALL MPI_SEND(rankread,1,MPI_INTEGER8,rank+1,1,MPI_COMM_WORLD,ierr)
!---------------------------------------------------------------------------------------
RETURN
END
