C ***************************************************************************** C Serial Example - Array Assignment - Fortran Version C FILE: ser_array.f C DESCRIPTION: C This is a simple array initialization and assignment. In the parallel C version, the master task initiates numtasks-1 number of C worker tasks. It then distributes an equal portion of an array to each C worker task. Each worker task receives its portion of the array, and C performs a simple value assignment to each of its elements. The value C assigned to each element is simply that element's index in the array+1. C Each worker task then sends its portion of the array back to the master C task. As the master receives back each portion of the array, selected C elements are displayed. C AUTHOR: Blaise Barney C LAST REVISED: 11/25/95 Blaise Barney C ************************************************************************** program array integer ARRAYSIZE parameter (ARRAYSIZE = 600000) integer index, i real*4 data(ARRAYSIZE) print *, '*********** Starting SERIAL Example ************' C Initialize the array do 20 i=1, ARRAYSIZE data(i) = 0.0 20 continue do 50 i=1, ARRAYSIZE data(i) = i + 1 50 continue C Print some results print *, '----------------------------------------------' print *, ' Sample Results ' print *, 'data[',1, ']=', data(1) print *, 'data[',100, ']=', data(100) print *, 'data[',1000, ']=', data(1000) print *, ' All Done!' end