77 lines
2.4 KiB
Fortran
77 lines
2.4 KiB
Fortran
! SPIRALING...
|
|
! new Thu Apr 23 01:13.37 PM UTC 2026
|
|
!
|
|
module genplotting
|
|
implicit none
|
|
|
|
real :: xmin, xmax, ymin, ymax
|
|
private :: xmin, xmax, ymin, ymax
|
|
|
|
real :: xoffset, yoffset, xscale, yscale
|
|
private :: xoffset, yoffset, xscale, yscale
|
|
|
|
integer :: outunit
|
|
private :: outunit
|
|
|
|
contains
|
|
! ---------------------------------------------------------
|
|
subroutine genp_init (foo, fname)
|
|
integer, intent(in) :: foo
|
|
character (len=*), intent(in) :: fname
|
|
|
|
outunit = 6 ! stdout
|
|
if (len(fname) .gt. 0) then
|
|
write (0, '("genplot init opening : ", A)') fname
|
|
open(newunit=outunit,file=fname)
|
|
endif
|
|
|
|
xmin = 9e9 ; xmax = -9e9
|
|
ymin = 9e9 ; ymax = -9e9
|
|
xoffset = 0.0 ; yoffset = 0.0
|
|
xscale = 0.0 ; yscale = 0.0
|
|
end subroutine
|
|
! ---------------------------------------------------------
|
|
subroutine genp_move (px, py)
|
|
real, intent(in) :: px, py
|
|
write (outunit, '(2F12.5, I5)') px, py, -1
|
|
if (px .lt. xmin) xmin = px
|
|
if (px .gt. xmax) xmax = px
|
|
if (py .lt. ymin) ymin = py
|
|
if (py .gt. ymax) ymax = py
|
|
end subroutine
|
|
! ---------------------------------------------------------
|
|
subroutine genp_draw (px, py, color)
|
|
real, intent(in) :: px, py
|
|
integer, intent(in) :: color
|
|
write (outunit, '(2F12.5, I5)') px, py, color
|
|
if (px .lt. xmin) xmin = px
|
|
if (px .gt. xmax) xmax = px
|
|
if (py .lt. ymin) ymin = py
|
|
if (py .gt. ymax) ymax = py
|
|
end subroutine
|
|
! ---------------------------------------------------------
|
|
! ---------------------------------------------------------
|
|
subroutine genp_end (foo)
|
|
integer, intent(in) :: foo
|
|
|
|
write (0, '("--- genp_end ---")')
|
|
write (0, '("minmax X", 2F16.5)') xmin, xmax
|
|
write (0, '("minmax Y", 2F16.5)') ymin, ymax
|
|
|
|
write (outunit, '(2F16.5, I6)') xmin*1.05, ymin*1.05, -1
|
|
write (outunit, '(2F16.5, I6)') xmin*1.05, ymax*1.05, 0
|
|
write (outunit, '(2F16.5, I6)') xmax*1.05, ymax*1.05, 0
|
|
write (outunit, '(2F16.5, I6)') xmax*1.05, ymin*1.05, 0
|
|
write (outunit, '(2F16.5, I6)') xmin*1.05, ymin*1.05, 0
|
|
close (outunit)
|
|
|
|
if (6 .ne. outunit) then
|
|
write (0, '("genp_end on ", I6, " is ", I6)') outunit, foo
|
|
endif
|
|
|
|
end subroutine
|
|
! ---------------------------------------------------------
|
|
! ---------------------------------------------------------
|
|
|
|
end module genplotting
|