Fortraneries/Fraktalism/mods/xperiment.f90

56 lines
1.5 KiB
Fortran
Raw Permalink Normal View History

2022-10-29 06:53:57 +11:00
module xperiment
implicit none
contains
!===============================================================
! nouveau 24 mai 2022
2022-12-17 20:35:44 +11:00
subroutine parasites_1(pic, cx, cy, maxiter)
2022-10-29 06:53:57 +11:00
implicit none
integer, intent(inout), dimension (:,:) :: pic
real, intent(in) :: cx, cy
integer, intent(in) :: maxiter
integer :: ix, iy, width, height
real :: fx, fy, coef
logical :: burps
! write(0, *) "subroutine parasites_0" , maxiter
! write(0, *) "constantes", cx, cy
width = ubound(pic, 1) ; height = ubound(pic, 2)
coef = float(maxiter)
do ix = 1, width
fx = cx + (float(ix) / (float(width)/4.0) - 2.0)
burps = (RAND() .lt. 0.01)
do iy = 1, height
fy = cy + (float(iy) / (float(height)/4.0) - 2.0)
if (burps) then
pic(ix, iy) = int(fx * fy * coef * 1.005)
else
pic(ix, iy) = int(fx * fy * coef)
endif
enddo
enddo
2022-12-17 20:35:44 +11:00
end subroutine parasites_1
2022-10-29 06:53:57 +11:00
!---------------------------------------------------------------
!
! aucune idee de l'utilisation de ce truc !
!
2022-12-17 20:35:44 +11:00
subroutine loop_of_parasites_1(nbre, mode)
2022-10-29 06:53:57 +11:00
implicit none
integer, intent(in) :: nbre, mode
integer :: idx
if (mode .NE. 0) STOP "BAD MODE"
do idx = 0, nbre
write(0, *) "popcorn loop ", idx
enddo
2022-12-17 20:35:44 +11:00
end subroutine loop_of_parasites_1
2022-10-29 06:53:57 +11:00
!===============================================================
end module xperiment