Hi,
I am experimenting with coarrays by writing simple toy programs in order to understand coarrays better.
In this program I want to read an input from the user which is an integer and send it to all the images.
However only image one receives it . How can I make it so that all images receive the input ?
PROGRAM coarray_exp1
IMPLICIT NONE
! This program tests how to split a do loop between images
INTEGER :: i,num[*],lower_halo,upper_halo
REAL :: full_sum, partial_sum[*]
IF (NUM_IMAGES() .EQ. 1) THEN
ERROR STOP "This needs to run on 2 images or more."
END IF
If (THIS_IMAGE() .EQ. 1) THEN
PRINT *, "Enter the numbers you want added up, please: "
READ *, num
END If
SYNC ALL
PRINT *, "From",THIS_IMAGE(),num[THIS_image()]," was recieved"
END PROGRAM coarray_exp1