Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gfortran.dg/random_init_6.f90 @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
1 ! { dg-do run } | |
2 ! { dg-options "-fcoarray=single" } | |
3 program rantest | |
4 | |
5 implicit none | |
6 | |
7 logical, parameter :: debug = .false. | |
8 character(len=20) name | |
9 integer fd, i, n | |
10 integer, allocatable :: n1(:), n2(:), n3(:) | |
11 real x(4), y(4), z(4) | |
12 | |
13 if (debug) then | |
14 write(name,'(A,I0)') 'dat', this_image() | |
15 open(newunit=fd, file=name) | |
16 end if | |
17 | |
18 call random_seed(size=n) | |
19 allocate(n1(n), n2(n), n3(n)) | |
20 | |
21 call random_init(.false., .true.) | |
22 call random_seed(get=n1) | |
23 call random_number(x) | |
24 | |
25 call random_init(.false., .true.) | |
26 call random_seed(get=n2) | |
27 call random_number(y) | |
28 | |
29 call random_init(.false., .true.) | |
30 call random_seed(get=n3) | |
31 call random_number(z) | |
32 | |
33 if (debug) then | |
34 write(fd,'(A,4F12.6)') 'x = ', x | |
35 write(fd,'(A,4F12.6)') 'y = ', y | |
36 write(fd,'(A,4F12.6)') 'z = ', z | |
37 write(fd,*) | |
38 do i = 1, 5 | |
39 write(fd,'(I2,4I13)') i, n1(i), n2(i), n3(i) | |
40 end do | |
41 end if | |
42 | |
43 end program rantest |