moving a module

This commit is contained in:
tTh 2023-05-07 23:46:45 +02:00
parent 5c4ff9133c
commit c47b99bf7d
3 changed files with 1 additions and 59 deletions

View File

@ -4,17 +4,13 @@
GFOPT = -Wall -Wextra -g -time
all: essai displaykinds
all: displaykinds
# -----------------------------------------------------
mathstuff2.o: mathstuff2.f90 Makefile
gfortran $(GFOPT) -c $<
# -----------------------------------------------------
essai: essai.f90 Makefile mathstuff2.o
gfortran $(GFOPT) $< mathstuff2.o -o $@
displaykinds: displaykinds.f90 Makefile
gfortran $(GFOPT) $< -o $@

View File

@ -1,21 +0,0 @@
program essai
use mathstuff2
implicit none
integer :: foo, bar
real :: quux
double precision :: somme
write(0, *) "----------------- essai -------------------"
call init_random_seed() ! in module 'mathstuff'
somme = 0.0
do foo=1, 500
quux = rand() + rand()
somme = somme + quux
bar = mod(irand(), 7)
print *, foo, quux, somme/foo, bar
enddo
end program

View File

@ -1,33 +0,0 @@
module mathstuff2
! XXX This module was a copy of mathstuff.f90 fromthe BloubWorld
! XXX wil be moved in an other place some day...
implicit none
contains
! ----------------------------------------------------------------
! really quick'n'dirty hack
! not really tested yet...
subroutine init_random_seed()
integer, dimension(3) :: tarray
integer :: t3, foo
real :: dummy
call itime(tarray)
t3 = 3600*tarray(1) + 60*tarray(2) + tarray(3)
! write(0, '(A,3I3,A,I6)') "sranding: ", tarray, " --> ", t3
call srand(t3)
! after initializing the random generator engine,
! you MUST use it for initializing the initializer
do foo=1, tarray(1)+5
dummy = rand()
enddo
end subroutine
! ----------------------------------------------------------------
end module mathstuff2