more useless work done

This commit is contained in:
tTh 2023-05-07 23:48:37 +02:00
parent c47b99bf7d
commit c2d6abdedb
5 changed files with 98 additions and 10 deletions

2
Modules/.gitignore vendored
View File

@ -1,5 +1,7 @@
chkpixels
t
trnd
*.pgm
*.pnm

View File

@ -1,29 +1,44 @@
#
# * Fortraneries *
# * Fortraneries from tTh *
#
# Makefile for the general purpose moduls
#
GFOPT = -Wall -Wextra -time -g
GFOPT = -Wall -Wextra -g -I.
all: chkpixels
all: chkpixels t
# -----------------------------------------------
spitpgm.o: spitpgm.f90 Makefile
gfortran $(GFOPT) -c $< -o $@
gfortran $(GFOPT) -c $<
pixrgb.o: pixrgb.f90 Makefile
gfortran $(GFOPT) -c $< -o $@
gfortran $(GFOPT) -c $<
centermag.o: centermag.f90 Makefile
gfortran $(GFOPT) -c $<
dummy.o: dummy.f90 Makefile
gfortran $(GFOPT) -c $<
trials.o: trials.f90 Makefile
gfortran $(GFOPT) -c $< -o $@
gfortran $(GFOPT) -c $<
mathstuff2.o: mathstuff2.f90 Makefile
gfortran $(GFOPT) -c $<
#
# programmes de testouille
#
OBJS = trials.o spitpgm.o pixrgb.o
OBJS = trials.o spitpgm.o pixrgb.o centermag.o dummy.o \
mathstuff2.o
chkpixels: chkpixels.f90 Makefile $(OBJS)
gfortran $(GFOPT) $< $(OBJS) -o $@
t: t.f90 Makefile $(OBJS)
gfortran $(GFOPT) $< $(OBJS) -o $@
trnd: trnd.f90 Makefile $(OBJS)
gfortran $(GFOPT) $< $(OBJS) -o $@

View File

@ -1,14 +1,29 @@
# General purpose modules
## Compiler un module
## spitpgm
Mmmmm...
## Modules disponibles
### spitpgm
Write gray level 2d buffer (aka picture) to disk in the NetPNM format.
## pixrgb
### pixrgb
Write 8 bits RGB pictures to PNM format.
## trials
### trials
Experimental WIPs from hell.
### dummy
A "do nothing" useless module. But you cas use it to fool an optimizing
compiler, or have a sane place to put a breakpoint with gdb
## TODO
- écrire la doc !

35
Modules/t.f90 Normal file
View File

@ -0,0 +1,35 @@
program t
use centermag
implicit none
type(t_centermag) :: cmag
print *, '====== programme de test ======'
cmag%wscr = 800
cmag%hscr = 600
call essai_centermag(cmag)
print *
STOP ': PAF LE CHIEN ?'
! --------------
contains
! --------------
subroutine essai_centermag(cm)
type(t_centermag), intent(in) :: cm
real :: rx, ry
call print_centermag (cm)
print *
call centermag_scr2real(1, 1, rx, ry)
print *, 'to real :', rx, ry
end subroutine
! --------------
end program

21
Modules/trnd.f90 Normal file
View File

@ -0,0 +1,21 @@
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