Random seed initialization

Angelo Graziosi angelo.graziosi@alice.it
Sat Apr 6 16:04:00 GMT 2013


Il 06/04/2013 17.53, Janus Weil ha scritto:
>> NOT if I use integer(8) for clock! i.e.,
>>
>> -INTEGER :: i, n, clock
>> +INTEGER :: i, n
>> +integer(8) :: clock
>
> Aha! I hope it is not a regression of my recent SYSTEM_CLOCK patch
> (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55548#c2).
>
> Could you please post the output of:
>
>
> PROGRAM test_system_clock
>    INTEGER(4) :: count4, rate4, max4
>    INTEGER(8) :: count8, rate8, max8
>
>    CALL SYSTEM_CLOCK(count4, rate4, max4)
>    WRITE(*,*) count4, rate4, max4
>
>    CALL SYSTEM_CLOCK(count8, rate8, max8)
>    WRITE(*,*) count8, rate8, max8
> END PROGRAM
>
>
> with both your 4.5 and 4.9 builds?

These are the results:

1. Cygwin GCC-4.5.3 (official release)

$ gfortran test_system_clock.f90 -o test_system_clock.out

$ ./test_system_clock.out
   1611644036        1000  2147483647
            1031299625              1000000           2147483647


2. GCC-4.9 (my build)

$ gfortran-4.9 test_system_clock.f90 -o test_system_clock.out

$ ./test_system_clock.out
            0        1000  2147483647
                 63136           1000000000  9223372036854775807

BTW, I had only a previous build of 4.8-20130310, but it gives the same 
results of 4.9.

Ciao,
  Angelo.



More information about the Fortran mailing list