program simple_mp integer :: rank, a(0:1), b(0:1), c(5) character*64 message write(*,*) "Enter rank (0 or 1):" read(*,*) rank ! passing a message open(unit=7,file="message") if ( rank == 0 ) then write(7,*) "this is the message" else read(7,'(a)') message write(*,*) "I read ", message endif close(7) ! independent work, results not shared if ( rank == 0 ) then a(0) = 27 else a(1) = 31 endif write(*,*) " a = ", a ! getting rid of the "if" b(rank) = rank+2 write(*,*) " b = ", b ! assigning a distributed length 10 vector do i = 1,5 c(i) = i+5*rank enddo write(*,*) " c = ", c end program simple_mp