Fortraneries/BloubWorld/essai.f90

33 lines
724 B
Fortran
Raw Permalink Normal View History

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