minor changes also here

This commit is contained in:
tTh
2023-02-11 20:29:07 +01:00
parent c05d80a223
commit 87ff3d8815
7 changed files with 193 additions and 8 deletions

View File

@@ -3,26 +3,40 @@ module usegenplot
implicit none
integer, private :: color = 4
integer, private :: iochannel = -1
logical, private :: initialised = .FALSE.
contains
! -------------------------------------------------------------------
subroutine init_genplot(filename)
character(*), intent(in) :: filename
integer :: errcode
write(0, *) '--> init genplot "', filename, '"'
open(newunit=iochannel, file=filename, iostat=errcode)
write(0, *) 'iochannel', iochannel, 'errcode', errcode
initialised = .TRUE.
color = 4
! XXX STOP 'ABEND'
end subroutine
subroutine end_genplot(message)
character(*), intent(in) :: message
integer :: errcode
write(0, *) '--> end genplot "', message, '"'
initialised = .FALSE.
close(unit=iochannel, iostat=errcode)
write(0, *) 'close errcode', errcode
end subroutine
! -------------------------------------------------------------------
@@ -38,7 +52,7 @@ subroutine do_initialise_once(motif)
end subroutine
! -------------------------------------------------------------------
!- getter, setter, wtf ?
subroutine gplt_setcol(col)
integer, intent(in) :: col
color = col
@@ -55,8 +69,7 @@ subroutine gplt_move(x, y)
if (.NOT. initialised) then
call do_initialise_once('in gplt_move')
endif
print *, x, y, 0
write(iochannel, '(3I8)') x, y, 0
end subroutine
! -------------------------------------------------------------------
@@ -66,7 +79,7 @@ subroutine gplt_draw(x, y)
if (.NOT. initialised) then
call do_initialise_once('in gplt_draw')
endif
print *, x, y, color
write(iochannel, '(3I8)') x, y, color
end subroutine
! -------------------------------------------------------------------
@@ -78,10 +91,23 @@ subroutine gplt_line(x1, y1, x2, y2)
end subroutine
! -------------------------------------------------------------------
!-
! sx, sy
! +-------------------+
! | x2,y2 |
! | |
! | |
! | x1,y1 |
! +-------------------+
! 0,0
subroutine gplt_rect(x1, y1, x2, y2)
integer, intent(in) :: x1, y1, x2, y2
if (.NOT. initialised) then
call do_initialise_once('in gplt_rect')
endif
call gplt_move(x1, y1)
call gplt_draw(x2, y1)
call gplt_draw(x2, y2)