Dear developer,Â
When I test macOS native dislin library (
https://www.dislin.de/macos.html, intel and arm64 has same result), it seems has issue (compiled by gfortran-14 and 13 has same result), my test code:
program dislin_3d_plot
  use dislin
  implicit none
  integer, parameter :: N = 50
  integer :: id_draw, id_but1, id_but2, id_lab2
  double precision :: xrot1 = 50.0d0, xrot2 = 40.0d0
  double precision :: xray(N), yray(N), zmat(N,N)
  integer :: ip, ip1, ip2, i, j, ival
  double precision :: step, x, y
  double precision, parameter :: fpi = 3.14159265358979323846d0 / 180.0d0
  ! Initialize data arrays
  step = 360.0d0 / dble(N-1)
  do i = 1, N
    x = dble(i-1)*step
    xray(i) = x
    do j = 1, N
      y = dble(j-1)*step
      yray(j) = y
      zmat(i,j) = 2.0d0 * sin(x*fpi) * sin(y*fpi)
    end do
  end do
  ! Create GUI widgets
  call swgtit('DISLIN 3D Plot')
  call swgopt('track', 'scroll')
  call swgopt('center', 'position')
  CALL SWGOPT("TRACK","SCROLL")
 Â
  call swgwth(70)
  call wgini('hori', ip)
  call wgbas(ip, 'vert', ip1)
  call swgdrw(2100D0/2970D0)
  call wglab(ip1, 'DISLIN 3D Plot:', id_lab2)
  call wgdraw(ip1, id_draw)
 Â
 Â
  call swgwth(20)
  call wgbas(ip, 'form', ip2)
  call swgwin(0, 0, 200, 100)
  call wgpbut(ip2, 'Azimuthal',id_but1)
  call swgwin(0, 120, 200, 100)
  call wgpbut(ip2, 'Polar', id_but2)
  call swgcbk(id_but1, myplot)
  call swgcbk(id_but2, myplot)
! Â Â CALL REAWGT
  call myplot(id_but1)
  call wgfin()
contains
  subroutine myplot(id)
    integer, intent(in) :: id
    integer :: lev
    if (id == id_but1) then
      xrot1 = xrot1 + 10
    else if (id == id_but2) then
      xrot2 = xrot2 + 10
    end if
   Â
   Â
    CALL GETLEV(lev)
    write(*, "('Current level: ', I4)") lev
    if (lev /= 0) then
      write(*, *) "*******************Level ERROR*******************"
    end if
   Â
    call metafl('cons')
    call setxid(id_draw, 'widget')
    call scrmod('revers')
    CALL PAGE(3000,3000)
    CALL IMGFMT("RGB")
   Â
    write(*,*) "**************call disini()************"
    call disini()
    call erase()
    call hwfont()
    call name('X-axis', 'x')
    call name('Y-axis', 'y')
    call name('Z-axis', 'z')
    call labdig(-1, 'xyz')
    call axspos(700, 2800)
    call axslen(2100, 2100)
    call view3d(xrot1, xrot2, 6.0D0, 'angle')
    call height(40)
    call graf3d(0.0D0, 360D0, 0D0, 90D0, 0D0, 360D0, 0D0, 90D0, -3D0, 3D0, -3D0, 1D0)
    call surshd(xray, N, yray, N, zmat)
    call disfin()
    write(*,*) "**************call disfin()************"
   Â
  end subroutine myplot
end program dislin_3d_plot
The program maybe crash when frequently click two push button, console message:
Current level: Â Â 0
 **************call disini()************
 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 <<         END OF DISLIN / VERSION 11.5.2         <<
 <<  Date   : 11.04.2025  Time   : 12:23:24  Pageformat: PAGE  <<
 <<  Vectors : 1081     Warnings: 0     Fileformat: CONS  <<
 <<  Metafile:                          <<
 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 **************call disfin()************
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
Backtrace for this error:
Could not print backtrace: executable file is not an executable
If my program more complex, the report `Current level: ` maybe > 0,  I suspect if there's something wrong with the `disini` function.
Sincerely,
Mark