home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / adaptor.zip / adapt.zip / adaptor / examples / dalib / generic / hostsend.f next >
Text File  |  1993-04-28  |  516b  |  25 lines

  1.       program hostsend
  2.  
  3. c     Note: This program should only demonstrate the functionality, but
  4. c           it is a very inefficient program
  5.  
  6.       parameter (N=100)
  7.       real ha (N), a(N), s
  8. cmf$  layout ha(:host)
  9.  
  10. c     this loop is only executed by the host
  11.  
  12.       do i = 1, N
  13.          ha(i) = i
  14.       end do
  15.  
  16.       do i = 1, N
  17.          x = ha(i)   ! host_send, host_recv
  18.          a(i) = x    ! have_i_value
  19.       end do
  20.  
  21.       s = sum (a)
  22.       print *, 'Result is ', s, ' should be ', N * (N+1) / 2
  23.  
  24.       end
  25.