C ***************************************************************************** C DESCRIPTION: C In this simple example, an array is initialized and values assigned. C In the parallel version the root process initiates numtasks-1 number of C processes. It then distributes an equal portion of an array to each C process. Each process 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 process then sends its portion of the array back to the root C process. As the root receives back each portion of the array, selected C elements are displayed. 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