Fortraneries/BloubWorld/essai.f90

34 lines
709 B
Fortran
Raw Normal View History

2022-02-17 20:51:56 +11:00
program essai
2024-01-31 21:11:50 +11:00
! use bloubspace
2022-02-17 20:51:56 +11:00
use mathstuff
implicit none
2022-03-18 22:21:40 +11:00
2024-01-31 21:11:50 +11:00
call test_random(10)
2022-03-18 22:21:40 +11:00
STOP ': BECAUSE JOB IS DONE'
! --------------------------------------------------------------
contains
subroutine test_random(nbre)
integer, intent(in) :: nbre
2024-01-31 21:11:50 +11:00
integer :: foo
real :: quux, bar
2022-02-18 00:10:15 +11:00
double precision :: somme
2022-02-17 20:51:56 +11:00
2022-03-18 22:21:40 +11:00
call init_random_seed() ! in module 'mathstuff'
2022-02-18 00:10:15 +11:00
somme = 0.0
2022-03-18 22:21:40 +11:00
do foo=1, nbre
2024-01-31 21:11:50 +11:00
quux = 10.0 * rand()
2022-02-18 00:10:15 +11:00
somme = somme + quux
2024-01-31 21:11:50 +11:00
bar = quux ** (.1/.3)
print *, quux, bar, somme/foo
2022-02-17 20:51:56 +11:00
enddo
2022-03-18 22:21:40 +11:00
end subroutine test_random
! --------------------------------------------------------------
2022-02-17 20:51:56 +11:00
2022-03-18 22:21:40 +11:00
end program