Not sure where to post this. I have been using the latest DLLs no 13, and playing about with the new native %pl with a view towards using it to update data plots as a simulation progresses. The following code reveals some issues.
module data_mod
implicit none
integer, parameter :: dp = SELECTED_REAL_KIND(15,307)
integer, parameter :: npts_max = 10000
integer :: npts = 2000, npts_now(2) = 0
real(kind=dp) :: x(npts_max) = 0.d0, y(npts_max) = 0.d0, xend=0.d0, yend=0.d0
real(kind=dp), parameter :: pi = 3.1415926535897932d0
real(kind=dp), parameter :: two_pi = 2.d0*pi
real(kind=dp) :: len = 1.d0
real(kind=dp) :: ang = 0.0123d0
end module data_mod
module calc_mod
use data_mod
implicit none
contains
integer function build_gui()
include<windows.ins>
integer i
npts_now = 0
len=1.d0 !#### NEEDED WHEN complied in 64bit mode
i = winio@('%mn[Exit]&','exit')
i = winio@('%bg[grey]&')
i = winio@('%7.1ob&')
i = winio@('%ws&','Number of points')
i = winio@('%cb&')
i = winio@('%il&', 0, npts_max)
i = winio@('%rd&',npts)
i = winio@('%cb&')
i = winio@('%ws&','Length')
i = winio@('%cb&')
i = winio@('%rf&',len)
i = winio@('%cb&')
i = winio@('%ws&','Angle increment')
i = winio@('%cb&')
i = winio@('%rf&',ang)
i = winio@('%cb&')
i = winio@('%^tt[Plot]&',plot)
i = winio@('%cb&')
i = winio@('%ff&')
call winop@('%pl[native]')
call winop@('%pl[smoothing=4]')
CALL winop@('%pl[width=1]')
CALL winop@('%pl[x_array]')
call winop@('%pl[independent]')
call winop@('%pl[N_GRAPHS=2]')
CALL winop@('%pl[link=lines]')
CALL winop@('%pl[colour=blue,colour=red]')
call winop@('%pl[symbol=0,symbol=11]')
call winop@('%pl[pen_style=0]')
i = winio@('%`bg[white]&')
i = winio@('%pl&',650,600,npts_now,x,y,xend,yend)
i = winio@('%ff')
build_gui = 1
end function build_gui
integer function plot()
include<windows.ins>
integer i, counter
real(kind=dp) ang_last
write(6,*) 'Beginning FUNCTION PLOT'
x(1) = 0.d0 ; y(1) = 0.d0 ; xend = 0.d0 ; yend = 0.d0
ang_last = 0.d0
counter = 0
do i = 2, npts
ang_last = ang_last + ang*real(i,kind=dp)
if (ang_last .gt. two_pi) ang_last = ang_last - two_pi
if (ang_last .lt. two_pi) ang_last = ang_last + two_pi
x(i) = x(i-1) + len*cos(ang_last)
y(i) = y(i-1) + len*sin(ang_last)
npts_now(1) = i
npts_now(2) = 1
xend = x(i)
yend = y(i)
counter = counter + 1
if (counter .eq. 5 )then
call YIELD_PROGRAM_CONTROL@(Y_TEMPORARILY)
call simpleplot_redraw@()
counter = 0
end if
end do
write(6,*) 'Completed FUNCTION PLOT'
plot = 1
end function plot
end module calc_mod
program main
use calc_mod
implicit none
integer i
i = build_gui()
end program main





