OK boomer

This commit is contained in:
tTh
2022-11-22 08:58:56 +01:00
parent ecfcef2303
commit 8535ba09d9
5 changed files with 53 additions and 15 deletions

View File

@@ -1,6 +1,9 @@
module usegenplot
implicit none
integer, private :: color = 4
logical, private :: initialised = .FALSE.
contains
! -------------------------------------------------------------------
@@ -8,11 +11,29 @@ module usegenplot
subroutine init_genplot(filename)
character(*), intent(in) :: filename
write(0, *) '--> init genplot "', filename, '"'
initialised = .TRUE.
color = 4
end subroutine
subroutine end_genplot(message)
character(*), intent(in) :: message
write(0, *) '--> end genplot "', message, '"'
initialised = .FALSE.
end subroutine
! -------------------------------------------------------------------
subroutine gplt_setcol(col)
integer, intent(in) :: col
color = col
end subroutine
function gplt_getcol()
integer gplt_getcol
gplt_getcol = color
end function
! -------------------------------------------------------------------
subroutine gplt_move(x, y)
@@ -24,7 +45,7 @@ end subroutine
subroutine gplt_draw(x, y)
integer, intent(in) :: x, y
print *, x, y, 2
print *, x, y, color
end subroutine
! -------------------------------------------------------------------
@@ -36,11 +57,19 @@ subroutine gplt_line(x1, y1, x2, y2)
end subroutine
! -------------------------------------------------------------------
subroutine gplt_rect(x1, y1, x2, y2)
integer, intent(in) :: x1, y1, x2, y2! -------------------------------------------------------------------
integer, intent(in) :: x1, y1, x2, y2
call gplt_move(x1, y1)
call gplt_draw(x2, y1)
call gplt_draw(x2, y2)
call gplt_draw(x1, y2)
call gplt_draw(x1, y1)
end subroutine
! -------------------------------------------------------------------
! -------------------------------------------------------------------
end module