Skip to content

Commit c0273ef

Browse files
committed
Work around GFortran bug causing non-determinism
1 parent 7cc561c commit c0273ef

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/extensions/opencoarrays.F90

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,13 +581,15 @@ subroutine co_broadcast_c_char(a,source_image,stat,errmsg)
581581
character(kind=1,len=*), intent(out), optional :: errmsg
582582
! Local variables and constants:
583583
integer(c_int), allocatable :: a_cast_to_integer_array(:)
584+
character(len=len(a)) :: dummy
584585

585586
! Convert "a" to an integer(c_int) array where each 32-bit integer element holds four 1-byte characters
586587
a_cast_to_integer_array = transfer(a,[0_c_int])
587588
! Broadcast the integer(c_int) array
588589
call co_broadcast_c_int(a_cast_to_integer_array,source_image, stat, errmsg)
589590
! Recover the characters from the broadcasted integer(c_int) array
590-
a = transfer(a_cast_to_integer_array,repeat(' ',len(a)))
591+
dummy = ' '
592+
a = transfer(a_cast_to_integer_array,dummy)
591593

592594
end subroutine
593595

0 commit comments

Comments
 (0)