Fortraneries/GrafAnim/essai.f90

49 lines
1.0 KiB
Fortran
Raw Normal View History

2022-10-28 22:18:39 +02:00
program essai
use usegenplot
implicit none
2022-11-13 23:47:45 +01:00
integer :: foo, bar
integer :: nbarg
2022-11-22 08:58:56 +01:00
integer :: numframe = 0
2022-11-13 23:47:45 +01:00
character(len=32) :: arg
! write(0, *) "------------ essai graf anim ---------------"
nbarg = IARGC()
if (nbarg .GT. 0) then
call GETARG(1, arg)
2022-11-22 08:58:56 +01:00
! write (0, '(A40, A5)') "argument = ", arg
2022-11-13 23:47:45 +01:00
read (arg, *) numframe
endif
2022-11-22 08:58:56 +01:00
! write(0, '(A20, I5)') "frame number =", numframe
2022-11-13 23:47:45 +01:00
call init_genplot("essai.genplot")
2022-11-22 08:58:56 +01:00
call do_frame(7)
2022-11-13 23:47:45 +01:00
2022-11-22 08:58:56 +01:00
call gplt_setcol(2)
bar = (numframe * 20) - 120
do foo=20, 620, 50
2022-11-13 23:47:45 +01:00
call gplt_line(foo, 20, bar, 460)
call gplt_line(bar, 20, foo, 460)
enddo
2022-11-22 08:58:56 +01:00
call end_genplot("done for today")
2022-11-13 23:47:45 +01:00
contains !------------------------------------------
subroutine do_frame(color)
integer, intent(in) :: color
2022-11-22 08:58:56 +01:00
integer :: savecol
2022-10-28 22:18:39 +02:00
2022-11-22 08:58:56 +01:00
savecol = gplt_getcol()
call gplt_setcol(color)
call gplt_rect(0, 0, 640, 480)
call gplt_setcol(savecol)
2022-10-28 22:18:39 +02:00
2022-11-13 23:47:45 +01:00
end subroutine
2022-10-28 22:18:39 +02:00
end program